]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
It's correction to create some items with equal titles in different groups.
authornds <nds@opencascade.com>
Thu, 9 Aug 2007 12:45:00 +0000 (12:45 +0000)
committernds <nds@opencascade.com>
Thu, 9 Aug 2007 12:45:00 +0000 (12:45 +0000)
src/SUIT/SUIT_PreferenceMgr.cxx
src/SUIT/SUIT_PreferenceMgr.h

index ada12316175b8e7b7c79e760fba9039259fc0fab..0424de3ca4b1fec7df4144ae9e0b6cfb7eb51633 100644 (file)
@@ -69,22 +69,22 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId,
                                  const SUIT_PreferenceMgr::PrefItemType type,
                                  const QString& sect, const QString& param )
 {
-  QtxPreferenceItem* item = findItem( title, true );
+  QtxPreferenceItem* parent = pId == -1 ? this : findItem( pId, true );
+
+  if ( !parent )
+    return -1;
+
+  QtxPreferenceItem* item = parent->findItem( title, true );
+
   if ( item )
     return item->id();
 
-  QtxPreferenceItem* parent = 0;
   if ( pId == -1 )
   {
     if ( !myRoot )
       myRoot = new QtxPagePrefListItem( QString( "root" ), this );
     parent = myRoot;
   }
-  else
-    parent = findItem( pId, true );
-
-  if ( !parent )
-    return -1;
 
   switch( type )
   {
@@ -132,6 +132,12 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId,
   case GroupBox:
     item = new QtxPagePrefGroupItem( title, parent, sect, param );
     break;
+  case Tab:
+    item = new QtxPagePrefTabsItem( title, parent, sect, param );
+    break;
+  case Frame:
+    item = new QtxPagePrefFrameItem( title, parent, sect, param );
+    break;
   case Font:
     item = new QtxPagePrefFontItem( title, parent, sect, param );
     break;
index 787604000d7d31ba74bc074df0eca5de3663ebe5..2c85f60184c11ebbf980f3164797a6d763b81cac 100644 (file)
@@ -36,7 +36,7 @@ class SUIT_EXPORT SUIT_PreferenceMgr : public QtxPagePrefMgr
 public:
   typedef enum { Auto, Space, Bool, Color, String, Selector,
                  DblSpin, IntSpin, Double, Integer,
-                 GroupBox, Font, DirList, File } PrefItemType;
+                 GroupBox, Tab, Frame, Font, DirList, File } PrefItemType;
 
 public:
   SUIT_PreferenceMgr( QtxResourceMgr*, QWidget* = 0 );