summaryrefslogtreecommitdiffstats
path: root/kpdf/shell
diff options
context:
space:
mode:
Diffstat (limited to 'kpdf/shell')
-rw-r--r--kpdf/shell/shell.cpp18
-rw-r--r--kpdf/shell/shell.h2
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);