]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2556: Implementation of the customer remarks
authorvsv <vsv@opencascade.com>
Wed, 19 Sep 2018 13:29:09 +0000 (16:29 +0300)
committervsv <vsv@opencascade.com>
Wed, 19 Sep 2018 13:29:09 +0000 (16:29 +0300)
src/SHAPERGUI/SHAPERGUI.cpp
src/SHAPERGUI/SHAPERGUI.h
src/XGUI/XGUI_InspectionPanel.cpp
src/XGUI/XGUI_pictures.qrc
src/XGUI/pictures/whatis.png [new file with mode: 0644]

index 930a4d475826d0b43357f25d62116be75df92389..25ec9a918059bbbd78e4182e28c1d67242abb119 100644 (file)
@@ -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
index 6d031e755d4377845b1227e559788d77b5e42a70..1c0a10ee70fa38c24e7709c9724b0cdcf594a5a8 100644 (file)
@@ -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
index e96acd39ad945b5ee3f9678288847b57baa39dcc..8764568f800b05971645ff8d028bbfa821c3a554 100644 (file)
@@ -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);
index 81b392d43a8b57e982025ff18a4d4ad34d582bcd..5de669be428945951540e08c67d073d0c6130c3f 100644 (file)
@@ -75,5 +75,6 @@
      <file>pictures/move_out_before.png</file>
      <file>pictures/selection.png</file>
      <file>pictures/autoapply.png</file>
+     <file>pictures/whatis.png</file>
  </qresource>
  </RCC>
diff --git a/src/XGUI/pictures/whatis.png b/src/XGUI/pictures/whatis.png
new file mode 100644 (file)
index 0000000..d213e30
Binary files /dev/null and b/src/XGUI/pictures/whatis.png differ