X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Preferences.h;h=a6fbc8a2b2faa2675bb944ff7506e5b531b43745;hb=b5e6786b95d33825a3d1537d5453492e774d6399;hp=bd30a31a581b0558d2fcf22b7eb22c362203e0f4;hpb=e8f6a194e38ff95708bf0984081d9f4e7d9ab115;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Preferences.h b/src/XGUI/XGUI_Preferences.h index bd30a31a5..a6fbc8a2b 100644 --- a/src/XGUI/XGUI_Preferences.h +++ b/src/XGUI/XGUI_Preferences.h @@ -6,8 +6,8 @@ #define XGUI_Preferences_H #include "XGUI.h" +#include "XGUI_IPrefMgr.h" -#include #include #include @@ -18,20 +18,36 @@ class QWidget; typedef QPair XGUI_Pref; typedef QList XGUI_Prefs; - //*********************************************************************** /// Class for manipulation with preferences in the application class XGUI_EXPORT XGUI_Preferences { -public: + public: static const QString VIEWER_SECTION; static const QString MENU_SECTION; static bool editPreferences(XGUI_Prefs& theModified); + /// Returns currently installed resource manager static SUIT_ResourceMgr* resourceMgr(); + /// Sets a resource manager + /// It is used in case of necessity to define external resource manager (not NewGeom) + static void setResourceMgr(SUIT_ResourceMgr* theMgr) { myResourceMgr = theMgr; } + + /// Updates properties defined by module from SUIT_ResourceMgr to Config_PropManager + static void updateCustomProps(); + + /// Loads properties defined by module to Config_PropManager + static void loadCustomProps(); + + /// + static void createEditContent(XGUI_IPrefMgr* thePref, int thePage); + private: + /// Creates content of preferences editing widget + static void createCustomPage(XGUI_IPrefMgr* thePref, int thePageId); + static SUIT_ResourceMgr* myResourceMgr; }; @@ -39,48 +55,60 @@ private: /// Manager of preferences class XGUI_EXPORT XGUI_PreferencesMgr : public SUIT_PreferenceMgr { - Q_OBJECT -public: +Q_OBJECT + public: XGUI_PreferencesMgr(QtxResourceMgr* theResource, QWidget* theParent) - :SUIT_PreferenceMgr(theResource, theParent) {} + : SUIT_PreferenceMgr(theResource, theParent) + { + } - virtual ~XGUI_PreferencesMgr() {} + virtual ~XGUI_PreferencesMgr() + { + } - XGUI_Prefs modified() const { return myModified; } + XGUI_Prefs modified() const + { + return myModified; + } -protected: - virtual void changedResources( const ResourceMap& theMap); + protected: + virtual void changedResources(const ResourceMap& theMap); -private: + private: XGUI_Prefs myModified; }; - //*********************************************************************** /// Dialog box for preferences editing -class XGUI_EXPORT XGUI_PreferencesDlg: public QDialog +class XGUI_EXPORT XGUI_PreferencesDlg : public QDialog { - Q_OBJECT -public: +Q_OBJECT + public: XGUI_PreferencesDlg(SUIT_ResourceMgr* theResurces, QWidget* theParent = 0); virtual ~XGUI_PreferencesDlg(); - bool isChanged() const { return myIsChanged; } + bool isChanged() const + { + return myIsChanged; + } void modified(XGUI_Prefs& theModified) const; -public slots: + public slots: virtual void accept(); -private: - void createEditors(); - void createViewerPage(int thePageId); - void createMenuPage(int thePageId); - void createCustomPage(int thePageId, Config_Properties& theProps); - + private: + /// Create editors for aplication properties + void createEditors(); + + /// Create a viewer page in dialog box + void createViewerPage(int thePageId); + + /// Create menu properties page in the dialog box + void createMenuPage(int thePageId); + XGUI_PreferencesMgr* myPreferences; bool myIsChanged; }; - -#endif \ No newline at end of file +#endif