Mercurial > minori
comparison src/gui/dialog/settings/services.cc @ 319:d928ec7b6a0d
services/kitsu: implement GetAnimeList()
it finally works!
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Wed, 12 Jun 2024 17:52:26 -0400 |
| parents | b1f4d1867ab1 |
| children |
comparison
equal
deleted
inserted
replaced
| 318:3b355fa948c7 | 319:d928ec7b6a0d |
|---|---|
| 91 credentials_grid_layout->addWidget(password_label, 0, 1); | 91 credentials_grid_layout->addWidget(password_label, 0, 1); |
| 92 credentials_grid_layout->addWidget(password, 1, 1); | 92 credentials_grid_layout->addWidget(password, 1, 1); |
| 93 | 93 |
| 94 { | 94 { |
| 95 QPushButton* auth_button = new QPushButton(credentials_grid); | 95 QPushButton* auth_button = new QPushButton(credentials_grid); |
| 96 connect(auth_button, &QPushButton::clicked, this, [email, password] { | 96 connect(auth_button, &QPushButton::clicked, this, [auth_button, email, password] { |
| 97 Services::Kitsu::AuthorizeUser(Strings::ToUtf8String(email->text()), Strings::ToUtf8String(password->text())); | 97 if (Services::Kitsu::AuthorizeUser(Strings::ToUtf8String(email->text()), Strings::ToUtf8String(password->text()))) |
| 98 auth_button->setText(tr("Re-authorize...")); | |
| 99 else | |
| 100 auth_button->setText(tr("Authorize...")); | |
| 98 }); | 101 }); |
| 99 auth_button->setText(session.config.auth.kitsu.access_token.empty() ? tr("Authorize...") | 102 auth_button->setText(session.config.auth.kitsu.access_token.empty() ? tr("Authorize...") |
| 100 : tr("Re-authorize...")); | 103 : tr("Re-authorize...")); |
| 101 credentials_grid_layout->addWidget(auth_button, 1, 2); | 104 credentials_grid_layout->addWidget(auth_button, 1, 2); |
| 102 } | 105 } |
