diff options
| author | Mavridis Philippe <mavridisf@gmail.com> | 2025-04-16 10:58:59 +0300 |
|---|---|---|
| committer | Mavridis Philippe <mavridisf@gmail.com> | 2025-04-16 11:02:42 +0300 |
| commit | 65c9ed251d7726102bff3b5f4d2c6729433be4b1 (patch) | |
| tree | 5f3c252fc437744f6cc6e5dd63ee63486aab8c31 /kpdf/shell/shell.cpp | |
| parent | cd725c4302c4500d064fc56dd0afe31a9228dd6c (diff) | |
| download | tdegraphics-65c9ed251d7726102bff3b5f4d2c6729433be4b1.tar.gz tdegraphics-65c9ed251d7726102bff3b5f4d2c6729433be4b1.zip | |
KPDF Shell: fix printing action
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'kpdf/shell/shell.cpp')
| -rw-r--r-- | kpdf/shell/shell.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/kpdf/shell/shell.cpp b/kpdf/shell/shell.cpp index f6ba2f18..40df86dc 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() { tdeApp->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&))); |
