-// Copyright (C) 2011-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2011-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Guillaume Boulant (EDF)
+// Author : Guillaume Boulant (EDF)
#include "StandardApp_Module.hxx"
* class.
*/
int StandardApp_Module::createStandardAction(const QString& label,
- QObject * slotobject,
- const char* slotmember,
- const QString& iconName,
- const QString& tooltip,
- const int identifier)
+ QObject * slotobject,
+ const char* slotmember,
+ const QString& iconName,
+ const QString& tooltip,
+ const int identifier)
{
// If the tooltip is not defined, we choose instead the label text.
}
// Creating the action
- QAction * action= this->createAction( effIdentifier, label, actionIcon,
+ QAction * action= this->createAction( effIdentifier, label, actionIcon,
label, effToolTip, 0, getApp()->desktop(),
false, slotobject, slotmember);
}
/**
- * Integrate the action in the default menu
+ * Integrate action in the specified menu. If the menu is not
+ * specified, then it is integrated into the menu associated to the
+ * SALOME module.
*/
-void StandardApp_Module::addActionInMenubar(int actionId) {
- this->createMenu( actionId, _defaultMenuId, 10 );
+void StandardApp_Module::addActionInMenubar(int actionId, int menuId) {
+ if ( menuId == UNSPECIFIED_INT) {
+ menuId = _defaultMenuId;
+ }
+ this->action( actionId )->setIconVisibleInMenu(true);
+ this->createMenu( actionId, menuId, 10 );
}
+
+
/**
* Add the specified action as an item in the popup menu, with the
* specified visible rule. The default is "visible for object browser".
// implement "LightApp_Selection* createSelection() const;"
int parentId = -1;
QtxPopupMgr* mgr = this->popupMgr();
+ this->action( actionId )->setIconVisibleInMenu(true);
mgr->insert ( this->action( actionId ), parentId, 0 );
mgr->setRule( this->action( actionId ), rule, QtxPopupMgr::VisibleRule );
}
*/
void StandardApp_Module::createModuleActions() {
int actionId = this->createStandardAction("Test", this, SLOT(OnTest()),
- "f1.png", "Run the default test function");
+ "f1.png", "Run the default test function");
this->addActionInToolbar(actionId);
}
{
theMap.clear();
theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+#ifndef DISABLE_PYCONSOLE
theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+#endif
}
// Module's engine IOR
SUIT_Desktop* desk = getApp()->desktop();
_areaAtBottomLeftCorner = desk->corner(Qt::BottomLeftCorner);
_areaAtBottomRightCorner = desk->corner(Qt::BottomRightCorner);
-
+
if ( layoutType == DOCKLAYOUT_LEFT_VLARGE ) {
desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
} else {
desk->setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
- desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
+ desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
}
}
// raising (eh, you work on SALOME isn't it?)
SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(this->getEngine());
if ( ! driver->_is_nil() ) {
- STDLOG("Associate the SComponent to the engine");
- aStudyBuilder->DefineComponentInstance(aFather, this->getEngine());
+ STDLOG("Associate the SComponent to the engine");
+ aStudyBuilder->DefineComponentInstance(aFather, this->getEngine());
}
}