Commit f906beb0 authored by David Faure's avatar David Faure
Browse files

Port kolourpaint away from Kdeprint::createPrintDialog

Summary: This was the final step to port away from kdelibs4support.

Test Plan: The print dialog still has the 3rd widget with 2 radiobuttons like before.

Reviewers: broulik, andreagenor, tcanabrava, vkrause

Reviewed By: vkrause

Maniphest Tasks: T11576

Differential Revision: https://phabricator.kde.org/D25601
parent ea2d7440
...@@ -39,7 +39,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ...@@ -39,7 +39,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
XmlGui XmlGui
IconThemes IconThemes
TextWidgets TextWidgets
KDELibs4Support #kio::netaccess JobWidgets
) )
add_definitions(-DQT_USE_QSTRINGBUILDER) add_definitions(-DQT_USE_QSTRINGBUILDER)
......
...@@ -17,11 +17,11 @@ add_library(kolourpaint_lgpl SHARED ${kolourpaint_lgpl_SRCS}) ...@@ -17,11 +17,11 @@ add_library(kolourpaint_lgpl SHARED ${kolourpaint_lgpl_SRCS})
set(kolourpaint_lgpl_version 5) set(kolourpaint_lgpl_version 5)
target_link_libraries(kolourpaint_lgpl target_link_libraries(kolourpaint_lgpl
KF5::KDELibs4Support # kio::network
KF5::I18n KF5::I18n
KF5::GuiAddons KF5::GuiAddons
KF5::WidgetsAddons KF5::WidgetsAddons
KF5::KIOCore KF5::KIOCore
KF5::JobWidgets
Qt5::Widgets Qt5::Widgets
) )
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <KJobWidgets> #include <KJobWidgets>
#include <KIO/StoredTransferJob> #include <KIO/StoredTransferJob>
#include <KIO/FileCopyJob>
#include <KLocalizedString> #include <KLocalizedString>
#include <KMessageBox> #include <KMessageBox>
#include "kpLogCategories.h" #include "kpLogCategories.h"
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
#include <kstandardaction.h> #include <kstandardaction.h>
#include <ktoolinvocation.h> #include <ktoolinvocation.h>
#include <KLocalizedString> #include <KLocalizedString>
#include <kdeprintdialog.h> // kdelibs4support
#include "kpLogCategories.h" #include "kpLogCategories.h"
#include "commands/kpCommandHistory.h" #include "commands/kpCommandHistory.h"
...@@ -1323,15 +1322,12 @@ void kpMainWindow::sendImageToPrinter (QPrinter *printer, ...@@ -1323,15 +1322,12 @@ void kpMainWindow::sendImageToPrinter (QPrinter *printer,
auto *optionsPage = new kpPrintDialogPage (this); auto *optionsPage = new kpPrintDialogPage (this);
optionsPage->setPrintImageCenteredOnPage (d->configPrintImageCenteredOnPage); optionsPage->setPrintImageCenteredOnPage (d->configPrintImageCenteredOnPage);
QPrintDialog *printDialog = QPrintDialog printDialog (printer, this);
KdePrint::createPrintDialog ( printDialog.setOptionTabs ({optionsPage});
printer, printDialog.setWindowTitle (i18nc ("@title:window", "Print Image"));
QList <QWidget *> () << optionsPage,
this);
printDialog->setWindowTitle (i18nc ("@title:window", "Print Image"));
// Display dialog. // Display dialog.
const bool wantToPrint = printDialog->exec (); const bool wantToPrint = printDialog.exec ();
if (optionsPage->printImageCenteredOnPage () != if (optionsPage->printImageCenteredOnPage () !=
d->configPrintImageCenteredOnPage) d->configPrintImageCenteredOnPage)
...@@ -1345,8 +1341,6 @@ void kpMainWindow::sendImageToPrinter (QPrinter *printer, ...@@ -1345,8 +1341,6 @@ void kpMainWindow::sendImageToPrinter (QPrinter *printer,
cfg.sync (); cfg.sync ();
} }
delete printDialog;
if (!wantToPrint) { if (!wantToPrint) {
return; return;
} }
......
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