Mercurial > minori
comparison src/services/services.cc @ 81:9b2b41f83a5e
boring: mass rename to cc
because this is a very unix-y project, it makes more sense to use the
'cc' extension
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Mon, 23 Oct 2023 12:07:27 -0400 |
| parents | src/services/services.cpp@3d2decf093bb |
| children | 80f49f623d30 |
comparison
equal
deleted
inserted
replaced
| 80:825506f0e221 | 81:9b2b41f83a5e |
|---|---|
| 1 #include "services/services.h" | |
| 2 #include "core/session.h" | |
| 3 #include "gui/dialog/settings.h" | |
| 4 #include "services/anilist.h" | |
| 5 #include <QMessageBox> | |
| 6 | |
| 7 namespace Services { | |
| 8 | |
| 9 void Synchronize() { | |
| 10 switch (session.config.service) { | |
| 11 case Anime::Services::ANILIST: AniList::GetAnimeList(); break; | |
| 12 default: { | |
| 13 QMessageBox msg; | |
| 14 msg.setInformativeText("It seems you haven't yet selected a service to use."); | |
| 15 msg.setText("Would you like to select one now?"); | |
| 16 msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No); | |
| 17 msg.setDefaultButton(QMessageBox::Yes); | |
| 18 int ret = msg.exec(); | |
| 19 if (ret == QMessageBox::Yes) { | |
| 20 SettingsDialog dialog; | |
| 21 dialog.exec(); | |
| 22 } | |
| 23 break; | |
| 24 } | |
| 25 } | |
| 26 } | |
| 27 | |
| 28 void UpdateAnimeEntry(int id) { | |
| 29 switch (session.config.service) { | |
| 30 case Anime::Services::ANILIST: AniList::UpdateAnimeEntry(id); break; | |
| 31 default: break; | |
| 32 } | |
| 33 } | |
| 34 | |
| 35 bool Authorize() { | |
| 36 switch (session.config.service) { | |
| 37 case Anime::Services::ANILIST: return AniList::AuthorizeUser(); | |
| 38 default: return true; | |
| 39 } | |
| 40 } | |
| 41 | |
| 42 }; // namespace Services |
