]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2830: Remove Green/Red button
authorvsv <vsv@opencascade.com>
Thu, 10 Jan 2019 10:05:24 +0000 (13:05 +0300)
committervsv <vsv@opencascade.com>
Thu, 10 Jan 2019 10:05:24 +0000 (13:05 +0300)
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h
src/XGUI/XGUI_WorkshopListener.cpp

index 95901d380987392a59cd42a32c827724ce8bb646..553a0d05f92507e4cd36173b4084d509d3bee149 100755 (executable)
@@ -442,13 +442,13 @@ void XGUI_Workshop::initMenu()
 
   salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT");
 
-  aAction = salomeConnector()->addDesktopCommand("AUTOCOMPUTE_CMD", tr("Auto rebuild"),
-                                              tr("Blocks immediate apply of modifications"),
-                                              QIcon(":pictures/autoapply.png"), QKeySequence(),
-                                              false, "MEN_DESK_EDIT");
-  salomeConnector()->addActionInToolbar( aAction, aToolBarTitle );
+  //aAction = salomeConnector()->addDesktopCommand("AUTOCOMPUTE_CMD", tr("Auto rebuild"),
+  //                                            tr("Blocks immediate apply of modifications"),
+  //                                            QIcon(":pictures/autoapply.png"), QKeySequence(),
+  //                                            false, "MEN_DESK_EDIT");
+  //salomeConnector()->addActionInToolbar( aAction, aToolBarTitle );
 
-  connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onAutoApply()));
+  //connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onAutoApply()));
 
   salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT");
 
@@ -505,11 +505,11 @@ void XGUI_Workshop::initMenu()
   aCommand->connectTo(this, SLOT(onOpen()));
 
 
-  aCommand = aGroup->addFeature("AUTOCOMPUTE_CMD", tr("Auto rebuild"),
-                                tr("Blocks immediate apply of modifications"),
-                                QIcon(":pictures/autoapply_start.png"), QKeySequence());
+  //aCommand = aGroup->addFeature("AUTOCOMPUTE_CMD", tr("Auto rebuild"),
+  //                              tr("Blocks immediate apply of modifications"),
+  //                              QIcon(":pictures/autoapply_start.png"), QKeySequence());
   //aCommand->setChecked(ModelAPI_Session::get()->isAutoUpdateBlocked());
-  aCommand->connectTo(this, SLOT(onAutoApply()));
+  //aCommand->connectTo(this, SLOT(onAutoApply()));
 
   aCommand = aGroup->addFeature("PREF_CMD", tr("Preferences"), tr("Edit preferences"),
                                 QIcon(":pictures/preferences.png"), QKeySequence::Preferences);
@@ -1331,12 +1331,11 @@ void XGUI_Workshop::updateCommandStatus()
         else
           aCmd->setEnabled(myModule->canRedo());
       }
-      else if (aId == "AUTOCOMPUTE_CMD") {
-        //aCmd->setChecked(aMgr->isAutoUpdateBlocked());
-        aCmd->setIcon(aMgr->isAutoUpdateBlocked() ?
-          QIcon(":pictures/autoapply_stop.png") :
-          QIcon(":pictures/autoapply_start.png"));
-      }
+      //else if (aId == "AUTOCOMPUTE_CMD") {
+      //  aCmd->setIcon(aMgr->isAutoUpdateBlocked() ?
+      //    QIcon(":pictures/autoapply_stop.png") :
+      //    QIcon(":pictures/autoapply_start.png"));
+      //}
       else
         // Enable all commands
         aCmd->setEnabled(true);
@@ -2844,28 +2843,28 @@ void XGUI_Workshop::onAutoApply()
   aMgr->blockAutoUpdate(!isBlocked);
 }
 
-void XGUI_Workshop::updateAutoComputeState()
-{
-  SessionPtr aMgr = ModelAPI_Session::get();
-  bool isComputeBlocked = aMgr->isAutoUpdateBlocked();
-#ifdef HAVE_SALOME
-  QAction* aUpdateCmd;
-  QList<QAction*> aCommands = mySalomeConnector->commandList();
-  foreach(QAction* aCmd, aCommands) {
-    if (aCmd->data().toString() == "AUTOCOMPUTE_CMD") {
-      aUpdateCmd = aCmd;
-      break;
-    }
-  }
-  aUpdateCmd->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
-    QIcon(":pictures/autoapply_start.png"));
-#else
-  AppElements_MainMenu* aMenuBar = myMainWindow->menuObject();
-  AppElements_Command* aUpdateCmd = aMenuBar->feature("AUTOCOMPUTE_CMD");
-  aUpdateCmd->button()->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
-    QIcon(":pictures/autoapply_start.png"));
-#endif
-}
+//void XGUI_Workshop::updateAutoComputeState()
+//{
+//  SessionPtr aMgr = ModelAPI_Session::get();
+//  bool isComputeBlocked = aMgr->isAutoUpdateBlocked();
+//#ifdef HAVE_SALOME
+//  QAction* aUpdateCmd;
+//  QList<QAction*> aCommands = mySalomeConnector->commandList();
+//  foreach(QAction* aCmd, aCommands) {
+//    if (aCmd->data().toString() == "AUTOCOMPUTE_CMD") {
+//      aUpdateCmd = aCmd;
+//      break;
+//    }
+//  }
+//  aUpdateCmd->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
+//    QIcon(":pictures/autoapply_start.png"));
+//#else
+//  AppElements_MainMenu* aMenuBar = myMainWindow->menuObject();
+//  AppElements_Command* aUpdateCmd = aMenuBar->feature("AUTOCOMPUTE_CMD");
+//  aUpdateCmd->button()->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
+//    QIcon(":pictures/autoapply_start.png"));
+//#endif
+//}
 
 
 void XGUI_Workshop::clearTemporaryDir()
index 2955efab2dd7d3508166edb3b76fb3755e548dc0..5c5a47d9a49a4ee3d19f24ee85202c0a94b1be5f 100755 (executable)
@@ -321,7 +321,7 @@ Q_OBJECT
   /// \param theDirectory a path to directory
   void openFile(const QString& theDirectory);
 
-  void updateAutoComputeState();
+  //void updateAutoComputeState();
 
 signals:
   /// Emitted when selection happens in Salome viewer
index 7701c221b70b1375a1764282380bbd044b4063f3..33c2cd199650529312bdf2d7e9fd45777301c3f1 100755 (executable)
@@ -113,8 +113,8 @@ void XGUI_WorkshopListener::initializeEventListening()
 
   aLoop->registerListener(this, Events_Loop::eventByName("FinishOperation"));
   aLoop->registerListener(this, Events_Loop::eventByName("AbortOperation"));
-  aLoop->registerListener(this, Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE));
-  aLoop->registerListener(this, Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE));
+  //aLoop->registerListener(this, Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE));
+  //aLoop->registerListener(this, Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE));
 }
 
 //******************************************************
@@ -186,11 +186,11 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr<Events_Message>&
     // the viewer's update context is unblocked, the viewer's update works
     XGUI_Displayer* aDisplayer = workshop()->displayer();
     aDisplayer->enableUpdateViewer(true);
-  } else if ((theMessage->eventID() ==
-    Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE)) ||
-    (theMessage->eventID() ==
-      Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE))) {
-    myWorkshop->updateAutoComputeState();
+  //} else if ((theMessage->eventID() ==
+  //  Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE)) ||
+  //  (theMessage->eventID() ==
+  //    Events_Loop::eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE))) {
+  //  myWorkshop->updateAutoComputeState();
   } else {
     //Show error dialog if error message received.
     std::shared_ptr<Events_InfoMessage> anIngfoMsg =