Mercurial > minori
comparison src/gui/dialog/settings/services.cpp @ 15:cde8f67a7c7d
*: update, megacommit :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 19 Sep 2023 22:36:08 -0400 |
parents | fc1bf97c528b |
children | 619cbd6e69f9 |
comparison
equal
deleted
inserted
replaced
14:a29c9402faf0 | 15:cde8f67a7c7d |
---|---|
17 QLabel* sync_combo_box_label = new QLabel(tr("Active service and metadata provider:"), sync_group_box); | 17 QLabel* sync_combo_box_label = new QLabel(tr("Active service and metadata provider:"), sync_group_box); |
18 | 18 |
19 QComboBox* sync_combo_box = new QComboBox(sync_group_box); | 19 QComboBox* sync_combo_box = new QComboBox(sync_group_box); |
20 sync_combo_box->addItem(tr("AniList")); | 20 sync_combo_box->addItem(tr("AniList")); |
21 connect(sync_combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this, | 21 connect(sync_combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this, |
22 [this](int index) { service = static_cast<Anime::Services>(index + 1); }); | 22 [this](int index) { service = static_cast<Anime::Services>(index + 1); }); |
23 sync_combo_box->setCurrentIndex(static_cast<int>(service) - 1); | 23 sync_combo_box->setCurrentIndex(static_cast<int>(service) - 1); |
24 | 24 |
25 QLabel* sync_note_label = | 25 QLabel* sync_note_label = |
26 new QLabel(tr("Note: Minori is unable to synchronize multiple services at the same time."), sync_group_box); | 26 new QLabel(tr("Note: Minori is unable to synchronize multiple services at the same time."), sync_group_box); |
27 | 27 |
28 QVBoxLayout* sync_layout = new QVBoxLayout; | 28 QVBoxLayout* sync_layout = new QVBoxLayout; |
29 sync_layout->addWidget(sync_combo_box_label); | 29 sync_layout->addWidget(sync_combo_box_label); |
30 sync_layout->addWidget(sync_combo_box); | 30 sync_layout->addWidget(sync_combo_box); |
31 sync_layout->addWidget(sync_note_label); | 31 sync_layout->addWidget(sync_note_label); |
49 QLabel* username_entry_label = new QLabel(tr("Username: (not your email address)"), group_box); | 49 QLabel* username_entry_label = new QLabel(tr("Username: (not your email address)"), group_box); |
50 | 50 |
51 QWidget* auth_widget = new QWidget(group_box); | 51 QWidget* auth_widget = new QWidget(group_box); |
52 QLineEdit* username_entry = new QLineEdit(username, auth_widget); | 52 QLineEdit* username_entry = new QLineEdit(username, auth_widget); |
53 connect(username_entry, &QLineEdit::editingFinished, this, | 53 connect(username_entry, &QLineEdit::editingFinished, this, |
54 [this, username_entry] { username = username_entry->text(); }); | 54 [this, username_entry] { username = username_entry->text(); }); |
55 | 55 |
56 QPushButton* auth_button = new QPushButton(auth_widget); | 56 QPushButton* auth_button = new QPushButton(auth_widget); |
57 connect(auth_button, &QPushButton::clicked, this, [] { Services::AniList::AuthorizeUser(); }); | 57 connect(auth_button, &QPushButton::clicked, this, [] { Services::AniList::AuthorizeUser(); }); |
58 auth_button->setText(session.config.anilist.auth_token.empty() ? tr("Authorize...") : tr("Re-authorize...")); | 58 auth_button->setText(session.config.anilist.auth_token.empty() ? tr("Authorize...") : tr("Re-authorize...")); |
59 | 59 |