Commit 9f2936b4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Implement export to pdf

parent 1c62b2e9
......@@ -2,7 +2,7 @@
the same menu entries at the same place in KMail and Kontact -->
<!DOCTYPE gui>
<gui version="543" name="kmmainwin" translationDomain="kmail">
<gui version="544" name="kmmainwin" translationDomain="kmail">
<MenuBar>
<Menu noMerge="1" name="file" >
<text>&amp;File</text>
......@@ -19,6 +19,7 @@
<Action name="file_open" />
<Action name="file_open_recent" />
<Action name="file_save_as" />
<Action name="file_export_pdf" />
<Action name="import"/>
<Separator/>
<Action name="file_print_preview"/>
......
......@@ -170,6 +170,7 @@
#include <QStatusBar>
#include <QAction>
#include <KRecentFilesAction>
#include <QFileDialog>
// Qt includes
#include <QByteArray>
......@@ -3595,7 +3596,7 @@ void KMMainWidget::setupActions()
mExportToPdfAction = new QAction(QIcon::fromTheme(QStringLiteral("application-pdf")), i18n("Export to Pdf..."), this);
actionCollection()->addAction(QStringLiteral("file_export_pdf"), mExportToPdfAction);
connect(mSaveAsAction, &QAction::triggered, this, &KMMainWidget::slotExportToPdf);
connect(mExportToPdfAction, &QAction::triggered, this, &KMMainWidget::slotExportToPdf);
}
void KMMainWidget::slotAddFavoriteFolder()
......@@ -4370,8 +4371,10 @@ KActionMenu *KMMainWidget::mailingListActionMenu() const
void KMMainWidget::slotExportToPdf()
{
if (mMsgView) {
//TODO
mMsgView->viewer()->exportToPdf(QString());
const QString fileName = QFileDialog::getSaveFileName(this, i18n("Export to Pdf"));
if (!fileName.isEmpty()) {
mMsgView->viewer()->exportToPdf(fileName);
}
}
}
......
......@@ -2,7 +2,7 @@
the same menu entries at the same place in KMail and Kontact -->
<!DOCTYPE gui>
<gui version="543" name="kmmainwin" translationDomain="kmail">
<gui version="544" name="kmmainwin" translationDomain="kmail">
<MenuBar>
<Menu noMerge="1" name="file" >
<text>&amp;File</text>
......@@ -19,6 +19,7 @@
<Action name="file_open" />
<Action name="file_open_recent" />
<Action name="file_save_as" />
<Action name="file_export_pdf" />
<Action name="import"/>
<Separator/>
<Action name="file_print_preview"/>
......
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