From: vsv Date: Wed, 19 Sep 2018 13:29:09 +0000 (+0300) Subject: Issue #2556: Implementation of the customer remarks X-Git-Tag: V9_2_0a1~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=30f6b0845162d7d47719069765fd88dfe310b6a9;p=modules%2Fshaper.git Issue #2556: Implementation of the customer remarks --- diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 930a4d475..25ec9a918 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -149,6 +149,22 @@ void SHAPERGUI::initialize(CAM_Application* theApp) { connect(anApp, SIGNAL(preferenceResetToDefaults()), this, SLOT(onDefaultPreferences())); } + + int aMenu = createMenu(tr("Inspection"), -1, -1, 30); + int aSubMenu = createMenu(tr("Information"), aMenu); + + int aId = myActionsList.size(); + myActionsList.append("INSPECTION_CMD"); + SUIT_Desktop* aDesk = application()->desktop(); + QString aTip = tr("Show inspection window"); + myWhatIsAction = createAction(aId, aTip, QIcon(":pictures/whatis.png"), tr("What Is"), + aTip, QKeySequence(), aDesk, true, this, SLOT(onWhatIs(bool))); + myWhatIsAction->setStatusTip(aTip); + myWhatIsAction->setData("INSPECTION_CMD"); + createMenu(aId, aSubMenu, 0); + + int aTool = createTool("INSPWCTION_TOOL", "INSPWCTION_TOOL"); + int aToolId = createTool(myWhatIsAction, aTool); } //****************************************************** @@ -212,6 +228,7 @@ bool SHAPERGUI::activateModule(SUIT_Study* theStudy) if (aInspection) { QAction* aViewAct = aInspection->toggleViewAction(); aViewAct->setEnabled(true); + connect(aViewAct, SIGNAL(toggled(bool)), this, SLOT(onWhatIs(bool))); } if (!mySelector) { @@ -750,3 +767,20 @@ void SHAPERGUI::createFeatureActions() { myWorkshop->menuMgr()->createFeatureActions(); } + +void SHAPERGUI::onWhatIs(bool isToggled) +{ + QDockWidget* aInspection = myWorkshop->inspectionPanel(); + if (sender() == myWhatIsAction) { + QAction* aViewAct = aInspection->toggleViewAction(); + aViewAct->blockSignals(true); + aViewAct->setChecked(isToggled); + aViewAct->blockSignals(false); + aInspection->setVisible(isToggled); + } + else { + myWhatIsAction->blockSignals(true); + myWhatIsAction->setChecked(isToggled); + myWhatIsAction->blockSignals(false); + } +} \ No newline at end of file diff --git a/src/SHAPERGUI/SHAPERGUI.h b/src/SHAPERGUI/SHAPERGUI.h index 6d031e755..1c0a10ee7 100644 --- a/src/SHAPERGUI/SHAPERGUI.h +++ b/src/SHAPERGUI/SHAPERGUI.h @@ -202,6 +202,9 @@ Q_OBJECT /// Abort all operations virtual bool abortAllOperations(); +private slots: + void onWhatIs(bool isToggled); + private: /// Create selector for OCC Viewer /// \param theMgr view manager @@ -238,6 +241,8 @@ Q_OBJECT /// Popup manager QtxPopupMgr* myPopupMgr; + + QAction* myWhatIsAction; }; #endif diff --git a/src/XGUI/XGUI_InspectionPanel.cpp b/src/XGUI/XGUI_InspectionPanel.cpp index e96acd39a..8764568f8 100644 --- a/src/XGUI/XGUI_InspectionPanel.cpp +++ b/src/XGUI/XGUI_InspectionPanel.cpp @@ -172,10 +172,8 @@ XGUI_InspectionPanel::XGUI_InspectionPanel(QWidget* theParent, XGUI_SelectionMgr aSplitter->addWidget(aTypeWgt); myTypeParams = new QTextBrowser(aSplitter); - myTypeParams->setFixedWidth(170); myTypeParams->setReadOnly(true); myTypeParams->setFocusPolicy(Qt::NoFocus); - myTypeParams->setFrameStyle(QFrame::NoFrame); myTypeParams->viewport()->setBackgroundRole(QPalette::Window); aSplitter->addWidget(myTypeParams); diff --git a/src/XGUI/XGUI_pictures.qrc b/src/XGUI/XGUI_pictures.qrc index 81b392d43..5de669be4 100644 --- a/src/XGUI/XGUI_pictures.qrc +++ b/src/XGUI/XGUI_pictures.qrc @@ -75,5 +75,6 @@ pictures/move_out_before.png pictures/selection.png pictures/autoapply.png + pictures/whatis.png diff --git a/src/XGUI/pictures/whatis.png b/src/XGUI/pictures/whatis.png new file mode 100644 index 000000000..d213e309b Binary files /dev/null and b/src/XGUI/pictures/whatis.png differ