Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rhabacker:branches:windows:mingw
libqt4
0001-Add-apply-button-to-unix-variant-of-QPrint...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Add-apply-button-to-unix-variant-of-QPrintDialog.patch of Package libqt4
From d89167c990fa57d56867ea9e34aaf299250602a1 Mon Sep 17 00:00:00 2001 From: Ralf Habacker <ralf.habacker@freenet.de> Date: Wed, 4 Mar 2020 15:23:17 +0100 Subject: [PATCH] Add apply button to unix variant of QPrintDialog This also allows the Unix version of the print dialog to only adapt changes and not to print immediately, which is possible on Windows. --- src/gui/dialogs/qprintdialog.h | 1 + src/gui/dialogs/qprintdialog_unix.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qprintdialog.h b/src/gui/dialogs/qprintdialog.h index 352c5f8673..61135d62ec 100644 --- a/src/gui/dialogs/qprintdialog.h +++ b/src/gui/dialogs/qprintdialog.h @@ -145,6 +145,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool)) #if defined (Q_OS_UNIX) && !defined (Q_OS_MAC) Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog()) + Q_PRIVATE_SLOT(d_func(), void _q_applyDialog()) #endif # if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) && !defined(QT_NO_MESSAGEBOX) Q_PRIVATE_SLOT(d_func(), void _q_checkFields()) diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index a851d47a2b..74493f4b98 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -128,6 +128,8 @@ public: #endif void _q_collapseOrExpandDialog(); + void _q_applyDialog(); + void setupPrinter(); void updateWidgets(); @@ -392,7 +394,7 @@ void QPrintDialogPrivate::init() options.grayscale->setIcon(QIcon(QLatin1String(":/trolltech/dialogs/qprintdialog/images/status-gray-scale.png"))); top->d->setOptionsPane(this); - buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, q); + buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Apply, Qt::Horizontal, q); collapseButton = new QPushButton(QPrintDialog::tr("&Options >>"), buttons); buttons->addButton(collapseButton, QDialogButtonBox::ResetRole); bottom->setVisible(false); @@ -400,6 +402,7 @@ void QPrintDialogPrivate::init() QPushButton *printButton = buttons->button(QDialogButtonBox::Ok); printButton->setText(QPrintDialog::tr("&Print")); printButton->setDefault(true); + QPushButton *applyButton = buttons->button(QDialogButtonBox::Apply); QVBoxLayout *lay = new QVBoxLayout(q); q->setLayout(lay); @@ -422,6 +425,8 @@ void QPrintDialogPrivate::init() q, SLOT(_q_chbPrintLastFirstToggled(bool))); QObject::connect(collapseButton, SIGNAL(released()), q, SLOT(_q_collapseOrExpandDialog())); + + QObject::connect(applyButton, SIGNAL(released()), q, SLOT(_q_applyDialog())); } void QPrintDialogPrivate::applyPrinterProperties(QPrinter *p) @@ -482,6 +487,13 @@ void QPrintDialogPrivate::_q_checkFields() } #endif // QT_NO_MESSAGEBOX +void QPrintDialogPrivate::_q_applyDialog() +{ + Q_Q(QPrintDialog); + if (top->d->checkFields()) + q->done((int)QDialog::Accepted+1); +} + void QPrintDialogPrivate::setupPrinter() { Q_Q(QPrintDialog); -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor