Salome HOME
Comment Split output
[modules/shaper.git] / src / SHAPERGUI / SHAPERGUI.cpp
index 78cdcb08d1b3bb7044b7a6bb3bb924ad8c2b4936..9210b66ee468227f1b6194d210345e739a299bbf 100644 (file)
@@ -380,18 +380,20 @@ QAction* SHAPERGUI::addFeature(const QString& theWBName, const ActionInfo& theIn
   return addFeature(theWBName,
                     theInfo.id,
                     theInfo.text,
-                    theInfo.toolTip,
+                    theInfo.text, //Issue #650: in the SALOME mode the tooltip should be same as text
                     theInfo.icon,
                     theInfo.shortcut,
                     theInfo.checkable,
-                    isAddSeparator);
+                    isAddSeparator,
+                    theInfo.toolTip);
 }
 
 //******************************************************
 QAction* SHAPERGUI::addFeature(const QString& theWBName, const QString& theId,
                                const QString& theTitle, const QString& theTip,
                                const QIcon& theIcon, const QKeySequence& theKeys,
-                               bool isCheckable, const bool isAddSeparator)
+                               bool isCheckable, const bool isAddSeparator,
+                               const QString& theStatusTip)
 {
   static QString aLastTool = "";
   static int aNb = 0;
@@ -414,6 +416,8 @@ QAction* SHAPERGUI::addFeature(const QString& theWBName, const QString& theId,
     aKeys += theKeys[i];
   QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
                                   isCheckable);
+  aAction->setStatusTip(theStatusTip);
+
   aAction->setData(theId);
 
   int aWBMenu = createMenu(theWBName, -1, -1, 50/*10-Window, 1000 - Help*/);
@@ -454,9 +458,11 @@ QAction* SHAPERGUI::addFeatureOfNested(const QString& theWBName,
 
   int aWBMenu = createMenu(theWBName, -1, -1, 50);
   int aItemId = createMenu(anAction, aWBMenu);
+  createMenu(separator(), aWBMenu); /// nested action is always separated of others
 
   int aWBTool = createTool(theWBName, theWBName);
   int aToolId = createTool(anAction, aWBTool);
+  createTool(separator(), aWBTool); /// nested action is always separated of others
 
   return anAction;
 }
@@ -478,6 +484,7 @@ QAction* SHAPERGUI::addDesktopCommand(const QString& theId, const QString& theTi
     aKeys += theKeys[i];
   QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
                                   isCheckable);
+  aAction->setStatusTip(theTip);
   aAction->setData(theId);
   createMenu(aId, aMenu, theMenuPosition);
   return aAction;
@@ -579,25 +586,24 @@ 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");
   
+  int sensitivityGroup = pref->addItem(tr("Selection sensitivity"), viewTab);
+  pref->setItemProperty("columns", 2, sensitivityGroup);
+  pref->addItem(tr("Vertex"), sensitivityGroup, SUIT_PreferenceMgr::Double,
+                ModuleBase_Preferences::VIEWER_SECTION, "point-selection-sensitivity");
+  pref->addItem(tr("Edge"), sensitivityGroup, SUIT_PreferenceMgr::Double,
+                ModuleBase_Preferences::VIEWER_SECTION, "edge-selection-sensitivity");
   pref->retrieve();
 }
 
@@ -621,6 +627,11 @@ void SHAPERGUI::preferencesChanged(const QString& theSection, const QString& the
   myWorkshop->displayer()->redisplayObjects();
 }
 
+void SHAPERGUI::putInfo(const QString& theInfo, const int theMSecs)
+{
+  application()->putInfo(theInfo, theMSecs);
+}
+
 void SHAPERGUI::inspectSalomeModules()
 {
   QStringList aModuleNames;