Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index 1f3bee21adc295a453990955c459f5f996f9a8f9..1b48c4e081c1d7fc1f2c17e73c3f2782cfd49d62 100644 (file)
@@ -495,6 +495,7 @@ void XGUI_Workshop::onOperationStarted()
     for (; anIt != aLast; anIt++) {
       aWidget = *anIt;
       aWidget->setFeature(aOperation->feature());
+      aWidget->enableFocusProcessing();
       QObject::connect(aWidget, SIGNAL(valuesChanged()), this, SLOT(onWidgetValuesChanged()));
       // Init default values
       if (!aOperation->isEditOperation() && !aWidget->isComputedDefault()) {
@@ -504,7 +505,11 @@ void XGUI_Workshop::onOperationStarted()
 
     myPropertyPanel->setModelWidgets(aWidgets);
     myPropertyPanel->onActivateNextWidget(NULL);
-    myPropertyPanel->setWindowTitle(aOperation->getDescription()->description());
+    // Widget activation (from the previous method) may commit the current operation
+    // if pre-selection is enougth for it. So we shouldn't update prop panel's title
+    if(myOperationMgr->isCurrentOperation(aOperation)) {
+      myPropertyPanel->setWindowTitle(aOperation->getDescription()->description());
+    }
   }
   updateCommandStatus();
 }
@@ -522,12 +527,6 @@ bool XGUI_Workshop::event(QEvent * theEvent)
 {
   PostponeMessageQtEvent* aPostponedEv = dynamic_cast<PostponeMessageQtEvent*>(theEvent);
   if (aPostponedEv) {
-#ifdef _DEBUG
-    std::cout << "XGUI_Workshop::event " << "Got PostponeMessageQtEvent" << std::endl;
-    bool isMyThread = (QApplication::instance()->thread() == QThread::currentThread());
-    std::cout << "XGUI_Workshop::event " << "I am in the Qt's thread: "
-              << isMyThread << std::endl;
-#endif
     boost::shared_ptr<Events_Message> aEventPtr = aPostponedEv->postponedMessage();
     processEvent(aEventPtr);
     return true;
@@ -874,7 +873,7 @@ ModuleBase_IModule* XGUI_Workshop::loadModule(const QString& theModule)
 
   if (!err.isEmpty()) {
     if (mainWindow()) {
-      QMessageBox::warning(mainWindow(), tr("Error"), err);
+      Events_Error::send(err.toStdString());
     } else {
       qWarning(qPrintable(err));
     }
@@ -1093,6 +1092,8 @@ void XGUI_Workshop::onContextMenuCommand(const QString& theId, bool isChecked)
     setDisplayMode(aObjects, XGUI_Displayer::Shading);
   else if (theId == "WIREFRAME_CMD")
     setDisplayMode(aObjects, XGUI_Displayer::Wireframe);
+  else if (theId == "HIDEALL_CMD")
+    myDisplayer->eraseAll();
 }
 
 //**************************************************************