Commit 406c8a11 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix export as html

parent 55415f3a
......@@ -32,7 +32,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${akregator_SOURCE_DIR})
find_package(Grantlee5 "5.1" CONFIG REQUIRED)
set(LIBKLEO_LIB_VERSION_LIB "5.2.40")
set(MESSAGELIB_LIB_VERSION_LIB "5.2.66")
set(MESSAGELIB_LIB_VERSION_LIB "5.2.68")
set(KDEPIMLIBS_LIB_VERSION "5.2.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.2.40")
set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
......
......@@ -33,6 +33,7 @@
#include <WebEngineViewer/WebEnginePrintMessageBox>
#include <WebEngineViewer/FindBarWebEngineView>
#include <webengineviewer/config-webengineviewer.h>
#include <WebEngineViewer/WebEngineExportHtmlPageJob>
#ifdef WEBENGINEVIEWER_PRINTPREVIEW_SUPPORT
#include <WebEngineViewer/PrintPreviewDialog>
#include <WebEngineViewer/PrintWebEngineViewJob>
......@@ -131,12 +132,25 @@ void ArticleViewerWebEngineWidgetNg::slotPrintPreview()
QPointer<WebEngineViewer::WebEnginePrintMessageBox> dialog = new WebEngineViewer::WebEnginePrintMessageBox(this);
connect(dialog.data(), &WebEngineViewer::WebEnginePrintMessageBox::openInBrowser, this, &ArticleViewerWebEngineWidgetNg::slotOpenInBrowser);
connect(dialog.data(), &WebEngineViewer::WebEnginePrintMessageBox::openPrintPreview, this, &ArticleViewerWebEngineWidgetNg::slotOpenPrintPreviewDialog);
dialog->setWebEngineView(mArticleViewerNg);
dialog->exec();
delete dialog;
}
void ArticleViewerWebEngineWidgetNg::slotOpenInBrowser(const QString &filename)
void ArticleViewerWebEngineWidgetNg::slotOpenInBrowser()
{
WebEngineViewer::WebEngineExportHtmlPageJob *job = new WebEngineViewer::WebEngineExportHtmlPageJob;
job->setEngineView(mArticleViewerNg);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::failed, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageFailed);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::success, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageSuccess);
job->start();
}
void ArticleViewerWebEngineWidgetNg::slotExportHtmlPageFailed()
{
qCDebug(AKREGATOR_LOG) << " Failed to export as HTML";
}
void ArticleViewerWebEngineWidgetNg::slotExportHtmlPageSuccess(const QString &filename)
{
MimeTreeParser::AttachmentTemporaryFilesDirs *browserTemporaryFile = new MimeTreeParser::AttachmentTemporaryFilesDirs;
browserTemporaryFile->addTempFile(filename);
......
......@@ -58,8 +58,9 @@ private Q_SLOTS:
void slotPdfFailed();
void slotPdfCreated(const QString &filename);
void slotOpenPrintPreviewDialog();
void slotOpenInBrowser(const QString &filename);
void slotOpenInBrowser();
void slotExportHtmlPageSuccess(const QString &filename);
void slotExportHtmlPageFailed();
private:
void initializeActions(KActionCollection *ac);
void initializeLayout(KActionCollection *ac);
......
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