From 9968ec652480079d0ca91b2040f6327a164807cf Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 24 Jun 2016 18:08:24 +0300 Subject: [PATCH] In SALOME mode the tool tip info defined in XML should be shown in Status tip of the application. It should not be shown in the action's tool tip according to #605 issue. --- src/ModuleBase/ModuleBase_IModule.cpp | 1 - src/SHAPERGUI/SHAPERGUI.cpp | 11 ++++++++--- src/SHAPERGUI/SHAPERGUI.h | 5 +++-- src/XGUI/XGUI_MenuMgr.cpp | 2 -- src/XGUI/XGUI_SalomeConnector.h | 3 ++- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index fb7805fa6..a41824958 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -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())); } diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 0faaabd04..9210b66ee 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -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; diff --git a/src/SHAPERGUI/SHAPERGUI.h b/src/SHAPERGUI/SHAPERGUI.h index 840074c37..54097d470 100644 --- a/src/SHAPERGUI/SHAPERGUI.h +++ b/src/SHAPERGUI/SHAPERGUI.h @@ -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, diff --git a/src/XGUI/XGUI_MenuMgr.cpp b/src/XGUI/XGUI_MenuMgr.cpp index 4e1dedeff..47c8f178b 100755 --- a/src/XGUI/XGUI_MenuMgr.cpp +++ b/src/XGUI/XGUI_MenuMgr.cpp @@ -199,8 +199,6 @@ QAction* XGUI_MenuMgr::buildAction(const std::shared_ptr& 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 diff --git a/src/XGUI/XGUI_SalomeConnector.h b/src/XGUI/XGUI_SalomeConnector.h index 89b35ed4a..b00b630f3 100644 --- a/src/XGUI/XGUI_SalomeConnector.h +++ b/src/XGUI/XGUI_SalomeConnector.h @@ -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) -- 2.39.2