[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Feb 11 09:25:55 UTC 2005


CVS commit by okellogg: 

Make compilable with KDE 3.1.


  M +13 -1     uml.cpp   1.137
  M +14 -2     umldoc.cpp   1.236


--- kdesdk/umbrello/umbrello/uml.cpp  #1.136:1.137
@@ -38,5 +38,7 @@
 #include <kstatusbar.h>
 #include <ktip.h>
+#if KDE_IS_VERSION(3,1,90)
 #include <ktabwidget.h>
+#endif
 #include <ktoolbarbutton.h>
 #include <kpopupmenu.h>
@@ -405,4 +407,5 @@ void UMLApp::initView() {
 
         m_mainDock = createDockWidget("maindock", 0L, 0L, "main dock");
+#if KDE_IS_VERSION(3,1,90)
         if (m_optionState.generalState.tabdiagrams) {
                 m_viewStack = NULL;
@@ -444,5 +447,8 @@ void UMLApp::initView() {
 
                 m_mainDock->setWidget(m_tabWidget);
-        } else {
+        }
+        else
+#endif
+        {
                 m_tabWidget = NULL;
                 m_viewStack = new QWidgetStack(m_mainDock, "viewstack");
@@ -1598,6 +1604,8 @@ void UMLApp::initSavedCodeGenerators() {
 
 QWidget* UMLApp::getMainViewWidget() {
+#if KDE_IS_VERSION(3,1,90)
         if (m_optionState.generalState.tabdiagrams)
                 return m_tabWidget;
+#endif
         return m_viewStack;
 }
@@ -1644,9 +1652,13 @@ void UMLApp::slotTabChanged(QWidget* vie
 
 void UMLApp::slotChangeTabLeft() {
+#if KDE_IS_VERSION(3,1,90)
         m_tabWidget->setCurrentPage( m_tabWidget->currentPageIndex() - 1 );
+#endif
 }
 
 void UMLApp::slotChangeTabRight() {
+#if KDE_IS_VERSION(3,1,90)
         m_tabWidget->setCurrentPage( m_tabWidget->currentPageIndex() + 1 );
+#endif
 }
 

--- kdesdk/umbrello/umbrello/umldoc.cpp  #1.235:1.236
@@ -40,5 +40,7 @@
 #include <ktempfile.h>
 #include <kiconloader.h>
+#if KDE_IS_VERSION(3,1,90)
 #include <ktabwidget.h>
+#endif
 
 // app includes
@@ -142,4 +144,5 @@ void UMLDoc::addView(UMLView *view) {
         }
 
+#if KDE_IS_VERSION(3,1,90)
         Settings::OptionState optionState = UMLApp::app()->getOptionState();
         KTabWidget* tabWidget = NULL;
@@ -149,11 +152,14 @@ void UMLDoc::addView(UMLView *view) {
                 tabWidget->setTabIconSet(view, Umbrello::iconSet(view->getType()));
         }
+#endif
         pApp->setDiagramMenuItemsState(true);
         pApp->slotUpdateViews();
         pApp->setCurrentView(view);
+#if KDE_IS_VERSION(3,1,90)
         if (tabWidget) {
                 tabWidget->showPage(view);
                 tabWidget->setCurrentPage(tabWidget->currentPageIndex());
         }
+#endif
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -2164,8 +2170,12 @@ bool UMLDoc::loadFromXMI( QIODevice & fi
         if (viewToBeSet) {
                 changeCurrentView( m_nViewID );
+#if KDE_IS_VERSION(3,1,90)
                 Settings::OptionState optionState = UMLApp::app()->getOptionState();
                 if (optionState.generalState.tabdiagrams) {
                         UMLApp::app()->tabWidget()->showPage(viewToBeSet);
-                } else {
+                }
+                else
+#endif
+                {
                         // Make sure we have a treeview item for each diagram.
                         // It may happen that we are missing them after switching off
@@ -2814,7 +2824,9 @@ void UMLDoc::slotAutoSave() {
 
 void UMLDoc::signalDiagramRenamed(UMLView* pView ) {
+#if KDE_IS_VERSION(3,1,90)
         Settings::OptionState optionState = UMLApp::app()->getOptionState();
         if (optionState.generalState.tabdiagrams)
                 UMLApp::app()->tabWidget()->setTabLabel( pView, pView->getName() );
+#endif
         emit sigDiagramRenamed( pView -> getID() );
         return;
@@ -3007,5 +3019,5 @@ void UMLDoc::slotDiagramPopupMenu(QWidge
         }//end switch
 
-        m_pTabPopupMenu = new ListPopupMenu(UMLApp::app()->tabWidget(), type);
+        m_pTabPopupMenu = new ListPopupMenu(UMLApp::app()->getMainViewWidget(), type);
         m_pTabPopupMenu->popup(point);
         connect(m_pTabPopupMenu, SIGNAL(activated(int)), view, SLOT(slotMenuSelection(int)));






More information about the umbrello-devel mailing list