[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Mon May 10 21:30:39 CEST 2004
CVS commit by arwalker:
Disable the currently active MDI mode, so the user knows which mode they are in.
M +35 -5 kst.cpp 1.108
M +7 -0 kst.h 1.47
--- kdeextragear-2/kst/kst/kst.cpp #1.107:1.108
@@ -127,4 +127,6 @@ KstApp::KstApp(QWidget *parent, const ch
connect(KstEventMonitorI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
+ connect(this, SIGNAL(mdiModeHasBeenChangedTo(KMdi::MdiMode)), this, SLOT(mdiModeChanged(KMdi::MdiMode)));
+
initActions();
@@ -205,4 +207,28 @@ void KstApp::checkFontPresent( const QSt
}
+void KstApp::mdiModeChanged(KMdi::MdiMode mode) {
+ _MDITopLevelAction->setEnabled( true );
+ _MDITabModeAction->setEnabled( true );
+// _MDIChildFrameAction->setEnabled( true );
+// _MDIIDEAlModeAction->setEnabled( true );
+
+ switch( mode ) {
+ case KMdi::ToplevelMode:
+ _MDITopLevelAction->setEnabled( false );
+ break;
+ case KMdi::TabPageMode:
+ _MDITabModeAction->setEnabled( false );
+ break;
+// case KMdi::ChildframeMode:
+// _MDIChildFrameAction->setEnabled( false );
+// break;
+// case KMdi::IDEAlMode:
+// _MDIIDEAlModeAction->setEnabled( false );
+// break;
+ default:
+ break;
+ }
+}
+
void KstApp::customEvent(QCustomEvent *pEvent) {
if(pEvent->type() == KstELOGDebugInfoEvent) {
@@ -565,10 +591,14 @@ void KstApp::initActions() {
_reloadAction->setWhatsThis(i18n("Reload the data from file."));
- KAction *act;
- act = new KAction("Toplevel Mode", 0, 0, this, SLOT(switchToToplevelMode()), actionCollection(), "mdi_toplevel");
- //act = new KAction("Childframe Mode", 0, 0, this, SLOT(switchToChildframeMode()), actionCollection(), "mdi_childframe");
- act = new KAction("Tab Mode", 0, 0, this, SLOT(switchToTabPageMode()), actionCollection(), "mdi_tab");
- //act = new KAction("IDEAl Mode", 0, 0, this, SLOT(switchToIDEAlMode()), actionCollection(), "mdi_ideal");
+ _MDITopLevelAction = new KAction("Toplevel Mode", 0, 0, this, SLOT(switchToToplevelMode()), actionCollection(), "mdi_toplevel");
+ _MDITopLevelAction->setWhatsThis(i18n("Set top level MDI mode."));
+// _MDIChildFrameAction = new KAction("Childframe Mode", 0, 0, this, SLOT(switchToChildframeMode()), actionCollection(), "mdi_childframe");
+// _MDIChildFrameAction->setWhatsThis(i18n("Child frame MDI mode."));
+ _MDITabModeAction = new KAction("Tab Mode", 0, 0, this, SLOT(switchToTabPageMode()), actionCollection(), "mdi_tab");
+ _MDITabModeAction->setWhatsThis(i18n("Set tab MDI mode."));
+// _MDIIDEAlModeAction = new KAction("IDEAl Mode", 0, 0, this, SLOT(switchToIDEAlMode()), actionCollection(), "mdi_ideal");
+// _MDIIDEAlModeAction->setWhatsThis(i18n("Set IDEAl MDI mode"));
+
createGUI(0L);
}
--- kdeextragear-2/kst/kst/kst.h #1.46:1.47
@@ -275,4 +275,6 @@ class KstApp : public KMdiMainFrm {
void slotPreferences();
+ void mdiModeChanged(KMdi::MdiMode);
+
signals:
void settingsChanged();
@@ -413,4 +415,9 @@ class KstApp : public KMdiMainFrm {
KAction *filePreferences;
KAction *fileCopy;
+ KAction *_MDITopLevelAction;
+ KAction *_MDITabModeAction;
+ KAction *_MDIChildFrameAction;
+ KAction *_MDIIDEAlModeAction;
+
KToggleAction *viewToolBar;
KToggleAction *viewStatusBar;
More information about the Kst
mailing list