#include <QtxPopupMgr.h>
#include <QtxActionMenuMgr.h>
+#include <QtxActionToolMgr.h>
#include <QtxResourceMgr.h>
#include <Config_PropManager.h>
createMenu(separator(), aMenu, -1, theMenuPosition);
}
+bool NewGeom_Module::addActionInToolbar( QAction* theAction, const QString& theToolBarTitle )
+{
+ if( !theAction )
+ return false;
+
+ SUIT_Desktop* aDesktop = application()->desktop();
+ if( !aDesktop )
+ return false;
+
+ QtxActionToolMgr* aToolMgr = aDesktop->toolMgr();
+ if( !aToolMgr )
+ return false;
+
+ aToolMgr->append( theAction, theToolBarTitle );
+ return true;
+}
+
//******************************************************
QList<QAction*> NewGeom_Module::commandList() const
{
virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
const int theMenuPosition = 10);
+ virtual bool addActionInToolbar( QAction* theAction, const QString& theToolBarTitle );
+
virtual QMainWindow* desktop() const;
virtual QString commandId(const QAction* theCmd) const;
virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
const int theMenuPosition = 10) = 0;
+ virtual bool addActionInToolbar( QAction* theAction, const QString& theToolBarTitle ) = 0;
+
//! Returns desktop window of SALOME
virtual QMainWindow* desktop() const = 0;
tr("Undo last command"),
QIcon(":pictures/undo.png"),
QKeySequence::Undo, false, "MEN_DESK_EDIT");
+ QString aToolBarTitle = tr( "INF_DESK_TOOLBAR_STANDARD" );
+ salomeConnector()->addActionInToolbar( aAction,aToolBarTitle );
+
connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onUndo()));
addHistoryMenu(aAction, SIGNAL(updateUndoHistory(const QList<ActionInfo>&)), SLOT(onUndo(int)));
aAction = salomeConnector()->addDesktopCommand("REDO_CMD", tr("Redo"), tr("Redo last command"),
QIcon(":pictures/redo.png"), QKeySequence::Redo,
false, "MEN_DESK_EDIT");
+ salomeConnector()->addActionInToolbar( aAction, aToolBarTitle );
+
connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onRedo()));
addHistoryMenu(aAction, SIGNAL(updateRedoHistory(const QList<ActionInfo>&)), SLOT(onRedo(int)));
aAction = salomeConnector()->addDesktopCommand("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
QIcon(":pictures/rebuild.png"), QKeySequence(),
false, "MEN_DESK_EDIT");
+ salomeConnector()->addActionInToolbar( aAction, aToolBarTitle );
+
connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onRebuild()));
salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT");