From 5d766e94a7a3b3fa861d57d3ad6ae619d98dd5d8 Mon Sep 17 00:00:00 2001 From: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> Date: Fri, 23 May 2025 09:24:23 +0200 Subject: Mass Metadata Parsing: Prevent re-querying and manual prompts to enter missing data (#2135) * Add a button to "Query Info" of every download in the list --------- Co-authored-by: Deewens Co-authored-by: KenJyn76 Co-authored-by: Al <26797547+Al12rs@users.noreply.github.com> --- src/downloadstab.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/downloadstab.cpp') diff --git a/src/downloadstab.cpp b/src/downloadstab.cpp index bf3ea9ad..958efbd5 100644 --- a/src/downloadstab.cpp +++ b/src/downloadstab.cpp @@ -5,8 +5,9 @@ #include "ui_mainwindow.h" DownloadsTab::DownloadsTab(OrganizerCore& core, Ui::MainWindow* mwui) - : m_core(core), ui{mwui->btnRefreshDownloads, mwui->downloadView, - mwui->showHiddenBox, mwui->downloadFilterEdit} + : m_core(core), + ui{mwui->btnRefreshDownloads, mwui->btnQueryDownloadsInfo, mwui->downloadView, + mwui->showHiddenBox, mwui->downloadFilterEdit} { DownloadList* sourceModel = new DownloadList(m_core, ui.list); @@ -26,6 +27,9 @@ DownloadsTab::DownloadsTab(OrganizerCore& core, Ui::MainWindow* mwui) connect(ui.refresh, &QPushButton::clicked, [&] { refresh(); }); + connect(ui.queryInfos, &QPushButton::clicked, [&] { + queryInfos(); + }); connect(ui.list, SIGNAL(installDownload(int)), &m_core, SLOT(installDownload(int))); connect(ui.list, SIGNAL(queryInfo(int)), m_core.downloadManager(), SLOT(queryInfo(int))); @@ -80,6 +84,22 @@ void DownloadsTab::refresh() m_core.downloadManager()->refreshList(); } +void DownloadsTab::queryInfos() +{ + if (m_core.settings().network().offlineMode()) { + if (QMessageBox::warning(nullptr, tr("Query Metadata"), + tr("Cannot query metadata while offline mode is enabled. " + "Do you want to disable offline mode?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + m_core.settings().network().setOfflineMode(false); + } else { + return; + } + } + + m_core.downloadManager()->queryDownloadListInfo(); +} + void DownloadsTab::resumeDownload(int downloadIndex) { m_core.loggedInAction(ui.list, [this, downloadIndex] { -- cgit v1.3.1