diff options
| author | Mavridis Philippe <mavridisf@gmail.com> | 2025-04-16 10:58:59 +0300 | 
|---|---|---|
| committer | Mavridis Philippe <mavridisf@gmail.com> | 2025-04-16 13:17:31 +0300 | 
| commit | 08c6e651148410acea2d23567ce4bffd2b1c4b63 (patch) | |
| tree | 8fc21d3ae0ffbb6ca3306fb1c3cd6e26cee962b1 /kpdf/shell | |
| parent | cbbd51c945125fd5e4b6afccf699e5841a0a96db (diff) | |
| download | tdegraphics-08c6e651.tar.gz tdegraphics-08c6e651.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')
| -rw-r--r-- | kpdf/shell/shell.cpp | 18 | ||||
| -rw-r--r-- | kpdf/shell/shell.h | 2 | 
2 files changed, 18 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&))); diff --git a/kpdf/shell/shell.h b/kpdf/shell/shell.h index 6198aa4c..d1ace108 100644 --- a/kpdf/shell/shell.h +++ b/kpdf/shell/shell.h @@ -100,6 +100,7 @@ namespace KPDF      void addTab();      void removeTab(); +    void slotPrint();      void slotQuit();    private slots: @@ -122,6 +123,7 @@ namespace KPDF      void slotMoveTabRight();      void slotRemoveOtherTabs();      void slotSetTabCaption(const TQString &caption); +    void slotSetPrintActionEnabled(bool enabled);    signals:      void restoreDocument(TDEConfig* config); | 
