[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Wed May 19 22:14:45 CEST 2004


CVS commit by arwalker: 

Restore the last used MDI mode when kst is started.


  M +34 -10    kst.cpp   1.114
  M +2 -1      kst.h   1.52


--- kdeextragear-2/kst/kst/kst.cpp  #1.113:1.114
@@ -183,9 +182,26 @@ KstApp::KstApp(QWidget *parent, const ch
   checkFontPresent("Symbol");
 
+  switch( _mode ) {
+    case KMdi::ToplevelMode:
+      switchToToplevelMode();
+      break;
+    case KMdi::TabPageMode:
+      switchToTabPageMode();
+      break;
+    case KMdi::ChildframeMode:
+      switchToChildframeMode();
+      break;
+    case KMdi::IDEAlMode:
+      switchToIDEAlMode();
+      break;
+    default:
+      switchToTabPageMode();
+      break;
+  }
+
   KstViewWindow *w = new KstViewWindow;
-  w->setCaption("Untitled");
-  w->setTabCaption("Untitled");
+  w->setCaption("Default");
+  w->setTabCaption("Default");
   addWindow(w);
-  switchToTabPageMode();
 }
 
@@ -205,5 +222,5 @@ void KstApp::mdiModeChanged(KMdi::MdiMod
   _MDITabModeAction->setEnabled(true);
   _MDIChildFrameAction->setEnabled(true);
-//  _MDIIDEAlModeAction->setEnabled( true );
+//_MDIIDEAlModeAction->setEnabled(true);
 
   switch( mode ) {
@@ -218,9 +235,11 @@ void KstApp::mdiModeChanged(KMdi::MdiMod
       break;
 //    case KMdi::IDEAlMode:
-//      _MDIIDEAlModeAction->setEnabled( false );
+//    _MDIIDEAlModeAction->setEnabled(false);
 //      break;
     default:
       break;
   }
+
+  _mode = mode;
 }
 
@@ -691,9 +710,14 @@ void KstApp::saveOptions() {
   config->setGroup("General Options");
   recent->saveEntries(config, "Recent Files");
+
+  config->writeEntry("MDIMode", (int)_mode);
+  config->sync();
 }
 
 void KstApp::readOptions() {
   config->setGroup("General Options");
-  recent->loadEntries(config,"Recent Files");
+  recent->loadEntries(config, "Recent Files");
+
+  _mode = (KMdi::MdiMode)config->readNumEntry("MDIMode", (int)KMdi::TabPageMode);
 }
 

--- kdeextragear-2/kst/kst/kst.h  #1.51:1.52
@@ -421,4 +421,5 @@ class KstApp : public KMdiMainFrm {
     KstIfaceImpl *_dcopIface;
     UpdateThread *_updateThread;
+    KMdi::MdiMode _mode;
 };
 





More information about the Kst mailing list