From 9dc23edee3aa192f99ac56161a341d38374aaacf Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 31 Jan 2020 18:36:58 +0900 Subject: KJobviewer: keep "permanent window" option across sessions. Taken from https://bugs.trinitydesktop.org/show_bug.cgi?id=1362 proposed patch. Signed-off-by: Roman Savochenko --- tdeprint/management/kmjobviewer.cpp | 12 ++++++++++++ tdeprint/management/kmjobviewer.h | 1 + 2 files changed, 13 insertions(+) (limited to 'tdeprint') diff --git a/tdeprint/management/kmjobviewer.cpp b/tdeprint/management/kmjobviewer.cpp index b0f95069e..7e149ed48 100644 --- a/tdeprint/management/kmjobviewer.cpp +++ b/tdeprint/management/kmjobviewer.cpp @@ -332,6 +332,11 @@ void KMJobViewer::initActions() // create status bar KStatusBar *statusbar = statusBar(); m_stickybox = new TQCheckBox( i18n( "Keep window permanent" ), statusbar ); + + TDEConfig *conf = KMFactory::self()->printConfig(); + conf->setGroup("Jobs"); + m_stickybox->setChecked(conf->readBoolEntry("KeepWindow",true)); + connect(m_stickybox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotKeepWindowChange(bool))); statusbar->addWidget( m_stickybox, 1, false ); statusbar->insertItem(" " + i18n("Max.: %1").arg(i18n("Unlimited"))+ " ", 0, 0, true); statusbar->setItemFixed(0); @@ -365,6 +370,13 @@ void KMJobViewer::buildPrinterMenu(TQPopupMenu *menu, bool use_all, bool use_spe } } +void KMJobViewer::slotKeepWindowChange( bool val ) +{ + TDEConfig *conf = KMFactory::self()->printConfig(); + conf->setGroup("Jobs"); + conf->writeEntry("KeepWindow",val); +} + void KMJobViewer::slotShowMoveMenu() { TQPopupMenu *menu = static_cast(actionCollection()->action("job_move"))->popupMenu(); diff --git a/tdeprint/management/kmjobviewer.h b/tdeprint/management/kmjobviewer.h index 7a4530f3c..5bfda8467 100644 --- a/tdeprint/management/kmjobviewer.h +++ b/tdeprint/management/kmjobviewer.h @@ -86,6 +86,7 @@ protected slots: void slotUserChanged(); void slotConfigure(); void slotDropped( TQDropEvent*, TQListViewItem* ); + void slotKeepWindowChange(bool); protected: void init(); -- cgit v1.2.1