Salome HOME
Provide preferences in Salome mode
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 10 Sep 2014 08:46:12 +0000 (12:46 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 10 Sep 2014 08:46:12 +0000 (12:46 +0400)
12 files changed:
build_Salome740_deb.bat [new file with mode: 0644]
build_Salome740_rel.bat [new file with mode: 0644]
env_Salome.bat [new file with mode: 0644]
salomeRun.bat
src/NewGeom/CMakeLists.txt
src/NewGeom/NewGeom_Module.cpp
src/NewGeom/NewGeom_Module.h
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/XGUI/CMakeLists.txt
src/XGUI/XGUI_IPrefMgr.h [new file with mode: 0644]
src/XGUI/XGUI_Preferences.cpp
src/XGUI/XGUI_Preferences.h

diff --git a/build_Salome740_deb.bat b/build_Salome740_deb.bat
new file mode 100644 (file)
index 0000000..130599b
--- /dev/null
@@ -0,0 +1,19 @@
+@ECHO OFF
+
+REM Find absolute path to ROOT_DIR 
+@SET PARENT_DIR=%~dp0..
+@SET ROOT_DIR=
+pushd %PARENT_DIR%
+@SET ROOT_DIR=%CD%
+popd
+
+@SET SRC_DIR=%ROOT_DIR%\sources
+@SET OCC_LIB_PREFIX=d
+
+call %SRC_DIR%\env_Salome.bat d
+mkdir %ROOT_DIR%\build
+cd %ROOT_DIR%\build
+
+cmake %SRC_DIR% -G "Visual Studio 10" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
+
+start "" %MSVC_EXE% NewGEOM.sln
diff --git a/build_Salome740_rel.bat b/build_Salome740_rel.bat
new file mode 100644 (file)
index 0000000..26fbe15
--- /dev/null
@@ -0,0 +1,18 @@
+@ECHO OFF
+
+REM Find absolute path to ROOT_DIR 
+@SET PARENT_DIR=%~dp0..
+@SET ROOT_DIR=
+pushd %PARENT_DIR%
+@SET ROOT_DIR=%CD%
+popd
+
+@SET SRC_DIR=%ROOT_DIR%\sources
+
+call %SRC_DIR%\env_Salome.bat
+mkdir %ROOT_DIR%\build
+cd %ROOT_DIR%\build
+
+cmake %SRC_DIR% -G "Visual Studio 10" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
+
+start "" %MSVC_EXE% NewGEOM.sln
diff --git a/env_Salome.bat b/env_Salome.bat
new file mode 100644 (file)
index 0000000..fafb466
--- /dev/null
@@ -0,0 +1,93 @@
+@echo off
+
+IF NOT EXIST "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" GOTO ERROR1
+
+@REM Load local settings from file localenv.bat that should be located in the root directory
+if "%ROOT_DIR%" == "" (
+  set ROOT_DIR=%~dp0..
+)
+
+if exist "%ROOT_DIR%\localenv.bat" (
+  echo Setting local environment from %ROOT_DIR%\localenv.bat
+  call "%ROOT_DIR%\localenv.bat"
+) else (
+  echo Warning: file %ROOT_DIR%\localenv.bat does not exist; using default environment
+)
+
+if "%SALOME_ROOT_DIR%" == "" (
+  set SALOME_ROOT_DIR=%ROOT_DIR%\SALOME
+)
+
+if "%SOLVESPACE_ROOT_DIR%" == "" (
+  SET SOLVESPACE_ROOT_DIR=%ROOT_DIR%\products\solvespace-2.0
+  SET PATH=%SOLVESPACE_ROOT_DIR%\lib;"%PATH%"
+)
+
+cd %SALOME_ROOT_DIR%\WORK
+call set_env.bat %1
+call "%PDIR%\env_compile.bat"
+cd %ROOT_DIR%
+
+@REM -------------------------
+@REM Python
+@SET PYTHON_LIB_DIR=%PYTHON_ROOT_DIR%\libs
+@SET PYTHON_INC_DIR=%PYTHON_ROOT_DIR%\include
+@REM -------------------------
+
+@REM -------------------------
+@REM CASCADE
+@SET PATH=%CASROOT%;%CASROOT%\win32\bin%OCC_LIB_PREFIX%;%PATH%
+@SET LIB=%CASROOT%\win32\lib%OCC_LIB_PREFIX%;%LIB%
+@set CSF_MDTVFontDirectory=%CASROOT%\src\FontMFT
+@set CSF_LANGUAGE=us
+@set MMGT_CLEAR=1
+@set CSF_EXCEPTION_PROMPT=1
+@set CSF_SHMessage=%CASROOT%\src\SHMessage
+@set CSF_MDTVTexturesDirectory=%CASROOT%\src\Textures
+@set CSF_XSMessage=%CASROOT%\src\XSMessage
+@set CSF_StandardDefaults=%CASROOT%\src\StdResource
+@set CSF_PluginDefaults=%CASROOT%\src\StdResource
+@set CSF_XCAFDefaults=%CASROOT%\src\StdResource
+@set CSF_StandardLiteDefaults=%CASROOT%\src\StdResource
+@set CSF_UnitsLexicon=%CASROOT%\src\UnitsAPI\Lexi_Expr.dat
+@set CSF_UnitsDefinition=%CASROOT%\src\UnitsAPI\Units.dat
+@set CSF_IGESDefaults=%CASROOT%\src\XSTEPResource
+@set CSF_STEPDefaults=%CASROOT%\src\XSTEPResource
+@set CSF_XmlOcafResource=%CASROOT%\src\XmlOcafResource
+@REM -------------------------
+
+@REM -------------------------
+@REM Create launch path
+rem @SET PATH=%LIBXML2_ROOT_DIR%\bin;%PATH%
+rem @SET PATH=%PDIR%\tbb\bin;%PATH%
+rem @SET PATH=%PDIR%\freeimage-3.15.4\bin;%PATH%
+rem @SET PATH=%PDIR%\ftgl-2.1.3\bin;%PATH%
+rem @SET PATH=%PDIR%\freetype-2.4.11\bin;%PATH%
+rem @SET PATH=%PDIR%\gl2ps-1.3.8\bin;%PATH%
+rem @SET PATH=%PDIR%\qwt-5.2.1\lib;%PATH%
+rem @SET PATH=%SOLVESPACE_ROOT_DIR%\lib;%PATH%
+@REM -------------------------
+
+@REM -------------------------
+@SET PYTHONHOME=%PYTHON_ROOT_DIR%
+@SET PYTHON_INCLUDE=%PYTHONHOME%\include
+@REM -------------------------
+
+
+IF "%ARCH%" == "Win64" (
+  call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" x64
+) ELSE (
+  IF "%ARCH%" == "Win32" (
+    call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" x86
+  ) ELSE (
+    echo Wrong architecture is used. Win32 or Win64 architecture is allowed only.
+    echo Refer to the set_env.bat script.
+  )
+)
+
+@SET NEW_GEOM_CONFIG_FILE=%ROOT_DIR%\install\plugins
+@SET PATH=%ROOT_DIR%\install\plugins;%ROOT_DIR%\install\bin;%PATH%
+@SET PYTHONPATH=%ROOT_DIR%\install\swig;%PYTHONPATH%
+
+@SET LightAppConfig=%ROOT_DIR%\install\share\salome\resources\newgeom;%GUI_ROOT_DIR%\share\salome\resources\gui
+@SET NewGeomResources=%ROOT_DIR%\install\resources
index a68091b43421c35b46a86d594072ffd3541f490e..a2fa7d3dd0f78fb47a8a02135df7c9568af768db 100644 (file)
@@ -1,30 +1,5 @@
 @ECHO OFF
 
-REM Find absolute path to ROOT_DIR 
-@SET PARENT_DIR=%~dp0..
-@SET ROOT_DIR=
-pushd %PARENT_DIR%
-@SET ROOT_DIR=%CD%
-popd
+call env_Salome.bat
 
-@SET SRC_DIR=%ROOT_DIR%\sources
-@SET OCC_LIB_PREFIX=d
-
-@SET SALOME_ROOT_DIR=%ROOT_DIR%\SALOME-7.3.0-WIN32
-@SET SOLVESPACE_ROOT_DIR=%ROOT_DIR%\products\solvespace-2.0
-@SET NEWGEOM_ROOT_DIR=%ROOT_DIR%\install
-@SET PATH=%SALOME_ROOT_DIR%;%PATH%
-
-
-call %SALOME_ROOT_DIR%\env_launch.bat
-rem Unfortunately in "env_launch.bat" only KERNEL is added as a module, so add GUI manually
-call %SALOME_ROOT_DIR%\set_one_module_env.bat GUI
-
-@SET PATH=%SOLVESPACE_ROOT_DIR%\lib;%PATH%
-@SET NEW_GEOM_CONFIG_FILE=%ROOT_DIR%\install\plugins
-@SET PATH=%PATH%;%NEWGEOM_ROOT_DIR%\bin;%NEWGEOM_ROOT_DIR%\plugins
-
-@SET LightAppConfig=%ROOT_DIR%\install\share\salome\resources\newgeom;%SALOME_ROOT_DIR%\MODULES\GUI\share\salome\resources\gui
-
-
-SuitApp.exe LightApp -style salome --modules=NewGeom --uselicense --noexcepthandling
+SuitApp.exe LightApp --modules=NewGeom
index e0d4ba7305ffb0fc727ce28c012e9279dddf1b0d..9fc3e6b6afe27bc654cf72c14a2c8e45efda5d2f 100644 (file)
@@ -44,6 +44,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/XGUI
                                        ${PROJECT_SOURCE_DIR}/src/Events
                                        ${PROJECT_SOURCE_DIR}/src/ModuleBase
                     ${PROJECT_SOURCE_DIR}/src/ModelAPI
+                    ${PROJECT_SOURCE_DIR}/src/Config
                                        ${SALOME_GUI_INCLUDE}
                                        ${SALOME_KERNEL_INCLUDE}
                     ${CAS_INCLUDE_DIRS}
index a4caf653cb0924c3dc0ebfff2e4c2802ca0f393d..dd97f0fc5a69b683b31d06d5a1c88e207fc7bf08 100644 (file)
@@ -6,6 +6,7 @@
 #include <XGUI_Workshop.h>
 #include <XGUI_PropertyPanel.h>
 #include <XGUI_ContextMenuMgr.h>
+#include <XGUI_Preferences.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SUIT_Selector.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ViewManager.h>
+#include <SUIT_ResourceMgr.h>
 
 #include <QtxPopupMgr.h>
 #include <QtxActionMenuMgr.h>
+#include <QtxResourceMgr.h>
+
+#include <Config_PropManager.h>
 
 #include <QDockWidget>
 #include <QAction>
@@ -34,6 +39,28 @@ NewGeom_EXPORT char* getModuleVersion()
 }
 }
 
+class NewGeom_PrefMgr: public XGUI_IPrefMgr
+{
+public:
+  NewGeom_PrefMgr(LightApp_Preferences* theMgr, const QString& theModName):myMgr(theMgr), myModName(theModName) {}
+
+  virtual int addPreference(const QString& theLbl, int pId, 
+                            SUIT_PreferenceMgr::PrefItemType theType,
+                            const QString& theSection, const QString& theName )
+  {
+    return myMgr->addPreference(myModName, theLbl, pId, theType, theSection, theName);
+  }
+
+  virtual SUIT_PreferenceMgr* prefMgr() const { return myMgr; }
+
+private:
+  LightApp_Preferences* myMgr;
+  QString myModName;
+};
+
+
+
+
 //******************************************************
 NewGeom_Module::NewGeom_Module()
     : LightApp_Module("NewGeom"),
@@ -41,6 +68,9 @@ NewGeom_Module::NewGeom_Module()
 {
   myWorkshop = new XGUI_Workshop(this);
   myProxyViewer = new NewGeom_SalomeViewer(this);
+
+  XGUI_Preferences::setResourceMgr(application()->resourceMgr());
+  XGUI_Preferences::loadCustomProps();
 }
 
 //******************************************************
@@ -145,7 +175,7 @@ QAction* NewGeom_Module::addFeature(const QString& theWBName, const QString& the
   myActionsList.append(theId);
   SUIT_Desktop* aDesk = application()->desktop();
   int aKeys = 0;
-  for (int i = 0; i < theKeys.count(); i++)
+  for (unsigned int i = 0; i < theKeys.count(); i++)
     aKeys += theKeys[i];
   QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
                                   isCheckable);
@@ -166,7 +196,7 @@ QAction* NewGeom_Module::addEditCommand(const QString& theId, const QString& the
   myActionsList.append(theId);
   SUIT_Desktop* aDesk = application()->desktop();
   int aKeys = 0;
-  for (int i = 0; i < theKeys.count(); i++)
+  for (unsigned int i = 0; i < theKeys.count(); i++)
     aKeys += theKeys[i];
   QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
                                   isCheckable);
@@ -249,3 +279,28 @@ void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu,
   myWorkshop->contextMenuMgr()->addViewerItems(theMenu);
   LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
 }
+
+
+//******************************************************
+void NewGeom_Module::createPreferences()
+{
+  XGUI_Preferences::updateCustomProps();
+  LightApp_Preferences* pref = preferences();
+  int catId = pref->addPreference( moduleName(), -1 );
+  if ( catId == -1 )
+    return;
+  NewGeom_PrefMgr aMgr(pref, moduleName());
+  XGUI_Preferences::createEditContent(&aMgr, catId);
+  pref->retrieve();
+}
+
+//******************************************************
+void NewGeom_Module::preferencesChanged(const QString& theSection, const QString& theParam)
+{
+  SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
+  QString aVal = aResMgr->stringValue(theSection, theParam);
+  if (!aVal.isNull()) {
+    Config_Prop* aProp = Config_PropManager::findProp(theSection.toStdString(), theParam.toStdString());
+    aProp->setValue(aVal.toStdString());
+  }
+}
index d300655a3c87aca98897a54e11433530ecde9eb7..b4b52e626cfa316c76631b6687e86a5e1b74c6f5 100644 (file)
@@ -72,6 +72,9 @@ Q_OBJECT
 
   virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
 
+  virtual void createPreferences();
+  virtual void preferencesChanged(const QString& theSection, const QString& theParam);
+
  public slots:
   virtual bool activateModule(SUIT_Study* theStudy);
   virtual bool deactivateModule(SUIT_Study* theStudy);
index 5342bf832b68bdecfff05747602d976b0cee614a..fdf230c58769d026c21e81f79b3e94572be3313e 100644 (file)
@@ -133,7 +133,7 @@ void addPlane(double theX, double theY, double theZ,
 {
   boost::shared_ptr<GeomAPI_Pnt> anOrigin(new GeomAPI_Pnt(0, 0, 0));
   boost::shared_ptr<GeomAPI_Dir> aNormal(new GeomAPI_Dir(theX, theY, theZ));
-  double aSize = Config_PropManager::integer("Sketch definition", "Size of planes", PLANE_SIZE);
+  double aSize = Config_PropManager::integer("Sketch planes", "Size of planes", PLANE_SIZE);
   boost::shared_ptr<GeomAPI_Shape> aFace = GeomAlgoAPI_FaceBuilder::square(anOrigin, aNormal,
                                                                            aSize);
   theShapes.push_back(aFace);
@@ -156,11 +156,11 @@ AISObjectPtr SketchPlugin_Sketch::getAISObject(AISObjectPtr thePrevious)
       aAIS = AISObjectPtr(new GeomAPI_AISObject());
       aAIS->createShape(aCompound);
 
-      std::vector<int> aRGB = Config_PropManager::color("Sketch definition", "planes_color",
+      std::vector<int> aRGB = Config_PropManager::color("Sketch planes", "planes_color",
       SKETCH_PLANE_COLOR);
       aAIS->setColor(aRGB[0], aRGB[1], aRGB[2]);
 
-      aAIS->setWidth(Config_PropManager::integer("Sketch definition", "planes_thikness",
+      aAIS->setWidth(Config_PropManager::integer("Sketch planes", "planes_thikness",
       SKETCH_WIDTH));
     }
     return aAIS;
index 8c338271acb04d6e41268d22c310fa90d75ceac0..9f336606eb0df5e543770b831ba71aa74ee5f99e 100644 (file)
@@ -32,6 +32,7 @@ SET(PROJECT_HEADERS
     XGUI_ModuleConnector.h
        XGUI_Selection.h
        XGUI_Preferences.h
+       XGUI_IPrefMgr.h
 )
 
 SET(PROJECT_AUTOMOC 
diff --git a/src/XGUI/XGUI_IPrefMgr.h b/src/XGUI/XGUI_IPrefMgr.h
new file mode 100644 (file)
index 0000000..1a4f848
--- /dev/null
@@ -0,0 +1,22 @@
+// File:        XGUI_IPrefMgr.h
+// Created:     10 Sept 2014
+// Author:      Vitaly SMETANNIKOV
+
+
+#ifndef XGUI_IPrefMgr_H
+#define XGUI_IPrefMgr_H
+
+#include <QString>
+#include <SUIT_PreferenceMgr.h>
+
+class XGUI_IPrefMgr
+{
+public:
+  virtual int addPreference(const QString& theLbl, int pId, 
+                            SUIT_PreferenceMgr::PrefItemType theType,
+                            const QString& theSection, const QString& theName ) = 0;
+
+  virtual SUIT_PreferenceMgr* prefMgr() const = 0;
+};
+
+#endif
\ No newline at end of file
index 81fae93d0a9776fdfc6188f7fc911eee78b329d9..81e0282ee7922bd0ac86aeb672517cf4e1abf85d 100644 (file)
@@ -5,6 +5,8 @@
 #include "XGUI_Preferences.h"
 #include "XGUI_Constants.h"
 
+#include <Config_PropManager.h>
+
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_PreferenceMgr.h>
 
@@ -47,7 +49,7 @@ void XGUI_Preferences::updateCustomProps()
     QString aVal = myResourceMgr->stringValue(QString(aProp->section().c_str()),
                                               QString(aProp->name().c_str()));
     if (!aVal.isNull())
-      aProp->setValue(qPrintable(aVal));
+      aProp->setValue(aVal.toStdString());
   }
 }
 
@@ -61,13 +63,74 @@ void XGUI_Preferences::loadCustomProps()
     QStringList aParams = myResourceMgr->parameters(aSection);
     foreach (QString aParam, aParams)
     {
-      Config_PropManager::registerProp(qPrintable(aSection), qPrintable(aParam), "",
+      Config_PropManager::registerProp(aSection.toStdString(), aParam.toStdString(), "",
                                        Config_Prop::Disabled,
-                                       qPrintable(myResourceMgr->stringValue(aSection, aParam)));
+                                       myResourceMgr->stringValue(aSection, aParam).toStdString());
+    }
+  }
+}
+
+
+void XGUI_Preferences::createEditContent(XGUI_IPrefMgr* thePref, int thePage)
+{
+  thePref->prefMgr()->setItemIcon(thePage, QIcon(":pictures/module.png"));
+  createCustomPage(thePref, thePage);
+}
+
+
+void XGUI_Preferences::createCustomPage(XGUI_IPrefMgr* thePref, int thePageId)
+{
+  SUIT_ResourceMgr* aResMgr = XGUI_Preferences::resourceMgr();
+  bool isResModified = false;
+
+  // Make a Tab from each section
+  std::list<std::string> aSections = Config_PropManager::getSections();
+  std::list<std::string>::const_iterator it;
+  for (it = aSections.cbegin(); it != aSections.cend(); ++it) {
+    Config_Properties aProps = Config_PropManager::getProperties(*it);
+    int aTab = thePref->prefMgr()->addItem(QString((*it).c_str()), thePageId);
+    thePref->prefMgr()->setItemProperty("columns", 2, aTab);
+
+    Config_Properties::const_iterator aIt;
+    for (aIt = aProps.cbegin(); aIt != aProps.cend(); ++aIt) {
+      Config_Prop* aProp = (*aIt);
+      // check that the property is defined
+      QString aSection(aProp->section().c_str());
+      QString aName(aProp->name().c_str());
+      if (!aResMgr->hasValue(aSection, aName)) {
+        aResMgr->setValue(aSection, aName, QString(aProp->value().c_str()));
+        isResModified = true;
+      }
+      // Add item
+      if (aProp->type() != Config_Prop::Disabled)
+        thePref->addPreference(QObject::tr(aProp->title().c_str()), aTab,
+                               (SUIT_PreferenceMgr::PrefItemType) aProp->type(),
+                               QString(aProp->section().c_str()), QString(aProp->name().c_str()));
     }
   }
 }
 
+//**********************************************************
+//**********************************************************
+//**********************************************************
+class XGUI_PrefMgr: public XGUI_IPrefMgr
+{
+public:
+  XGUI_PrefMgr(XGUI_PreferencesMgr* theMgr):myMgr(theMgr) {}
+
+  virtual int addPreference(const QString& theLbl, int pId, 
+                            SUIT_PreferenceMgr::PrefItemType theType,
+                            const QString& theSection, const QString& theName )
+  {
+    return myMgr->addItem(theLbl, pId, theType, theSection, theName);
+  }
+
+  virtual SUIT_PreferenceMgr* prefMgr() const { return myMgr; }
+
+private:
+  XGUI_PreferencesMgr* myMgr;
+};
+
 //**********************************************************
 //**********************************************************
 //**********************************************************
@@ -112,7 +175,9 @@ void XGUI_PreferencesDlg::createEditors()
 
   aPage = myPreferences->addItem(tr("Module"));
   myPreferences->setItemIcon(aPage, QIcon(":pictures/module.png"));
-  createCustomPage(aPage);
+
+  XGUI_PrefMgr aMgr(myPreferences);
+  XGUI_Preferences::createEditContent(&aMgr, aPage);
 }
 
 void XGUI_PreferencesDlg::createViewerPage(int thePageId)
@@ -159,38 +224,6 @@ void XGUI_PreferencesDlg::createMenuPage(int thePageId)
   myPreferences->setItemProperty("max", 6, aRowsNb);
 }
 
-void XGUI_PreferencesDlg::createCustomPage(int thePageId)
-{
-  SUIT_ResourceMgr* aResMgr = XGUI_Preferences::resourceMgr();
-  bool isResModified = false;
-
-  // Make a Tab from each section
-  std::list<std::string> aSections = Config_PropManager::getSections();
-  std::list<std::string>::const_iterator it;
-  for (it = aSections.cbegin(); it != aSections.cend(); ++it) {
-    Config_Properties aProps = Config_PropManager::getProperties(*it);
-    int aTab = myPreferences->addItem(QString((*it).c_str()), thePageId);
-    myPreferences->setItemProperty("columns", 2, aTab);
-
-    Config_Properties::const_iterator aIt;
-    for (aIt = aProps.cbegin(); aIt != aProps.cend(); ++aIt) {
-      Config_Prop* aProp = (*aIt);
-      // check that the property is defined
-      QString aSection(aProp->section().c_str());
-      QString aName(aProp->name().c_str());
-      if (!aResMgr->hasValue(aSection, aName)) {
-        aResMgr->setValue(aSection, aName, QString(aProp->value().c_str()));
-        isResModified = true;
-      }
-      // Add item
-      if (aProp->type() != Config_Prop::Disabled)
-        myPreferences->addItem(tr(aProp->title().c_str()), aTab,
-                               (SUIT_PreferenceMgr::PrefItemType) aProp->type(),
-                               QString(aProp->section().c_str()), QString(aProp->name().c_str()));
-    }
-  }
-}
-
 void XGUI_PreferencesDlg::accept()
 {
   myPreferences->store();
index 7307de3ef4b034319ae1356f115537163da9a85b..2493414bfe5104ace938431342c2c11225ff34f2 100644 (file)
@@ -6,8 +6,8 @@
 #define XGUI_Preferences_H
 
 #include "XGUI.h"
+#include "XGUI_IPrefMgr.h"
 
-#include <Config_PropManager.h>
 #include <SUIT_PreferenceMgr.h>
 #include <QDialog>
 
@@ -28,13 +28,26 @@ class XGUI_EXPORT XGUI_Preferences
 
   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();
 
- private:
+  /// 
+  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;
 };
 
@@ -88,7 +101,7 @@ Q_OBJECT
   void createEditors();
   void createViewerPage(int thePageId);
   void createMenuPage(int thePageId);
-  void createCustomPage(int thePageId);
+  //void createCustomPage(int thePageId);
 
   void updateCustomProps();