#include <ModelAPI_Document.h>
#include <ModelAPI_Feature.h>
+#include <ModuleBase_ActionInfo.h>
+
#include <QObject>
#include <QMap>
#include <QKeySequence>
class QWidget;
class QDockWidget;
+class QMainWindow;
class ModelAPI_ObjectUpdatedMessage;
class ModelAPI_ObjectDeletedMessage;
return myModuleConnector;
}
+ /// Returns a desktop
+ /// \return a desktop instance
+ QMainWindow* desktop() const;
+
//! Returns icon name according to feature
static QIcon featureIcon(const FeaturePtr& theFeature);
//! the application is started
void applicationStarted();
+ void updateUndoHistory(const QList<ActionInfo>&);
+ void updateRedoHistory(const QList<ActionInfo>&);
+
public slots:
/// Update of commands status
void updateCommandStatus();
+ /// update history list (undo/redo commands)
+ void updateHistory();
+
/// Create a new dokument
void onNew();
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();
/// \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
/// 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;