summaryrefslogtreecommitdiffstats
path: root/kpdf/shell/shell.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2025-04-16 10:58:59 +0300
committerMavridis Philippe <mavridisf@gmail.com>2025-04-16 13:17:31 +0300
commit08c6e651148410acea2d23567ce4bffd2b1c4b63 (patch)
tree8fc21d3ae0ffbb6ca3306fb1c3cd6e26cee962b1 /kpdf/shell/shell.cpp
parentcbbd51c945125fd5e4b6afccf699e5841a0a96db (diff)
downloadtdegraphics-r14.1.4.tar.gz
tdegraphics-r14.1.4.zip
KPDF Shell: fix printing actionr14.1.4
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com> (cherry picked from commit 65c9ed251d7726102bff3b5f4d2c6729433be4b1)
Diffstat (limited to 'kpdf/shell/shell.cpp')
-rw-r--r--kpdf/shell/shell.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/kpdf/shell/shell.cpp b/kpdf/shell/shell.cpp
index ed9f27cb..b1f60bd7 100644
--- a/kpdf/shell/shell.cpp
+++ b/kpdf/shell/shell.cpp
@@ -203,7 +203,7 @@ void Shell::setupActions()
m_recent = KStdAction::openRecent( this, TQ_SLOT(openURL(const KURL&)), actionCollection());
connect(m_recent, TQ_SIGNAL(activated()), openAction, TQ_SLOT( activate()));
m_recent->setWhatsThis(i18n("<b>Click</b> to open a file or <b>Click and hold</b> to select a recent file"));
- m_printAction = KStdAction::print(m_manager->activePart(), TQ_SLOT(slotPrint()), actionCollection());
+ m_printAction = KStdAction::print(this, TQ_SLOT(slotPrint()), actionCollection());
m_printAction->setEnabled(false);
KStdAction::quit(this, TQ_SLOT(slotQuit()), actionCollection());
@@ -299,6 +299,20 @@ void Shell::applyNewToolbarConfig()
applyMainWindowSettings(TDEGlobal::config(), "MainWindow");
}
+void Shell::slotSetPrintActionEnabled(bool enabled)
+{
+ const KParts::Part *part = static_cast<const KParts::Part*>(TQObject::sender());
+ if (part == m_manager->activePart())
+ {
+ m_printAction->setEnabled(enabled);
+ }
+}
+
+void Shell::slotPrint()
+{
+ TQTimer::singleShot(0, m_manager->activePart(), TQ_SLOT(slotPrint()));
+}
+
void Shell::slotQuit()
{
kapp->closeAllWindows();
@@ -364,7 +378,7 @@ KParts::ReadOnlyPart* Shell::createTab()
connect(this, TQ_SIGNAL(saveDocumentRestoreInfo(TDEConfig*)),
part, TQ_SLOT(saveDocumentRestoreInfo(TDEConfig*)));
connect(part, TQ_SIGNAL(enablePrintAction(bool)),
- m_printAction, TQ_SLOT(setEnabled(bool)));
+ this, TQ_SLOT(slotSetPrintActionEnabled(bool)));
connect(part, TQ_SIGNAL(setWindowCaption(const TQString&)),
this, TQ_SLOT(slotSetTabCaption(const TQString&)));