From 33702e85865852fcb6b5003751424794980b1e1a Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 6 Nov 2024 12:56:47 +0400 Subject: [PATCH] Better "Download Finished" message box --- resources/i18n/en.json | 1 + resources/i18n/qqq.json | 1 + src/kprofile.cpp | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/i18n/en.json b/resources/i18n/en.json index b884f129..c779de63 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -45,6 +45,7 @@ "donate-to-support-kiwix":"Donate to support Kiwix", "exit":"Exit", "save-file-as-window-title":"Save File as", + "download-finished": "Download Finished", "download-finished-message":"The document has been downloaded.", "file":"File", "edit":"Edit", diff --git a/resources/i18n/qqq.json b/resources/i18n/qqq.json index 2fdc8c7b..e7fb7347 100644 --- a/resources/i18n/qqq.json +++ b/resources/i18n/qqq.json @@ -53,6 +53,7 @@ "donate-to-support-kiwix": "Represents the action of donating to support the Kiwix Organization.", "exit": "Represents the action of exiting the desktop application", "save-file-as-window-title": "Title text of the window prompting user to save as a new file.", + "download-finished": "Title of the message box announcing the completion of a download", "download-finished-message": "Text displayed when the download action has been completed", "file": "{{Identical|File}}", "edit": "{{Identical|Edit}}", diff --git a/src/kprofile.cpp b/src/kprofile.cpp index 5859ffd3..90e3afe3 100644 --- a/src/kprofile.cpp +++ b/src/kprofile.cpp @@ -2,8 +2,8 @@ #include "kiwixapp.h" #include -#include #include +#include "kiwixmessagebox.h" #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #define DownloadFinishedSignal WebEngineDownloadType::finished @@ -88,9 +88,10 @@ void KProfile::startDownload(WebEngineDownloadType* download) void KProfile::downloadFinished() { - QMessageBox msgBox; - msgBox.setText(gt("download-finished-message")); - msgBox.exec(); + showInfoBox(gt("download-finished"), + gt("download-finished-message"), + KiwixApp::instance()->getMainWindow() + ); } void ExternalReqInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)