Commit 115966e5 authored by Shubham  .'s avatar Shubham .
Browse files

Add messagebox after downloading of image/html file

parent c3338a9e
......@@ -6,6 +6,7 @@ set( DocumentationPanelPlugin_SRCS
add_panel(documentationpanelplugin ${DocumentationPanelPlugin_SRCS})
target_link_libraries(cantor_documentationpanelplugin
KF5::CoreAddons
Qt5::Widgets
Qt5::Help
Qt5::Gui
......
......@@ -22,6 +22,7 @@
#include "documentationpanelplugin.h"
#include <KLocalizedString>
#include <KMessageBox>
#include <QAction>
#include <QCompleter>
......@@ -371,6 +372,9 @@ void DocumentationPanelWidget::downloadResource(QWebEngineDownloadItem* resource
// default download directory is ~/Downloads on Linux
m_textBrowser->page()->download(resource->url());
resource->accept();
KMessageBox::information(this, i18n("The file has been downloaded successfully at Downloads."), i18n("Download Successfull"));
disconnect(m_textBrowser->page()->profile(), &QWebEngineProfile::downloadRequested, this, &DocumentationPanelWidget::downloadResource);
}
......
......@@ -66,7 +66,7 @@ class DocumentationPanelWidget : public QWidget
void searchForward();
void searchBackward();
void downloadResource(QWebEngineDownloadItem*); // slot for saving the image to local disk
void downloadResource(QWebEngineDownloadItem*); // slot for saving the image or html to local disk
private:
QHelpEngine* m_engine = nullptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment