]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
In SALOME mode the tool tip info defined in XML should be shown in Status tip of...
authornds <nds@opencascade.com>
Fri, 24 Jun 2016 15:08:24 +0000 (18:08 +0300)
committernds <nds@opencascade.com>
Fri, 24 Jun 2016 15:08:24 +0000 (18:08 +0300)
src/ModuleBase/ModuleBase_IModule.cpp
src/SHAPERGUI/SHAPERGUI.cpp
src/SHAPERGUI/SHAPERGUI.h
src/XGUI/XGUI_MenuMgr.cpp
src/XGUI/XGUI_SalomeConnector.h

index fb7805fa68a793a792fa8a10c8cd3d1a97b5d5af..a41824958fb45b5735dd4146ce14a2de924df9ac 100644 (file)
@@ -166,7 +166,6 @@ void ModuleBase_IModule::createFeatures()
 
 void ModuleBase_IModule::actionCreated(QAction* theFeature)
 {
-  theFeature->setStatusTip(theFeature->text());
   connect(theFeature, SIGNAL(triggered(bool)), this, SLOT(onFeatureTriggered()));
 }
 
index 0faaabd0432d22ed4304ad1628eca3c816c0255c..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*/);
@@ -480,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;
index 840074c37d34bec45d3f699274248be4255ee41e..54097d4702597d8baba709dddc3c816a2ba1a73b 100644 (file)
@@ -51,8 +51,9 @@ Q_OBJECT
 
   virtual QAction* addFeature(const QString& theWBName, const QString& theId,
                               const QString& theTitle, const QString& theTip, const QIcon& theIcon,
-                              const QKeySequence& theKeys = QKeySequence(),
-                              bool isCheckable = false, const bool isAddSeparator = false);
+                              const QKeySequence& theKeys/* = QKeySequence()*/,
+                              bool isCheckable /*= false*/, const bool isAddSeparator/* = false*/,
+                              const QString& theStatusTip);
 
   //! Add feature (QAction) in the \a theWBName toolbar with given \a theInfo about action
   virtual QAction* addFeature(const QString& theWBName,
index 4e1dedeffc1eccdcf51ce120ba6bd5411264e630..47c8f178bf60a2760b889c3750953407d037fce4 100755 (executable)
@@ -199,8 +199,6 @@ QAction* XGUI_MenuMgr::buildAction(const std::shared_ptr<Config_FeatureMessage>&
                                                     aNestedActList);
   }
   else {
-    //Issue #650: in the SALOME mode the tooltip should be same as text
-    aFeatureInfo.toolTip = aFeatureInfo.text;
     anAction = aSalomeConnector->addFeature(theWchName.c_str(), aFeatureInfo, aUseSeparator);
   }
 #endif
index 89b35ed4af10c684dd6098d7849de905cf7dca69..b00b630f3cf965cb2a5165b7baec0ef52de98da4 100644 (file)
@@ -39,7 +39,8 @@ class XGUI_EXPORT XGUI_SalomeConnector
   //! returns created action
   virtual QAction* addFeature(const QString& theWBName, const QString& theId,
                               const QString& theTitle, const QString& theTip, const QIcon& theIcon,
-                              const QKeySequence& theKeys, bool isCheckable, const bool isAddSeparator) = 0;
+                              const QKeySequence& theKeys, bool isCheckable, const bool isAddSeparator,
+                              const QString& theStatusTip) = 0;
 
   //! Creates a feature (command) in SALOME desktop
   //! \param theWBName - name of toolbar (workbench)