From 30f6b0845162d7d47719069765fd88dfe310b6a9 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 19 Sep 2018 16:29:09 +0300 Subject: [PATCH] Issue #2556: Implementation of the customer remarks --- src/SHAPERGUI/SHAPERGUI.cpp | 34 ++++++++++++++++++++++++++++++ src/SHAPERGUI/SHAPERGUI.h | 5 +++++ src/XGUI/XGUI_InspectionPanel.cpp | 2 -- src/XGUI/XGUI_pictures.qrc | 1 + src/XGUI/pictures/whatis.png | Bin 0 -> 1080 bytes 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/XGUI/pictures/whatis.png 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 0000000000000000000000000000000000000000..d213e309ba3fc9d6333147efee21e58bea9fc111 GIT binary patch literal 1080 zcmV-81jqY{P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ~`&$!KS^ytTBP=k-48we0UCo&@ada0t65fn#(iW+jJNrBDjGH?lJuTcLS*M zCJ;XW;+H`Dj^RJU2ZjLuUkvea%pgO`(7g^2KyVjINJ!Y2nerT7zg7{b=@U@%M~2_O ze}G)Uz`?-`RKW>S4#eLXK79DiaO1{bhOo##K=voj@87@wfSCgjKrBdx#|8%hJ^A}K z!;6=H89u!K$8hn|e}79zm;Vf}U;SnH_Wdt|hzJA2w{L9v zKm$+03;_rrWCO2Vy8NBt`Sbq_U%vhaM#6uFeft;~u3r0mj){rs$Er1aR+^fO4Da6l zWq9)R55u$Pph#y1`rxlP)ahU+0t67UfzuZ+`OWk1-#*p^ub?-7eIUs7++t%{(1cS_wVme7lHvm0I{G&(q|yP z0>pPgDL_zAu(7mQG^n6}hvDy^mke)#-hKW0FT>Mk{~3-SV`KR7BWnT(AbbXX{Pg)R!{y6A8UFqI z4~$I)hM&I}L0J@-Dj7g|_!1;9GN2Sy00D&0KotcA7KUwGI2qo&{lW0$F(@+rFr;U) zfeMeC*bD;!fB<5`U&{Suc=zrnIGKRL@cZ}w$dQM&5CsSzd@lU{?c0BbqsRULlM5(9 z{xSRjdK;MNp8(|qf%r8xO#lIevw#HwF)^`pAXNx71Y`g^NDP=Wj(z_8xg5y6jIDqL y2q3%$0s$)!g9=6qAeMrPJ%r|_hu91R2rvMM1;Nb&J6)Rq0000