diff options
| author | Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> | 2025-05-23 09:24:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-23 09:24:23 +0200 |
| commit | 5d766e94a7a3b3fa861d57d3ad6ae619d98dd5d8 (patch) | |
| tree | ab91e870302fec6c5ef8b0bbc90cda8e480ec368 /src/downloadstab.cpp | |
| parent | a823d2aa88bd00d10370d5516c4426e8780435f7 (diff) | |
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 <dudonadrien@gmail.com>
Co-authored-by: KenJyn76 <liambonilla@gmail.com>
Co-authored-by: Al <26797547+Al12rs@users.noreply.github.com>
Diffstat (limited to 'src/downloadstab.cpp')
| -rw-r--r-- | src/downloadstab.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
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] { |
