diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-04-27 01:04:36 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-04-27 01:04:36 +0200 |
commit | a03c2606e80829bb65bd5621e206f161a79a6e6c (patch) | |
tree | df61d69a38bbf0432af7f02bdb00e8775a50c7fa /src | |
parent | bookmarks fixes (diff) | |
download | rekonq-a03c2606e80829bb65bd5621e206f161a79a6e6c.tar.xz |
KDE printing system
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/mainwindow.cpp | 17 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3e22ac5d..a64cc747 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,6 +50,7 @@ TARGET_LINK_LIBRARIES( rekonq ${QT_QTNETWORK_LIBRARY} ${QT_QTWEBKIT_LIBRARY} ${QT_QTUITOOLS_LIBRARY} + ${KDE4_KUTILS_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 78995855..a9364ef1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -59,6 +59,9 @@ #include <KPushButton> #include <KTemporaryFile> +#include <kdeprintdialog.h> +#include <kprintpreview.h> + // Qt Includes #include <QtGui> @@ -533,14 +536,15 @@ void MainWindow::slotFileOpen() } -// TODO: Port to KDE void MainWindow::slotFilePrintPreview() { if (!currentTab()) return; - QPrintPreviewDialog *dialog = new QPrintPreviewDialog(this); - connect(dialog, SIGNAL(paintRequested(QPrinter *)), currentTab(), SLOT(print(QPrinter *))); - dialog->exec(); + + QPrinter printer; + KPrintPreview previewdlg( &printer, this ); + currentTab()->print(&printer); + previewdlg.exec(); } @@ -552,12 +556,11 @@ void MainWindow::slotFilePrint() } -// TODO: Port to KDE void MainWindow::printRequested(QWebFrame *frame) { QPrinter printer; - QPrintDialog *dialog = new QPrintDialog(&printer, this); - dialog->setWindowTitle(i18n("Print Document")); + + QPrintDialog *dialog = KdePrint::createPrintDialog( &printer, this ); if (dialog->exec() != QDialog::Accepted) return; frame->print(&printer); |