Mercurial > minori
annotate src/services/services.cpp @ 47:d8eb763e6661
information.cpp: add widgets to the list tab, and add an
"optional date" widget like taiga has so users can specify whether to
set the date or not
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 25 Sep 2023 00:43:38 -0400 |
parents | 619cbd6e69f9 |
children | 0c4138de2ea7 |
rev | line source |
---|---|
15 | 1 #include "services/services.h" |
10 | 2 #include "core/session.h" |
3 #include "services/anilist.h" | |
47
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
4 #include "gui/dialog/settings.h" |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
5 #include <QMessageBox> |
10 | 6 |
7 namespace Services { | |
8 | |
9 void Synchronize() { | |
10 switch (session.config.service) { | |
11 case Anime::Services::ANILIST: AniList::GetAnimeList(); break; | |
47
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
12 default: { |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
13 QMessageBox msg; |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
14 msg.setInformativeText("It seems you haven't yet selected a service to use."); |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
15 msg.setText("Would you like to select one now?"); |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
16 msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No); |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
17 msg.setDefaultButton(QMessageBox::Yes); |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
18 int ret = msg.exec(); |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
19 if (ret == QMessageBox::Yes) { |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
20 SettingsDialog dialog; |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
21 dialog.exec(); |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
22 } |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
23 break; |
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
24 } |
10 | 25 } |
26 } | |
27 | |
44
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
28 bool Authorize() { |
10 | 29 switch (session.config.service) { |
44
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
30 case Anime::Services::ANILIST: |
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
31 return AniList::AuthorizeUser(); |
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
32 default: |
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
33 return true; |
10 | 34 } |
35 } | |
36 | |
44
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
37 }; // namespace Services |