From a32cb7751f9a37fe8fa31e895c78204c2d0fc31b Mon Sep 17 00:00:00 2001 From: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:39:29 +0100 Subject: [PATCH] Prevent querying metadata with offline mode enabled --- src/downloadstab.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/downloadstab.cpp b/src/downloadstab.cpp index 25dfa8e48..c800275a9 100644 --- a/src/downloadstab.cpp +++ b/src/downloadstab.cpp @@ -86,6 +86,17 @@ void DownloadsTab::refresh() 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 it?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + m_core.settings().network().setOfflineMode(false); + } else { + return; + } + } + m_core.downloadManager()->queryDownloadListInfo(); }