From 39bb14c5ae7df11b8c788ab0037ba5b893267204 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 18 Oct 2018 19:37:37 +0300 Subject: [PATCH] Auto-rebuild management --- src/ModuleBase/ModuleBase_Dialog.cpp | 2 +- src/ModuleBase/ModuleBase_ModelDialogWidget.h | 2 +- src/ModuleBase/ModuleBase_Tools.cpp | 24 +++++---- src/ModuleBase/ModuleBase_Tools.h | 9 ++++ .../ParametersPlugin_WidgetParamsMgr.cpp | 40 ++++++++++++++- .../ParametersPlugin_WidgetParamsMgr.h | 13 +++++ src/PartSet/PartSet_IconFactory.cpp | 9 ++-- src/PartSet/PartSet_TreeNodes.cpp | 27 ++++++++++ src/PartSet/PartSet_TreeNodes.h | 3 ++ src/PartSet/PartSet_icons.qrc | 3 ++ src/PartSet/icons/hasWarning.png | Bin 0 -> 448 bytes src/PartSet/icons/isFailed.png | Bin 0 -> 509 bytes src/PartSet/icons/toWork.png | Bin 0 -> 555 bytes src/XGUI/XGUI_Workshop.cpp | 46 ++++++++++++++---- src/XGUI/XGUI_Workshop.h | 4 +- src/XGUI/XGUI_WorkshopListener.cpp | 12 +++-- src/XGUI/XGUI_WorkshopListener.h | 4 +- src/XGUI/XGUI_pictures.qrc | 3 +- src/XGUI/pictures/autoapply.png | Bin 525 -> 0 bytes src/XGUI/pictures/autoapply_start.png | Bin 0 -> 300 bytes src/XGUI/pictures/autoapply_stop.png | Bin 0 -> 298 bytes 21 files changed, 167 insertions(+), 34 deletions(-) create mode 100644 src/PartSet/icons/hasWarning.png create mode 100644 src/PartSet/icons/isFailed.png create mode 100644 src/PartSet/icons/toWork.png delete mode 100644 src/XGUI/pictures/autoapply.png create mode 100644 src/XGUI/pictures/autoapply_start.png create mode 100644 src/XGUI/pictures/autoapply_stop.png diff --git a/src/ModuleBase/ModuleBase_Dialog.cpp b/src/ModuleBase/ModuleBase_Dialog.cpp index d07bebf0f..6c0cacd4f 100644 --- a/src/ModuleBase/ModuleBase_Dialog.cpp +++ b/src/ModuleBase/ModuleBase_Dialog.cpp @@ -75,7 +75,7 @@ ModuleBase_Dialog::ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QStr aFrame->setFrameStyle(QFrame::WinPanel | QFrame::Raised); aLayout->addWidget(aFrame); - QVBoxLayout* aBtnLayout = new QVBoxLayout(aFrame); + QHBoxLayout* aBtnLayout = new QHBoxLayout(aFrame); ModuleBase_Tools::adjustMargins(aBtnLayout); myButtonsBox = new QDialogButtonBox( diff --git a/src/ModuleBase/ModuleBase_ModelDialogWidget.h b/src/ModuleBase/ModuleBase_ModelDialogWidget.h index d167da4a6..7ce788e86 100644 --- a/src/ModuleBase/ModuleBase_ModelDialogWidget.h +++ b/src/ModuleBase/ModuleBase_ModelDialogWidget.h @@ -42,7 +42,7 @@ public: /// Set general buttons from dialog /// \param theButtons the dialog buttons - void setDialogButtons(QDialogButtonBox* theButtons) { myOkCancelBtn = theButtons; } + virtual void setDialogButtons(QDialogButtonBox* theButtons) { myOkCancelBtn = theButtons; } protected: diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 67d2b349a..a60e3c2bb 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -182,28 +182,32 @@ QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon) { QImage anIcon = ModuleBase_IconFactory::loadImage(theIcon); QImage anAditional(theAdditionalIcon); + return composite(anAditional, anIcon); +} - if (anIcon.isNull()) +QPixmap composite(const QImage& theAdditionalIcon, QImage& theIcon) +{ + if (theIcon.isNull()) return QPixmap(); - int anAddWidth = anAditional.width(); - int anAddHeight = anAditional.height(); + int anAddWidth = theAdditionalIcon.width(); + int anAddHeight = theAdditionalIcon.height(); - int aWidth = anIcon.width(); - int aHeight = anIcon.height(); + int aWidth = theIcon.width(); + int aHeight = theIcon.height(); - int aStartWidthPos = aWidth - anAddWidth - 1; - int aStartHeightPos = aHeight - anAddHeight - 1; + int aStartWidthPos = aWidth - anAddWidth; + int aStartHeightPos = aHeight - anAddHeight; for (int i = 0; i < anAddWidth && i + aStartWidthPos < aWidth; i++) { for (int j = 0; j < anAddHeight && j + aStartHeightPos < aHeight; j++) { - if (qAlpha(anAditional.pixel(i, j)) > 0) - anIcon.setPixel(i + aStartWidthPos, j + aStartHeightPos, anAditional.pixel(i, j)); + if (qAlpha(theAdditionalIcon.pixel(i, j)) > 0) + theIcon.setPixel(i + aStartWidthPos, j + aStartHeightPos, theAdditionalIcon.pixel(i, j)); } } - return QPixmap::fromImage(anIcon); + return QPixmap::fromImage(theIcon); } QPixmap lighter(const QString& theIcon, const int theLighterValue) diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index 6dd1e0985..b29434431 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -96,6 +96,15 @@ MODULEBASE_EXPORT void setShadowEffect(QWidget* theWidget, const bool isSetEffec /// \return resulting pixmap MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon); +/// Create composite pixmap. +/// Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates +/// specified relatively to the upper left corner of \a theIcon. + +/// \param theAdditionalIcon additional pixmap +/// \param theIcon background pixmap +/// \return resulting pixmap +MODULEBASE_EXPORT QPixmap composite(const QImage& theAdditionalIcon, QImage& theIcon); + /// Generates the pixmap lighter than the resources pixmap. /// Pixmap \a theIcon is lighted according to the given value. /// If the lighter value is greater than 100, this functions returns a lighter pixmap. diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index 96e10edb1..d31439d40 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -176,7 +176,8 @@ void ParametersPlugin_TreeWidget::closeEditor(QWidget* theEditor, ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theParent, const Config_WidgetAPI* theData) - : ModuleBase_ModelDialogWidget(theParent, theData) + : ModuleBase_ModelDialogWidget(theParent, theData), + isUpplyBlocked(false) { QVBoxLayout* aLayout = new QVBoxLayout(this); @@ -248,6 +249,20 @@ ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theP onSelectionChanged(); } +void ParametersPlugin_WidgetParamsMgr::setDialogButtons(QDialogButtonBox* theButtons) +{ + ModuleBase_ModelDialogWidget::setDialogButtons(theButtons); + + QWidget* aBtnParentWgt = myOkCancelBtn->parentWidget(); + QHBoxLayout* aBtnParentLayout = dynamic_cast(aBtnParentWgt->layout()); + + QPushButton* aPreviewBtn = new QPushButton(tr("See preview"), aBtnParentWgt); + aBtnParentLayout->insertWidget(0, aPreviewBtn); + aBtnParentLayout->insertStretch(1, 1); + connect(aPreviewBtn, SIGNAL(clicked(bool)), SLOT(onShowPreview())); +} + + QList ParametersPlugin_WidgetParamsMgr::getControls() const { QList aList; @@ -783,3 +798,26 @@ bool ParametersPlugin_WidgetParamsMgr::isValid() return true; } +void ParametersPlugin_WidgetParamsMgr::showEvent(QShowEvent* theEvent) +{ + ModuleBase_ModelDialogWidget::showEvent(theEvent); + SessionPtr aMgr = ModelAPI_Session::get(); + isUpplyBlocked = aMgr->isAutoUpdateBlocked(); + aMgr->blockAutoUpdate(true); + Events_Loop* aLoop = Events_Loop::loop(); + aLoop->flush(aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE)); +} + +void ParametersPlugin_WidgetParamsMgr::hideEvent(QHideEvent* theEvent) +{ + ModuleBase_ModelDialogWidget::hideEvent(theEvent); + SessionPtr aMgr = ModelAPI_Session::get(); + aMgr->blockAutoUpdate(isUpplyBlocked); +} + +void ParametersPlugin_WidgetParamsMgr::onShowPreview() +{ + SessionPtr aMgr = ModelAPI_Session::get(); + aMgr->blockAutoUpdate(false); + aMgr->blockAutoUpdate(true); +} \ No newline at end of file diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h index 0e55044b3..98d0aefff 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h @@ -71,6 +71,10 @@ public: /// \return a control list virtual QList getControls() const; + /// Set general buttons from dialog + /// \param theButtons the dialog buttons + virtual void setDialogButtons(QDialogButtonBox* theButtons); + protected: /// Saves the internal parameters to the given feature /// \return True in success @@ -82,6 +86,10 @@ protected: /// The method called when widget is activated virtual void activateCustom(); + virtual void showEvent(QShowEvent* theEvent); + + virtual void hideEvent(QHideEvent* theEvent); + private slots: /// Slot for reaction on double click in the table (start editing) /// \param theIndex the clicked index @@ -113,6 +121,9 @@ private slots: /// Slot for reaction on selection in the table void onSelectionChanged(); + // A slot for show preview button + void onShowPreview(); + private: /// Creates a new parameter feature FeaturePtr createParameter() const; @@ -162,6 +173,8 @@ private: QPushButton* myRemoveBtn; QToolButton* myUpBtn; QToolButton* myDownBtn; + + bool isUpplyBlocked; }; diff --git a/src/PartSet/PartSet_IconFactory.cpp b/src/PartSet/PartSet_IconFactory.cpp index 42b3d4d62..da1c13a4a 100644 --- a/src/PartSet/PartSet_IconFactory.cpp +++ b/src/PartSet/PartSet_IconFactory.cpp @@ -64,11 +64,12 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) } break; case ModelAPI_StateMustBeUpdated: { - anIcon = ModuleBase_Tools::lighter(anIconString); + anIcon = ModuleBase_Tools::composite(":icons/toWork.png", anIconString); + //anIcon = ModuleBase_Tools::lighter(anIconString); } break; case ModelAPI_StateExecFailed: { - anIcon = ModuleBase_Tools::composite(":icons/exec_state_failed.png", anIconString); + anIcon = ModuleBase_Tools::composite(":icons/isFailed.png", anIconString); } break; case ModelAPI_StateInvalidArgument: { @@ -80,8 +81,8 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) } } - if (theObj->data() && theObj->data()->execState() == ModelAPI_StateMustBeUpdated) - return QIcon(":pictures/constr_object_modified.png"); + //if (theObj->data() && theObj->data()->execState() == ModelAPI_StateMustBeUpdated) + // return QIcon(":pictures/constr_object_modified.png"); std::string aGroup = theObj->groupName(); if (aGroup == ModelAPI_ResultPart::group()) diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index 92d25db69..08e9e3681 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -22,6 +22,7 @@ #include #include +#include #include @@ -1184,6 +1185,32 @@ void PartSet_ObjectFolderNode::getFirstAndLastIndex(int& theFirst, int& theLast) } +QVariant PartSet_ObjectFolderNode::data(int theColumn, int theRole) const +{ + const QImage anAditional(":icons/hasWarning.png"); + + if ((theRole == Qt::DecorationRole) && (theColumn == 1)) { + ObjectPtr aObject; + bool aHasWarning = false; + foreach(ModuleBase_ITreeNode* aNode, myChildren) { + aObject = aNode->object(); + if (aObject.get()) { + ModelAPI_ExecState aState = aObject->data()->execState(); + if ((aState == ModelAPI_StateExecFailed) || (aState == ModelAPI_StateMustBeUpdated)) { + aHasWarning = true; + break; + } + } + } + if (aHasWarning) { + return QIcon(ModuleBase_Tools::composite(":icons/hasWarning.png", + ":pictures/features_folder.png")); + } + } + return PartSet_ObjectNode::data(theColumn, theRole); +} + + ////////////////////////////////////////////////////////////////////////////////// QVariant PartSet_StepNode::data(int theColumn, int theRole) const { diff --git a/src/PartSet/PartSet_TreeNodes.h b/src/PartSet/PartSet_TreeNodes.h index 37e6d54db..4e37df89c 100644 --- a/src/PartSet/PartSet_TreeNodes.h +++ b/src/PartSet/PartSet_TreeNodes.h @@ -327,6 +327,9 @@ public: /// \param theGroup a name of group where objects were deleted virtual QTreeNodesList objectsDeleted(const DocumentPtr& theDoc, const QString& theGroup); + /// Returns the node representation according to theRole. + virtual QVariant data(int theColumn, int theRole) const; + private: FeaturePtr getFeature(const std::string& theId) const; diff --git a/src/PartSet/PartSet_icons.qrc b/src/PartSet/PartSet_icons.qrc index 9b19b30a5..99819d90e 100644 --- a/src/PartSet/PartSet_icons.qrc +++ b/src/PartSet/PartSet_icons.qrc @@ -19,5 +19,8 @@ icons/group_face.png icons/group_solid.png icons/group_vertex.png + icons/toWork.png + icons/isFailed.png + icons/hasWarning.png diff --git a/src/PartSet/icons/hasWarning.png b/src/PartSet/icons/hasWarning.png new file mode 100644 index 0000000000000000000000000000000000000000..535aef227d8f9c35719c1464eb105d1a275a233c GIT binary patch literal 448 zcmV;x0YCnUP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E-_;&oJ#-z0WnELK~yMHV?YP9ZCL+*dzke9&zp?@AU0GO zKiFNW`v2d%^#6Z>_(-cRVNElP7$m>mi~0ZORWca=ewp}xx&ebKR2mb2G%Rr8{Qv7| zB*=6y2C+e6Q%x9T!HUqqR6~Z=J>~NMe?AO`Yx)6XpP8uhA1F5wtOyxEY~lF-<%Y-q z?{|ISnn3KI550l5abVgu&4{66UxoDlpAX#rf4k)d*92n!yzln^^aR!a(+n9VfE9zl zY-{HK$696n|GaDc|JzOL|6i_I!!?1}Ah91nxy!Sa|AW-dv0~t5*p?yq|Mz{f|3B}T z{r`T`?Ely6W^hd)Hb@L42U4>$Px${71BOV3qfO%ff8R3#Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E-_;&oJ#-z0d7e|K~yMHWsut|!*LjgzbWUH7Mhura=uai z01-E$WSE%AGz@d9UCV`XE4g&%!VN{-%xQ(?lpEx*AN{nVvBZX&V~?$^Se|<8?el)# zL$COYL*0r`Vdh%Y;z&0Tk)v_t4Is;0@MvqueMuxJWgJ8|3UB z)AX#1%J3PIsGCM*!=BOzlAn2P z1FNExFSn1a%w`_5EYaWCDY0^tW92!`%2|$uLzRKMI3r8ydKL?tqs<{g8=Rtwdrdcc znpT#RDv^ZF6)FGcQs`>!$u%5nO@#7@96^X5@HOD@2pK@a00000NkvXXu0mjf*%9BI literal 0 HcmV?d00001 diff --git a/src/PartSet/icons/toWork.png b/src/PartSet/icons/toWork.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3dc11332e6eebe1c841f1ac49a67fdb7e7004d GIT binary patch literal 555 zcmV+`0@VG9P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E-_;&oJ#-z0h~!hK~yMHb&*eKl5rTvUv>*B-&wjjOeTbs z87rdJ*dd3PLB-f5iDZ{8aj@zTG>C3pJj4=@T{<=*kn+#gBv3XXEy$uSJ2jEIjF?mR ziu(HLv0Zwb9lrd&&-eR$pNHS?rvN=s`#d8@Z?C6V$%i1XP|x|LJm?<~y6B|MG{3kY zV?ryZL^Aq@qKnGvBz$xVy-(-sNp_PS;l>_AvG+X=Ye#5RZ?Llyq*1>G>nhc6PsRRE zs1`p3+ZWg@1sJ`ovR#>j@+InT2F30X+AD^k&`%=eW#qgSzu$r0nMc=W_h-kF5|6{==#$~3FcyCf4ntTvTv*PZyL6d1R^})llJc*3+IP4*_;lu7YEL{o{BP!%connectTo(this, SLOT(onOpen())); - aCommand = aGroup->addFeature("AUTOCOMPUTE_CMD", tr("Block auto-apply"), + aCommand = aGroup->addFeature("AUTOCOMPUTE_CMD", tr("Auto rebuild"), tr("Blocks immediate apply of modifications"), - QIcon(":pictures/autoapply.png"), QString(), - QKeySequence(), true, true); - aCommand->setChecked(ModelAPI_Session::get()->isAutoUpdateBlocked()); - aCommand->connectTo(this, SLOT(onAutoApply(bool))); + QIcon(":pictures/autoapply_start.png"), QKeySequence()); + //aCommand->setChecked(ModelAPI_Session::get()->isAutoUpdateBlocked()); + aCommand->connectTo(this, SLOT(onAutoApply())); aCommand = aGroup->addFeature("PREF_CMD", tr("Preferences"), tr("Edit preferences"), QIcon(":pictures/preferences.png"), QKeySequence::Preferences); @@ -1327,7 +1326,10 @@ void XGUI_Workshop::updateCommandStatus() aCmd->setEnabled(myModule->canRedo()); } else if (aId == "AUTOCOMPUTE_CMD") { - aCmd->setChecked(aMgr->isAutoUpdateBlocked()); + //aCmd->setChecked(aMgr->isAutoUpdateBlocked()); + aCmd->setIcon(aMgr->isAutoUpdateBlocked() ? + QIcon(":pictures/autoapply_stop.png") : + QIcon(":pictures/autoapply_start.png")); } else // Enable all commands @@ -2824,8 +2826,32 @@ void XGUI_Workshop::moveOutFolder(bool isBefore) updateCommandStatus(); } -void XGUI_Workshop::onAutoApply(bool isToggle) +void XGUI_Workshop::onAutoApply() { SessionPtr aMgr = ModelAPI_Session::get(); - aMgr->blockAutoUpdate(isToggle); -} \ No newline at end of file + bool isBlocked = aMgr->isAutoUpdateBlocked(); + aMgr->blockAutoUpdate(!isBlocked); +} + +void XGUI_Workshop::updateAutoComputeState() +{ + SessionPtr aMgr = ModelAPI_Session::get(); + bool isComputeBlocked = aMgr->isAutoUpdateBlocked(); +#ifdef HAVE_SALOME + QAction* aUpdateCmd; + QList aCommands = workshop()->salomeConnector()->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 +} diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index b25938005..f9504dfee 100755 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -320,6 +320,8 @@ Q_OBJECT /// \param theDirectory a path to directory void openDirectory(const QString& theDirectory); + void updateAutoComputeState(); + signals: /// Emitted when selection happens in Salome viewer void salomeViewerSelection(); @@ -396,7 +398,7 @@ signals: #endif /// A slot calleon toggle of auto-compute button - void onAutoApply(bool isToggle); + void onAutoApply(); /// Activates/deactivates the trihedron in the viewer AIS context void onTrihedronVisibilityChanged(bool theState); diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index f7720512d..7701c221b 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -82,7 +82,7 @@ const std::string DebugFeatureKind = "";//"Extrusion"; #endif -XGUI_WorkshopListener::XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop) +XGUI_WorkshopListener::XGUI_WorkshopListener(XGUI_Workshop* theWorkshop) : myWorkshop(theWorkshop), myUpdatePrefs(false) { @@ -113,6 +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)); } //****************************************************** @@ -184,6 +186,11 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& // 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 { //Show error dialog if error message received. std::shared_ptr anIngfoMsg = @@ -524,6 +531,5 @@ bool XGUI_WorkshopListener::customizeCurrentObject(const std::set& th XGUI_Workshop* XGUI_WorkshopListener::workshop() const { - XGUI_ModuleConnector* aConnector = dynamic_cast(myWorkshop); - return aConnector->workshop(); + return myWorkshop; } diff --git a/src/XGUI/XGUI_WorkshopListener.h b/src/XGUI/XGUI_WorkshopListener.h index c338535bd..cece7d965 100755 --- a/src/XGUI/XGUI_WorkshopListener.h +++ b/src/XGUI/XGUI_WorkshopListener.h @@ -50,7 +50,7 @@ class XGUI_EXPORT XGUI_WorkshopListener : public QObject, public Events_Listener public: /// Constructor. Used only if the workshop is launched in Salome environment /// \param theWorkshop a reference to workshop. - XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop); + XGUI_WorkshopListener(XGUI_Workshop* theWorkshop); virtual ~XGUI_WorkshopListener(); /// Register this class in the events loop for several types of events @@ -104,7 +104,7 @@ protected: XGUI_Workshop* workshop() const; private: - ModuleBase_IWorkshop* myWorkshop; // the current workshop + XGUI_Workshop* myWorkshop; // the current workshop bool myUpdatePrefs; }; diff --git a/src/XGUI/XGUI_pictures.qrc b/src/XGUI/XGUI_pictures.qrc index 5de669be4..ea9614f94 100644 --- a/src/XGUI/XGUI_pictures.qrc +++ b/src/XGUI/XGUI_pictures.qrc @@ -74,7 +74,8 @@ pictures/move_out_after.png pictures/move_out_before.png pictures/selection.png - pictures/autoapply.png + pictures/autoapply_start.png + pictures/autoapply_stop.png pictures/whatis.png diff --git a/src/XGUI/pictures/autoapply.png b/src/XGUI/pictures/autoapply.png deleted file mode 100644 index 6298c41d5d309c1bbfeccf4ccb57ba7d4525b510..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 525 zcmV+o0`mQdP)N2bZe?^J zG%heMGBNQWX_Wu~0g6dPK~y+TW4L|$Hc5E;w!Nkf4i5i8xO?3i8?1`(VUWg!d(VI| zh>cYdE}S~0B!+AQfEpZ;HIr-rHqGs;m)XHhE?>~+g-s&}g8~bi0U$ZJ$soF6)y#(= z1CccY`N}Xgb9Nm2KV{wS|8{nEmsC~O#G7U;`ET#$_21ai>Ys{= z%70;DVKWQ^V1}emEe{7t0{LLuXKX(B-^R)9e`QPe|LpAS|6yTa^W@~@4vC72@-w7N zEsVuxNXyDa_Av2@E4Tf3^Y;Jm?d|=4=Js9k|Ns9N)YH>Dr=Xx92Xj8&JOVsmhC{N>`}`i});8UVteBnr|9!r3!w^nigkK}kvJ7&^AGvFQf@qftPZpk|Lu P00000NkvXXu0mjfZz<&O diff --git a/src/XGUI/pictures/autoapply_start.png b/src/XGUI/pictures/autoapply_start.png new file mode 100644 index 0000000000000000000000000000000000000000..86453bb7bb40271391d9731d0a794c9cb355b07f GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt3( zJ;P+JIo?1ub3I)gLoEE4PTnZkpupp*sVmcV@J9Qgrb&)6O@&EzOzeX1o5aqaZk^A6 zB%veYfJ?gMd6hPyjmxD2SP~)CrZRl}`Ddc420QACs@1 p98c7vcbrn%^NouhSx(-`;2SS--|)`L=|G1vc)I$ztaD0e0sxgEW)A=W literal 0 HcmV?d00001 diff --git a/src/XGUI/pictures/autoapply_stop.png b/src/XGUI/pictures/autoapply_stop.png new file mode 100644 index 0000000000000000000000000000000000000000..5bde65bc8b62cf739a2a3eb0e5cbedfdd229a286 GIT binary patch literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt3( zJ;P+JIo?1uvproLLoEE)PTt6SK!JxvQ`5-%2%qGnrlv$Ame{buKO9OMI#QgvCQtZV zcR<3~MfQ4~#WCZ~g-q8vELY}p=L%k3WWHeITt=odkt|XR&Z=E?*u42jI&<8EbIOfu z-%G!DwL9K^8!5!&#%a1=LML9a;{gvNTlV<~HqEY