return isCompatible;
}
+QList<QAction*> LightApp_Module::displayActions() const
+{
+ QList<QAction*> res;
+ if ( action( myDisplay ) ) res << action( myDisplay );
+ if ( action( myErase ) ) res << action( myErase );
+ if ( action( myDisplayOnly ) ) res << action( myDisplayOnly );
+ if ( action( myEraseAll ) ) res << action( myEraseAll );
+ return res;
+}
+
/*!Activate module.*/
bool LightApp_Module::activateModule( SUIT_Study* study )
{
#include "LightApp_Preferences.h"
#include <CAM_Module.h>
+#include <QList>
+
class LightApp_Application;
class LightApp_Selection;
class LightApp_Operation;
class QtxPopupMgr;
+class QAction;
class QString;
class QVariant;
virtual LightApp_Displayer* displayer();
virtual LightApp_Selection* createSelection() const;
+
+ QList<QAction*> displayActions() const;
public slots:
virtual bool activateModule( SUIT_Study* );
#include <LightApp_SelectionMgr.h>
#include <LightApp_NameDlg.h>
#include <LightApp_DataOwner.h>
+#include <LightApp_Module.h>
#include <CAM_Module.h>
// "Activate module" item should appear only if it's necessary
if (aList.Extent() != 1)
return;
+
Handle(SALOME_InteractiveObject) aIObj = aList.First();
+
// check if item is a "GUI state" item (also a first level object)
QString entry( aIObj->getEntry() );
if ( entry.startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) )
return;
+
QString aModuleName(aIObj->getComponentDataType());
QString aModuleTitle = moduleTitle(aModuleName);
CAM_Module* currentModule = activeModule();
+
+ // check if it a "Notebook" item
+ if ( aModuleName == "NOTEBOOK" ) {
+ if ( currentModule ) {
+ LightApp_Module* lightModule = dynamic_cast<LightApp_Module*>( currentModule );
+ if ( lightModule ) {
+ QList<QAction*> displayActions = lightModule->displayActions();
+ QAction* a;
+ foreach( a, displayActions ) thePopup->removeAction( a );
+ }
+ }
+ thePopup->insertSeparator( thePopup->actions()[0] );
+ QAction* nbAction = new QAction( tr( "MEN_SHOW_NOTEBOOK" ), thePopup );
+ connect( nbAction, SIGNAL( activated() ), this, SLOT( onNoteBook() ) );
+ thePopup->insertAction( thePopup->actions()[0], nbAction );
+ }
+
if (currentModule && currentModule->moduleName() == aModuleTitle)
return;
if ( !aModuleTitle.isEmpty() )
{
LightApp_Application::onStudyCreated( study );
+ updateObjectBrowser( true );
+
objectBrowserColumnsVisibility();
}
{
LightApp_Application::onStudyOpened( study );
+ updateObjectBrowser( true );
+
objectBrowserColumnsVisibility();
// temporary commented