summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp13
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;
+ }
}