From e72f9a8f5fc2cd1cb4bba110eac05a44b7ba0fb2 Mon Sep 17 00:00:00 2001 From: Johannes Troscher Date: Wed, 8 Feb 2012 10:06:35 +0100 Subject: 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 --- src/mainwindow.cpp | 13 +++++++++---- 1 file 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 #include #include +#include #include #include @@ -94,7 +95,6 @@ #include #include #include -#include #include #include @@ -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; + } } -- cgit v1.2.1