Mercurial > minori
comparison src/gui/window.cc @ 413:192da585a0a8 default tip
*: fix formatting
the clang-format file was broken andjust using LLVM defaults.
now it's fixed and is more in line with what I actually prefer my
code to look like -- esp. with regards to tabulators
| author | Paper <paper@tflc.us> |
|---|---|
| date | Sat, 25 Jul 2026 14:54:32 -0400 |
| parents | 963047512d34 |
| children |
comparison
equal
deleted
inserted
replaced
| 412:05aed03e0111 | 413:192da585a0a8 |
|---|---|
| 54 std::vector<std::string> files; | 54 std::vector<std::string> files; |
| 55 Track::Media::GetCurrentlyPlaying(files); | 55 Track::Media::GetCurrentlyPlaying(files); |
| 56 emit Done(files); | 56 emit Done(files); |
| 57 } | 57 } |
| 58 | 58 |
| 59 MainWindowAsyncSynchronizeThread::MainWindowAsyncSynchronizeThread(QAction *action, AnimeListPage *page, | 59 MainWindowAsyncSynchronizeThread::MainWindowAsyncSynchronizeThread( |
| 60 QObject *parent) | 60 QAction *action, AnimeListPage *page, QObject *parent) |
| 61 : QThread(parent) | 61 : QThread(parent) |
| 62 { | 62 { |
| 63 SetAction(action); | 63 SetAction(action); |
| 64 SetPage(page); | 64 SetPage(page); |
| 65 } | 65 } |
| 66 | 66 |
| 224 { | 224 { |
| 225 { | 225 { |
| 226 sync_action = menu->addAction(tr("Synchronize &list")); | 226 sync_action = menu->addAction(tr("Synchronize &list")); |
| 227 | 227 |
| 228 connect(sync_action, &QAction::triggered, this, | 228 connect(sync_action, &QAction::triggered, this, |
| 229 [this, sync_action] { AsyncSynchronize(sync_action, &stack_); }); | 229 [this, sync_action] { AsyncSynchronize(sync_action, &stack_); }); |
| 230 | 230 |
| 231 sync_action->setIcon(QIcon(":/icons/24x24/arrow-circle-double-135.png")); | 231 sync_action->setIcon(QIcon(":/icons/24x24/arrow-circle-double-135.png")); |
| 232 sync_action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S)); | 232 sync_action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S)); |
| 233 } | 233 } |
| 234 | 234 |
| 435 QMenu *menu = new QMenu(button); | 435 QMenu *menu = new QMenu(button); |
| 436 menu->addAction("Hibari", [] { QDesktopServices::openUrl(QUrl("https://hb.wopian.me/")); }); | 436 menu->addAction("Hibari", [] { QDesktopServices::openUrl(QUrl("https://hb.wopian.me/")); }); |
| 437 menu->addAction("MALgraph", [] { QDesktopServices::openUrl(QUrl("https://graph.anime.plus/")); }); | 437 menu->addAction("MALgraph", [] { QDesktopServices::openUrl(QUrl("https://graph.anime.plus/")); }); |
| 438 menu->addSeparator(); | 438 menu->addSeparator(); |
| 439 menu->addAction("AniChart", [] { QDesktopServices::openUrl(QUrl("https://anichart.net/airing")); }); | 439 menu->addAction("AniChart", [] { QDesktopServices::openUrl(QUrl("https://anichart.net/airing")); }); |
| 440 menu->addAction("Monthly.moe", | 440 menu->addAction( |
| 441 [] { QDesktopServices::openUrl(QUrl("https://www.monthly.moe/weekly")); }); | 441 "Monthly.moe", [] { QDesktopServices::openUrl(QUrl("https://www.monthly.moe/weekly")); }); |
| 442 menu->addAction("Senpai Anime Charts", | 442 menu->addAction("Senpai Anime Charts", |
| 443 [] { QDesktopServices::openUrl(QUrl("https://www.senpai.moe/?mode=calendar")); }); | 443 [] { QDesktopServices::openUrl(QUrl("https://www.senpai.moe/?mode=calendar")); }); |
| 444 menu->addSeparator(); | 444 menu->addSeparator(); |
| 445 menu->addAction("Anime Streaming Search Engine", | 445 menu->addAction( |
| 446 [] { QDesktopServices::openUrl(QUrl("https://because.moe/")); }); | 446 "Anime Streaming Search Engine", [] { QDesktopServices::openUrl(QUrl("https://because.moe/")); }); |
| 447 menu->addAction("The Fansub Database", [] { QDesktopServices::openUrl(QUrl("https://fansubdb.com")); }); | 447 menu->addAction("The Fansub Database", [] { QDesktopServices::openUrl(QUrl("https://fansubdb.com")); }); |
| 448 | 448 |
| 449 button->setMenu(menu); | 449 button->setMenu(menu); |
| 450 } | 450 } |
| 451 | 451 |
| 475 /* add in all of our existing folders... */ | 475 /* add in all of our existing folders... */ |
| 476 std::size_t i = 0; | 476 std::size_t i = 0; |
| 477 for (const auto &path : session.config.library.paths) { | 477 for (const auto &path : session.config.library.paths) { |
| 478 const QString folder = Strings::ToQString(path); | 478 const QString folder = Strings::ToQString(path); |
| 479 QAction *action = | 479 QAction *action = |
| 480 folder_menu->addAction(folder, [folder] { QDesktopServices::openUrl(QUrl::fromLocalFile(folder)); }); | 480 folder_menu->addAction(folder, [folder] { QDesktopServices::openUrl(QUrl::fromLocalFile(folder)); }); |
| 481 | 481 |
| 482 if (i < 9) { | 482 if (i < 9) { |
| 483 /* Qt::Key_1 is equivalent to 1 in ASCII, so we can use the same | 483 /* Qt::Key_1 is equivalent to 1 in ASCII, so we can use the same |
| 484 * stupid `'0' + i` trick here | 484 * stupid `'0' + i` trick here |
| 485 */ | 485 */ |
| 493 | 493 |
| 494 folder_menu->addSeparator(); | 494 folder_menu->addSeparator(); |
| 495 | 495 |
| 496 { | 496 { |
| 497 folder_menu->addAction(tr("&Add new folder..."), [this] { | 497 folder_menu->addAction(tr("&Add new folder..."), [this] { |
| 498 const QString dir = | 498 const QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), QDir::homePath(), |
| 499 QFileDialog::getExistingDirectory(this, tr("Open Directory"), QDir::homePath(), | 499 QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); |
| 500 QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); | |
| 501 if (dir.isEmpty()) | 500 if (dir.isEmpty()) |
| 502 return; | 501 return; |
| 503 session.config.library.paths.insert(Strings::ToUtf8String(dir)); | 502 session.config.library.paths.insert(Strings::ToUtf8String(dir)); |
| 504 UpdateFolderMenu(); | 503 UpdateFolderMenu(); |
| 505 }); | 504 }); |
