#include "STD_TabDesktop.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
+#include "LightApp_Preferences.h"
#include "QtxWorkstack.h"
#include "QtxActionMenuMgr.h"
* This is done to open protected methods from LightApp_Module class.
*/
+int SALOME_PYQT_Module::addGlobalPreference( const QString& label )
+{
+ LightApp_Preferences* pref = preferences();
+ if ( !pref )
+ return -1;
+
+ return pref->addPreference( label, -1 );
+}
+
int SALOME_PYQT_Module::addPreference( const QString& label )
{
return SalomeApp_Module::addPreference( label );
QIconSet loadIcon( const QString& fileName );
/* working with preferences : open protected methods */
+ int addGlobalPreference( const QString& );
int addPreference( const QString& );
int addPreference( const QString&, const int, const int = -1,
const QString& = QString::null,
return ProcessEvent( new TClearMenuEvent( id, menu, removeActions ) );
}
+/*!
+ SalomePyQt::addGlobalPreference
+ Adds global (not module) preferences group
+ */
+class TAddGlobalPrefEvent: public SALOME_Event {
+public:
+ typedef int TResult;
+ TResult myResult;
+ QString myLabel;
+ TAddGlobalPrefEvent( const QString& label )
+ : myResult( -1 ), myLabel( label ) {}
+ virtual void Execute() {
+ if ( SalomeApp_Application* anApp = getApplication() ) {
+ SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
+ if ( !module )
+ module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
+ if ( module )
+ myResult = module->addGlobalPreference( myLabel );
+ }
+ }
+};
+int SalomePyQt::addGlobalPreference( const QString& label )
+{
+ return ProcessEvent( new TAddGlobalPrefEvent( label ) );
+}
+
/*!
SalomePyQt::addPreference
Adds preference
static void removeSettings ( const QString& );
static QString getSetting ( const QString& );
+ static int addGlobalPreference( const QString& );
static int addPreference( const QString& );
static int addPreference( const QString&,
const int, const int = -1,
static void removeSettings ( const QString& );
static QString getSetting ( const QString& );
+ static int addGlobalPreference( const QString& );
static int addPreference( const QString& );
static int addPreference( const QString&, const int, int = -1,
const QString& = QString::null,
static void removeSettings ( const QString& ) /ReleaseGIL/ ;
static QString getSetting ( const QString& ) /ReleaseGIL/ ;
+ static int addGlobalPreference( const QString& ) /ReleaseGIL/ ;
static int addPreference( const QString& ) /ReleaseGIL/ ;
static int addPreference( const QString&,
const int, const int = -1,