Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8771d213 authored by Daniel Nicoletti's avatar Daniel Nicoletti

Fix switching pages and handlying Apply button on Configure Printer dialog

FIXES: #377124
parent 42245029
......@@ -127,7 +127,7 @@ ConfigureDialog::ConfigureDialog(const QString &destName, bool isClass, QWidget
addPage(page);
// connect this after ALL pages were added, otherwise the slot will be called
connect(this, &ConfigureDialog::currentPageChanged, this, &ConfigureDialog::currentPageChanged);
connect(this, &ConfigureDialog::currentPageChanged, this, &ConfigureDialog::currentPageChangedSlot);
KConfigGroup group(KSharedConfig::openConfig(QLatin1String("print-manager")), "ConfigureDialog");
KWindowConfig::restoreWindowSize(windowHandle(), group);
......@@ -148,11 +148,12 @@ ConfigureDialog::~ConfigureDialog()
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void ConfigureDialog::currentPageChanged(KPageWidgetItem *current, KPageWidgetItem *before)
void ConfigureDialog::currentPageChangedSlot(KPageWidgetItem *current, KPageWidgetItem *before)
{
auto currentPage = qobject_cast<PrinterPage*>(current->widget());
auto beforePage = qobject_cast<PrinterPage*>(before->widget());
qCDebug(PM_CONFIGURE_PRINTER) << "currentPageChanged" << beforePage << currentPage;
// Check if the before page has changes
savePage(beforePage);
if (beforePage) {
......@@ -166,6 +167,7 @@ void ConfigureDialog::currentPageChanged(KPageWidgetItem *current, KPageWidgetIt
void ConfigureDialog::enableButtonApply(bool enable)
{
qDebug() << Q_FUNC_INFO << enable << sender();
button(QDialogButtonBox::QDialogButtonBox::Apply)->setEnabled(enable);
}
......
......@@ -36,13 +36,12 @@ public:
explicit ConfigureDialog(const QString &destName, bool isClass, QWidget *parent = 0);
~ConfigureDialog();
private slots:
void currentPageChanged(KPageWidgetItem *current, KPageWidgetItem *before);
private:
void currentPageChangedSlot(KPageWidgetItem *current, KPageWidgetItem *before);
void enableButtonApply(bool enable);
void slotButtonClicked(QAbstractButton * pressedButton);
void ppdChanged();
private:
ModifyPrinter *modifyPrinter;
PrinterOptions *printerOptions;
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
......
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