-// Copyright (C) 2011-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2011-2021 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
#include "StandardApp_Module.hxx"
+#include "SALOME_GuiServices.hxx"
+
#include <SUIT_Desktop.h>
#include <SUIT_Study.h>
#include <SalomeApp_Application.h>
// share/salome/resources/xsalome/SalomeApp.xml in the install
// directory.
_defaultMenuId = this->createMenu( QCHARSTAR(moduleName()), -1, -1, 30 );
- _defaultToolbarId = this->createTool ( QCHARSTAR(moduleName()) );
+ _defaultToolbarId = this->createTool ( QCHARSTAR(moduleName()), moduleName() );
_actionId_internalCount = StandardApp_Module::ACTIONID_DEFAULT_INIT_VALUE;
//
}
// Creating the action
- QAction * action= this->createAction( effIdentifier, label, actionIcon,
- label, effToolTip, 0, getApp()->desktop(),
- false, slotobject, slotmember);
+ this->createAction( effIdentifier, label, actionIcon,
+ label, effToolTip, 0, getApp()->desktop(),
+ false, slotobject, slotmember);
return effIdentifier;
}
* Add the specified action as an item in the popup menu, with the
* specified visible rule. The default is "visible for object browser".
*/
-void StandardApp_Module::addActionInPopupMenu(int actionId,const QString& rule) {
+void StandardApp_Module::addActionInPopupMenu(int actionId,const QString& menus,const QString& rule) {
// _GBO_ for a fine customization of the rule (for example with a
// test on the type of the selected object), see the LIGTH module:
// implement "LightApp_Selection* createSelection() const;"
int parentId = -1;
QtxPopupMgr* mgr = this->popupMgr();
this->action( actionId )->setIconVisibleInMenu(true);
- mgr->insert ( this->action( actionId ), parentId, 0 );
+ if (! menus.isEmpty())
+ mgr->insert ( this->action( actionId ), menus, parentId, 0 );
+ else
+ mgr->insert ( this->action( actionId ), parentId, 0 );
mgr->setRule( this->action( actionId ), rule, QtxPopupMgr::VisibleRule );
}
{
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
setToolShown( true );
if ( this->createStudyComponentAtActivation() ) {
- this->createStudyComponent(theStudy);
+ this->createStudyComponent();
}
return bOk;
* the module. This component is associated to the engine (return by
* getEngine()) if the engine is a SALOMEDS::Driver.
*/
-void StandardApp_Module::createStudyComponent(SUIT_Study* theStudy) {
+void StandardApp_Module::createStudyComponent() {
- SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
- CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject);
- SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(theStudy->id());
+ SALOMEDS::Study_var aDSStudy = GUI::getStudyServant();
SALOMEDS::SComponent_var aFather = aDSStudy->FindComponent(QCHARSTAR(moduleName()));
if (aFather->_is_nil())