# HG changeset patch # User Paper # Date 1695618442 14400 # Node ID e613772f41d53b20da728f11dc347ac0719ce9ba # Parent d8eb763e6661c3f16600c665a4a0362933313091 statistics.cpp: show requests made diff -r d8eb763e6661 -r e613772f41d5 include/core/session.h --- a/include/core/session.h Mon Sep 25 00:43:38 2023 -0400 +++ b/include/core/session.h Mon Sep 25 01:07:22 2023 -0400 @@ -6,7 +6,7 @@ struct Session { Config config; Session() { timer.start(); } - void AppendRequest() { requests++; }; + void IncrementRequests() { requests++; }; int GetRequests() { return requests; }; int uptime() { return timer.elapsed(); } diff -r d8eb763e6661 -r e613772f41d5 src/gui/pages/statistics.cpp --- a/src/gui/pages/statistics.cpp Mon Sep 25 00:43:38 2023 -0400 +++ b/src/gui/pages/statistics.cpp Mon Sep 25 01:07:22 2023 -0400 @@ -29,7 +29,7 @@ anime_list_data = anime_list_paragraph->GetParagraph(); TextWidgets::LabelledTextParagraph* application_paragraph = - new TextWidgets::LabelledTextParagraph("Minori", "Uptime:\nRequests made:", "", this); + new TextWidgets::LabelledTextParagraph("Minori", "Uptime:\nRequests made:", "\n", this); application_data = application_paragraph->GetParagraph(); layout()->addWidget(anime_list_paragraph); diff -r d8eb763e6661 -r e613772f41d5 src/gui/widgets/optional_date.cpp --- a/src/gui/widgets/optional_date.cpp Mon Sep 25 00:43:38 2023 -0400 +++ b/src/gui/widgets/optional_date.cpp Mon Sep 25 01:07:22 2023 -0400 @@ -15,7 +15,7 @@ _checkbox->setCheckState(enabled ? Qt::Checked : Qt::Unchecked); _checkbox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); - layout->addWidget(_checkbox); + layout->addWidget(_checkbox, 0, Qt::AlignVCenter); _dateedit = new QDateEdit(this); _dateedit->setDisplayFormat("yyyy-MM-dd"); diff -r d8eb763e6661 -r e613772f41d5 src/gui/window.cpp --- a/src/gui/window.cpp Mon Sep 25 00:43:38 2023 -0400 +++ b/src/gui/window.cpp Mon Sep 25 01:07:22 2023 -0400 @@ -68,15 +68,21 @@ QAction* action; QMenuBar* menubar = new QMenuBar(parent); QMenu* menu = menubar->addMenu("&File"); + QMenu* submenu = menu->addMenu("&Library folders"); action = submenu->addAction("&Add new folder..."); + action = menu->addAction("&Scan available episodes"); menu->addSeparator(); action = menu->addAction("Play &next episode"); + action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N)); action = menu->addAction("Play &random episode"); + action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R)); + menu->addSeparator(); + action = menu->addAction("E&xit", qApp, &QApplication::quit); menu = menubar->addMenu("&Services"); @@ -84,6 +90,7 @@ Services::Synchronize(); ((AnimeListWidget*)stack->widget((int)Pages::ANIME_LIST))->Refresh(); }); + action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); menu->addSeparator(); @@ -131,19 +138,32 @@ pages_group->setExclusive(true); action = pages_group->addAction(menu->addAction("&Now Playing")); + action->setCheckable(true); page_to_index_map[action] = 0; + action = pages_group->addAction(menu->addAction("&Anime List")); page_to_index_map[action] = 1; + + action->setCheckable(true); action->setChecked(true); action = pages_group->addAction(menu->addAction("&History")); + action->setCheckable(true); page_to_index_map[action] = 2; + action = pages_group->addAction(menu->addAction("&Statistics")); + action->setCheckable(true); page_to_index_map[action] = 3; + action = pages_group->addAction(menu->addAction("S&earch")); + action->setCheckable(true); page_to_index_map[action] = 4; + action = pages_group->addAction(menu->addAction("Se&asons")); + action->setCheckable(true); page_to_index_map[action] = 5; + action = pages_group->addAction(menu->addAction("&Torrents")); + action->setCheckable(true); page_to_index_map[action] = 6; connect(pages_group, &QActionGroup::triggered, this, [page_to_index_map, stack](QAction* action) { @@ -155,6 +175,8 @@ default: break; } }); + menu->addSeparator(); + menu->addAction("Show sidebar"); menu = menubar->addMenu("&Help"); action = menu->addAction("About &Qt", qApp, [this] { qApp->aboutQt(); }); diff -r d8eb763e6661 -r e613772f41d5 src/services/anilist.cpp --- a/src/services/anilist.cpp Mon Sep 25 00:43:38 2023 -0400 +++ b/src/services/anilist.cpp Mon Sep 25 01:07:22 2023 -0400 @@ -59,6 +59,7 @@ /* Use system certs... useful on Windows. */ curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA); CURLcode res = curl_easy_perform(curl); + session.IncrementRequests(); curl_slist_free_all(list); curl_easy_cleanup(curl); if (res != CURLE_OK) {