From: vsv Date: Wed, 4 May 2016 11:57:30 +0000 (+0300) Subject: Issue #1412:Selection mode preferences modified X-Git-Tag: V_2.3.0~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=85b662214060cf733b44ac7822e3e4db49e2da4b;p=modules%2Fshaper.git Issue #1412:Selection mode preferences modified --- diff --git a/src/ModuleBase/ModuleBase_Preferences.cpp b/src/ModuleBase/ModuleBase_Preferences.cpp index bef2ab96f..7558aeecf 100644 --- a/src/ModuleBase/ModuleBase_Preferences.cpp +++ b/src/ModuleBase/ModuleBase_Preferences.cpp @@ -291,24 +291,30 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId) myPreferences->setItemProperty("image_formats", aImgFiles, bgId); // Create other parameters group in viewer tab - int otherGroup = myPreferences->addItem(tr("Other parameters"), viewTab); - int selId = myPreferences->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 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 ); + int otherGroup = myPreferences->addItem(tr("Default selection"), viewTab); + myPreferences->addItem(tr("Faces"), otherGroup, + SUIT_PreferenceMgr::Bool, + ModuleBase_Preferences::VIEWER_SECTION, "face-selection"); + myPreferences->addItem(tr("Edges"), otherGroup, + SUIT_PreferenceMgr::Bool, + ModuleBase_Preferences::VIEWER_SECTION, "edge-selection"); + 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 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) diff --git a/src/XGUI/SHAPER.xml b/src/XGUI/SHAPER.xml index 02ac10bb2..f43451026 100644 --- a/src/XGUI/SHAPER.xml +++ b/src/XGUI/SHAPER.xml @@ -11,7 +11,9 @@
- + + +
diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 9da518760..4bd56e258 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -136,8 +136,6 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) QLocale::setDefault( QLocale::system() ); #endif - myViewerSelMode << TopAbs_FACE << TopAbs_EDGE << TopAbs_VERTEX; - myDataModelXMLReader = new Config_DataModelReader(); myDataModelXMLReader->readAll(); @@ -198,8 +196,12 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) Config_PropManager::registerProp("Visualization", "result_part_color", "Part color", Config_Prop::Color, ModelAPI_ResultPart::DEFAULT_COLOR()); - //myViewerSelMode = - // ModuleBase_Preferences::resourceMgr()->integerValue("Viewer", "selection", TopAbs_FACE); + if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "face-selection", true)) + myViewerSelMode.append(TopAbs_FACE); + if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "edge-selection", true)) + myViewerSelMode.append(TopAbs_EDGE); + if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "vertex-selection", true)) + myViewerSelMode.append(TopAbs_VERTEX); } //******************************************************