]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1412: Define selection preferences in SALOME mode.
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 4 May 2016 12:14:01 +0000 (15:14 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 4 May 2016 12:14:15 +0000 (15:14 +0300)
src/ModuleBase/ModuleBase_Preferences.cpp
src/SHAPERGUI/SHAPERGUI.cpp
src/SHAPERGUI/resources/LightApp.xml.in
src/SHAPERGUI/resources/SalomeApp.xml.in

index 7558aeecf34bd50ae3fdc352bdd798e23c282793..d6355464715d20d8989775e3b28cff3c32979379 100644 (file)
@@ -292,6 +292,7 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId)
 
   // Create other parameters group in viewer tab
   int otherGroup = myPreferences->addItem(tr("Default selection"), viewTab);
+  myPreferences->setItemProperty("columns", 3, otherGroup);
   myPreferences->addItem(tr("Faces"), otherGroup, 
                          SUIT_PreferenceMgr::Bool,
                          ModuleBase_Preferences::VIEWER_SECTION, "face-selection");
@@ -301,20 +302,6 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId)
   myPreferences->addItem(tr("Vertices"), otherGroup, 
                          SUIT_PreferenceMgr::Bool,
                          ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection");
-  //QStringList aSelectionList;
-  //aSelectionList.append( tr("Vertices") );
-  //aSelectionList.append( tr("Edges") );
-  //aSelectionList.append( tr("Faces") );
-  //aSelectionList.append( tr("Results") );
-
-  //QList<QVariant> anIndexesList;
-  //anIndexesList.append(TopAbs_VERTEX);
-  //anIndexesList.append(TopAbs_EDGE);
-  //anIndexesList.append(TopAbs_FACE);
-  //anIndexesList.append(-1);
-
-  //myPreferences->setItemProperty( "strings", aSelectionList, selId );
-  //myPreferences->setItemProperty( "indexes", anIndexesList, selId );
 }
 
 void ModuleBase_PreferencesDlg::createMenuPage(int thePageId)
index cb1deb39284170aa3484d300ebcb5060e3590d92..ad4b87c429390fc36dd58ebc54e8488e8250ec26 100644 (file)
@@ -581,24 +581,17 @@ void SHAPERGUI::createPreferences()
 
   int viewTab = pref->addItem(tr("Viewer"), catId);
   // Create other parameters group in viewer tab
-  int otherGroup = pref->addItem(tr("Other parameters"), viewTab);
-  int selId = pref->addItem(tr("Default selection type"), otherGroup, 
-                                     SUIT_PreferenceMgr::Selector,
-                                     ModuleBase_Preferences::VIEWER_SECTION, "selection");
-  QStringList aSelectionList;
-  aSelectionList.append( tr("Vertices") );
-  aSelectionList.append( tr("Edges") );
-  aSelectionList.append( tr("Faces") );
-  aSelectionList.append( tr("Results") );
-
-  QList<QVariant> anIndexesList;
-  anIndexesList.append(TopAbs_VERTEX);
-  anIndexesList.append(TopAbs_EDGE);
-  anIndexesList.append(TopAbs_FACE);
-  anIndexesList.append(-1);
-
-  pref->setItemProperty( "strings", aSelectionList, selId );
-  pref->setItemProperty( "indexes", anIndexesList, selId );
+  int otherGroup = pref->addItem(tr("Default selection"), viewTab);
+  pref->setItemProperty("columns", 3, otherGroup);
+  pref->addItem(tr("Faces"), otherGroup, 
+                         SUIT_PreferenceMgr::Bool,
+                         ModuleBase_Preferences::VIEWER_SECTION, "face-selection");
+  pref->addItem(tr("Edges"), otherGroup, 
+                         SUIT_PreferenceMgr::Bool,
+                         ModuleBase_Preferences::VIEWER_SECTION, "edge-selection");
+  pref->addItem(tr("Vertices"), otherGroup, 
+                         SUIT_PreferenceMgr::Bool,
+                         ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection");
   
   pref->retrieve();
 }
index e3ae4cd5641d58ba7bc0d0e4d1b7e7f32e3b9b28..670a053b045b4edc9a7e35bec502ab0f7df98021 100644 (file)
@@ -37,6 +37,8 @@
   </section>
   <section name="Viewer" >
     <!-- Viewer preferences -->
-    <parameter name="selection" value="4" />
+    <parameter name="face-selection" value="true" />
+    <parameter name="edge-selection" value="true" />
+    <parameter name="vertex-selection" value="true" />
   </section>
 </document>
index 4b0a0012112791c3301583c59645f4d78b2c5bc9..b0a6c5522b03e0472c4e93b2867004c0fd0407a1 100644 (file)
@@ -42,6 +42,8 @@
   </section>
   <section name="Viewer" >
     <!-- Viewer preferences -->
-    <parameter name="selection" value="4" />
+    <parameter name="face-selection" value="true" />
+    <parameter name="edge-selection" value="true" />
+    <parameter name="vertex-selection" value="true" />
   </section>
 </document>