X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Workshop.h;h=b492fa1134d3bf225c9ef7dd0b4a19d7feb88f15;hb=6a7b7e89852489a242ed25f5808d9306b00cc7d9;hp=34ce06b91568e4483d9c0d03e458429d644d9bd4;hpb=537afa7e604c3b071def66b40f00a04cb74261de;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index 34ce06b91..b492fa113 100644 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -10,6 +10,8 @@ #include #include +#include + #include #include #include @@ -41,6 +43,7 @@ class Config_PointerMessage; class QWidget; class QDockWidget; +class QMainWindow; class ModelAPI_ObjectUpdatedMessage; class ModelAPI_ObjectDeletedMessage; @@ -149,6 +152,10 @@ Q_OBJECT return myModuleConnector; } + /// Returns a desktop + /// \return a desktop instance + QMainWindow* desktop() const; + //! Returns icon name according to feature static QIcon featureIcon(const FeaturePtr& theFeature); @@ -210,10 +217,16 @@ signals: //! the application is started void applicationStarted(); + void updateUndoHistory(const QList&); + void updateRedoHistory(const QList&); + public slots: /// Update of commands status void updateCommandStatus(); + /// update history list (undo/redo commands) + void updateHistory(); + /// Create a new dokument void onNew(); @@ -230,10 +243,10 @@ signals: void onExit(); /// Undo last command - void onUndo(); + void onUndo(int times = 1); /// Redo previous command - void onRedo(); + void onRedo(int times = 1); /// Rebuild data tree void onRebuild(); @@ -333,14 +346,11 @@ signals: /// \param theOpertion an aborted operation void onOperationAborted(ModuleBase_Operation* theOperation); - /// Process context menu command - /// \param theId id of the command - /// \param isChecked is checked flag + /// Slot, which reacts to the context popup menu call + /// \param theId the data value of the clicked action + /// \param isChecked a state of toggle if the action is checkable void onContextMenuCommand(const QString& theId, bool isChecked); - /// Processing of values changed in model widget - void onWidgetValuesChanged(); - /// Set waiting cursor void onStartWaiting(); @@ -372,6 +382,13 @@ signals: /// Displaus object and fit all viewer if the object is first (update viewer will not be called) void displayObject(ObjectPtr theObj); + //! Extends undo/redo toolbutton's with history menu + //! \param theObject - in the OpenParts it is a QToolButton by itself, + //! in salome mode - QAction that creates a button. + //! \param theSignal - void "updateUndoHistory" or "updateRedoHistory" SIGNAL; + //! \param theSlot - onUndo(int) or onRedo(int) SLOT + void addHistoryMenu(QObject* theObject, const char* theSignal, const char* theSlot); + private: AppElements_MainWindow* myMainWindow; ModuleBase_IModule* myModule;