[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    make_it_cool: kdeedu/kig/kig
From:       Dominique Devriese <devriese () kde ! org>
Date:       2003-03-17 17:34:46
[Download RAW message or body]

CVS commit by domi: 

ifdeffing Benjamin Meyer's last commit for KDE 3.2


  M +32 -5     kig.cpp   1.23.2.3
  M +22 -0     kig.h   1.14.2.2


--- kdeedu/kig/kig/kig.cpp  #1.23.2.2:1.23.2.3
@@ -19,9 +19,4 @@
 **/
 
-
-/*
- * kig.cpp
- *
- */
 #include "kig.h"
 #include "kig.moc"
@@ -96,6 +91,11 @@ void Kig::setupActions()
   KStdAction::quit(this, SLOT(close()), actionCollection());
 
+#ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+  m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
+  m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+#else
   createStandardStatusBarAction();
   setStandardToolBarMenuEnabled(true);
+#endif
 
   // FIXME: this (recent files) should be app-wide, not specific to each window...
@@ -231,2 +231,29 @@ void Kig::fileOpen()
   if (!file_name.isEmpty()) openURL(file_name);
 }
+
+// ifdef's disabled, cause Qt moc doesn't handle ifdef's..
+// #ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+void Kig::optionsShowToolbar()
+{
+#ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+  if (m_toolbarAction->isChecked())
+    toolBar()->show();
+  else
+    toolBar()->hide();
+#else
+  assert( false );
+#endif
+}
+
+void Kig::optionsShowStatusbar()
+{
+#ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+  if (m_statusbarAction->isChecked())
+    statusBar()->show();
+  else
+    statusBar()->hide();
+#else
+  assert( false );
+#endif
+}
+// #endif

--- kdeedu/kig/kig/kig.h  #1.14.2.1:1.14.2.2
@@ -27,8 +27,21 @@
 #endif
 
+#include <kdeversion.h>
+
+#ifdef KDE_IS_VERSION
+#if KDE_IS_VERSION( 3, 1, 90 )
+#undef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+#else
+#define KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+#endif
+#else
+#define KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+#endif
+
 #include <kapplication.h>
 #include <kparts/mainwindow.h>
 #include <dcopclient.h>
 
+class KToggleAction;
 class KRecentFilesAction;
 
@@ -109,4 +122,9 @@ class Kig : public KParts::MainWindow
   void fileNew();
   void fileOpen();
+  // Qt moc doesn't handle ifdef's, so i'm disabling it..
+// #ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+  void optionsShowToolbar();
+  void optionsShowStatusbar();
+// #endif
   void optionsConfigureKeys();
   void optionsConfigureToolbars();
@@ -119,4 +137,8 @@ class Kig : public KParts::MainWindow
   KParts::ReadWritePart *m_part;
 
+//#ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
+  KToggleAction *m_toolbarAction;
+  KToggleAction *m_statusbarAction;
+//#endif
   KRecentFilesAction *m_recentFilesAction;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic