#include <QtxPopupMgr.h>
#include <QtxActionMenuMgr.h>
+#include <QtxActionToolMgr.h>
#include <QtxResourceMgr.h>
#include <Config_PropManager.h>
aViewAct->setEnabled(true);
myWorkshop->objectBrowser()->setVisible(true);
aObjDoc->setVisible(true);
+ desktop()->tabifyDockWidget(aObjDoc, myWorkshop->propertyPanel());
}
if (!mySelector) {
const QIcon& theIcon, const QKeySequence& theKeys,
bool isCheckable)
{
+ static QString aLastTool = "";
+ static int aNb = 0;
+ if (aLastTool.isEmpty())
+ aLastTool = theWBName;
+ else if (theWBName != aLastTool) {
+ aLastTool = theWBName;
+ if (aNb > 20) {
+ desktop()->addToolBarBreak();
+ aNb = 0;
+ }
+ }
+ aNb++;
+
int aMenu = createMenu(theWBName, -1, -1, 50);
- int aTool = createTool(theWBName);
+ int aTool = createTool(theWBName, theWBName);
int aId = myActionsList.size();
myActionsList.append(theId);
const QList<QAction*>& theNestedActions)
{
int aMenu = createMenu(theWBName, -1, -1, 50);
- int aTool = createTool(theWBName);
+ int aTool = createTool(theWBName, theWBName);
int aId = myActionsList.size();
myActionsList.append(theInfo.id);
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
{
//******************************************************
void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
{
- theMenu->addActions(myWorkshop->contextMenuMgr()->viewerMenu()->actions());
- //myWorkshop->contextMenuMgr()->addViewerMenu(theMenu);
+ myWorkshop->contextMenuMgr()->updateViewerMenu();
+ myWorkshop->contextMenuMgr()->addViewerMenu(theMenu);
LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
}