diff options
author | Johannes Troscher <fritz_van_tom@hotmail.com> | 2012-02-08 10:06:35 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-02-08 10:06:35 +0100 |
commit | e72f9a8f5fc2cd1cb4bba110eac05a44b7ba0fb2 (patch) | |
tree | 63176bba3fa8976b90b4acc6224453dc87d9e1e9 /src | |
parent | Control content editable text with qtwebkit APIs instead of rude JS... (diff) | |
download | rekonq-e72f9a8f5fc2cd1cb4bba110eac05a44b7ba0fb2.tar.xz |
Move to KDE Print Dialog
This to have advanced printing options, available in KDE printing
dialog, removing the print preview.
Sorry for the forced choice. Actual KDE Print Preview dialog is a pain,
we cannot directly provide it.
REVIEW:103880
REVIEWED-BY: adjam
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 97f4d94e..c2fbafd7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -79,6 +79,7 @@ #include <KTemporaryFile> #include <KToggleFullScreenAction> #include <KXMLGUIFactory> +#include <kdeprintdialog.h> #include <KParts/Part> #include <KParts/BrowserExtension> @@ -94,7 +95,6 @@ #include <QtGui/QLabel> #include <QtGui/QPrintDialog> #include <QtGui/QPrinter> -#include <QtGui/QPrintPreviewDialog> #include <QtGui/QVBoxLayout> #include <QtWebKit/QWebHistory> @@ -833,11 +833,16 @@ void MainWindow::printRequested(QWebFrame *frame) } QPrinter printer; - QPrintPreviewDialog previewdlg(&printer, this); + printer.setDocName(printFrame->title()); + QPrintDialog *printDialog = KdePrint::createPrintDialog(&printer, this); - connect(&previewdlg, SIGNAL(paintRequested(QPrinter*)), printFrame, SLOT(print(QPrinter*))); + if (printDialog) //check if the Dialog was created + { + if (printDialog->exec()) + printFrame->print(&printer); - previewdlg.exec(); + delete printDialog; + } } |