Salome HOME
d8d1c417a238bac26a17596c3a36de34feaedb43
[modules/shaper.git] / src / ModuleBase / ModuleBase_Preferences.cpp
1 // Copyright (C) 2014-2021  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "ModuleBase_Preferences.h"
21 //#include "ModuleBase_Constants.h"
22
23 #include <Config_PropManager.h>
24
25 #include <TopAbs_ShapeEnum.hxx>
26
27 #include <SUIT_ResourceMgr.h>
28 #include <SUIT_PreferenceMgr.h>
29 #include <Qtx.h>
30
31 #include <QLayout>
32 #include <QApplication>
33 #include <QDialogButtonBox>
34 #include <QPushButton>
35
36 const QString ModuleBase_Preferences::VIEWER_SECTION = "Viewer";
37 const QString ModuleBase_Preferences::MENU_SECTION = "Menu";
38 const QString ModuleBase_Preferences::GENERAL_SECTION = "General";
39
40 SUIT_ResourceMgr* ModuleBase_Preferences::myResourceMgr = 0;
41
42 SUIT_ResourceMgr* ModuleBase_Preferences::resourceMgr()
43 {
44   if (!myResourceMgr) {
45     myResourceMgr = new SUIT_ResourceMgr("SHAPER");
46     myResourceMgr->setCurrentFormat("xml");
47   }
48   return myResourceMgr;
49 }
50
51 bool ModuleBase_Preferences::editPreferences(ModuleBase_Prefs& theModified)
52 {
53   ModuleBase_PreferencesDlg aDlg(resourceMgr(), QApplication::activeWindow());
54   aDlg.exec();
55   if (aDlg.isChanged()) {
56     aDlg.modified(theModified);
57     resourceMgr()->save();
58     return true;
59   }
60   return false;
61 }
62
63 void ModuleBase_Preferences::updateConfigByResources()
64 {
65   Config_Properties aProps = Config_PropManager::getProperties();
66   Config_Properties::iterator aIt;
67   for (aIt = aProps.begin(); aIt != aProps.end(); ++aIt) {
68     Config_Prop* aProp = (*aIt);
69     QString aVal = myResourceMgr->stringValue(QString(aProp->section().c_str()),
70                                               QString(aProp->name().c_str()));
71     if (!aVal.isEmpty()) {
72       aProp->setValue(aVal.toStdString());
73     }
74   }
75 }
76
77 void ModuleBase_Preferences::updateResourcesByConfig()
78 {
79   Config_Properties aProps = Config_PropManager::getProperties();
80   Config_Properties::iterator aIt;
81   for (aIt = aProps.begin(); aIt != aProps.end(); ++aIt) {
82     Config_Prop* aProp = (*aIt);
83     myResourceMgr->setValue(QString(aProp->section().c_str()), QString(aProp->name().c_str()),
84                             QString(aProp->value().c_str()));
85   }
86 }
87
88 void ModuleBase_Preferences::resetConfig()
89 {
90   Config_Properties aProps = Config_PropManager::getProperties();
91   Config_Properties::iterator aIt;
92   for (aIt = aProps.begin(); aIt != aProps.end(); ++aIt) {
93     Config_Prop* aProp = (*aIt);
94     aProp->setValue(aProp->defaultValue());
95   }
96 }
97
98 void ModuleBase_Preferences::loadCustomProps()
99 {
100   if(!myResourceMgr)
101     return;
102   QStringList aSections = myResourceMgr->sections();
103   foreach (QString aSection, aSections)
104   {
105     QStringList aParams = myResourceMgr->parameters(aSection);
106     foreach (QString aParam, aParams)
107     {
108       Config_Prop* aProp = Config_PropManager::registerProp(aSection.toStdString(),
109                                        aParam.toStdString(), "", Config_Prop::Disabled);
110       aProp->setValue(myResourceMgr->stringValue(aSection, aParam).toStdString());
111     }
112   }
113 }
114
115
116 void ModuleBase_Preferences::createEditContent(ModuleBase_IPrefMgr* thePref, int thePage)
117 {
118   thePref->prefMgr()->setItemIcon(thePage, QIcon(":pictures/module.png"));
119   createGeneralTab(thePref, thePage);
120   createCustomPage(thePref, thePage);
121   updateSketchTab(thePref, thePage);
122 }
123
124 void ModuleBase_Preferences::resetResourcePreferences(SUIT_PreferenceMgr* thePref)
125 {
126   if (!thePref)
127     return;
128
129   QtxResourceMgr::WorkingMode aPrev =
130     thePref->resourceMgr()->setWorkingMode(QtxResourceMgr::IgnoreUserValues);
131   thePref->retrieve();
132   thePref->resourceMgr()->setWorkingMode(aPrev);
133 }
134
135 void ModuleBase_Preferences::resetConfigPropPreferences(SUIT_PreferenceMgr* thePref)
136 {
137   resetConfig();
138   updateResourcesByConfig();
139
140   // retrieve the reset resource values to the preferences items
141   Config_Properties aProps = Config_PropManager::getProperties();
142   Config_Properties::iterator aIt;
143   QStringList aValues;
144   QStringList aSections;
145   for (aIt = aProps.begin(); aIt != aProps.end(); ++aIt) {
146     Config_Prop* aProp = (*aIt);
147     aValues.append(QString(aProp->name().c_str()));
148     if (!aSections.contains(aProp->section().c_str()))
149       aSections.append(aProp->section().c_str());
150     QtxPreferenceItem* anItem = thePref->findItem(QString(aProp->title().c_str()), true);
151     if (anItem)
152       anItem->retrieve();
153   }
154 }
155
156 void ModuleBase_Preferences::createGeneralTab(ModuleBase_IPrefMgr* thePref, int thePageId)
157 {
158   int generalTab = thePref->addPreference(QObject::tr("General"), thePageId,
159                                           SUIT_PreferenceMgr::Auto, QString(), QString());
160   thePref->setItemProperty("columns", 2, generalTab);
161
162   QStringList actItemList;
163   actItemList << QObject::tr("Last part")
164               << QObject::tr("All parts")
165               << QObject::tr("No activation");
166
167   QList<QVariant> actIdList;
168   actIdList << 0 << 1 << 2;
169
170   // Group related to opening a study
171   int group = thePref->addPreference(QObject::tr("Opening a study"), generalTab,
172                                      SUIT_PreferenceMgr::Auto, QString(), QString());
173
174   int actId = thePref->addPreference(QObject::tr("Activate"), group, SUIT_PreferenceMgr::Selector,
175                                      ModuleBase_Preferences::GENERAL_SECTION,
176                                      "part_activation_study");
177   thePref->setItemProperty("strings", actItemList, actId);
178   thePref->setItemProperty("indexes", actIdList, actId);
179
180   QStringList visuItemList;
181   visuItemList << QObject::tr("As stored in HDF")
182                << QObject::tr("Last item in each folder")
183                << QObject::tr("All items")
184                << QObject::tr("No visualization");
185
186   QList<QVariant> visuIdList;
187   visuIdList << 0 << 1 << 2 << 3;
188
189   int visuId = thePref->addPreference(QObject::tr("Display"), group, SUIT_PreferenceMgr::Selector,
190                                       ModuleBase_Preferences::GENERAL_SECTION,
191                                       "part_visualization_study");
192   thePref->setItemProperty("strings", visuItemList, visuId);
193   thePref->setItemProperty("indexes", visuIdList, visuId);
194
195   // Group related to running a python script
196   group = thePref->addPreference(QObject::tr("Launching a python script"), generalTab,
197                                  SUIT_PreferenceMgr::Auto, QString(), QString());
198
199   visuItemList.clear();
200   visuItemList << QObject::tr("Last item in each folder")
201                << QObject::tr("All items")
202                << QObject::tr("No visualization");
203
204   visuIdList.clear();
205   visuIdList << 0 << 1 << 2;
206
207   visuId = thePref->addPreference(QObject::tr("Display"), group, SUIT_PreferenceMgr::Selector,
208                                   ModuleBase_Preferences::GENERAL_SECTION,
209                                   "part_visualization_script");
210   thePref->setItemProperty("strings", visuItemList, visuId);
211   thePref->setItemProperty("indexes", visuIdList, visuId);
212 }
213
214 void ModuleBase_Preferences::updateSketchTab(ModuleBase_IPrefMgr* thePref, int thePageId)
215 {
216   int sketchTab   = thePref->addPreference(QObject::tr("Sketch"), thePageId,
217                              SUIT_PreferenceMgr::Auto, QString(), QString());
218   int allowChange = thePref->addPreference(
219                            QObject::tr("Allow automatic constraint substitution/remove"),
220                            sketchTab, SUIT_PreferenceMgr::GroupBox,
221                            "Sketch", "allow_change_constraint");
222   thePref->addPreference(QObject::tr("Notify automatic constraint substitution/remove"),
223            allowChange, SUIT_PreferenceMgr::Bool, "Sketch", "notify_change_constraint");
224 }
225
226 void ModuleBase_Preferences::createCustomPage(ModuleBase_IPrefMgr* thePref, int thePageId)
227 {
228   SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
229
230   // Make a Tab from each section
231   std::list<std::string> aSections = Config_PropManager::getSections();
232   std::list<std::string>::const_iterator it;
233   for (it = aSections.cbegin(); it != aSections.cend(); ++it) {
234     Config_Properties aProps = Config_PropManager::getProperties(*it);
235     int aTab = thePref->prefMgr()->addItem(QString((*it).c_str()), thePageId);
236     thePref->prefMgr()->setItemProperty("columns", 2, aTab);
237
238     Config_Properties::const_iterator aIt;
239     for (aIt = aProps.cbegin(); aIt != aProps.cend(); ++aIt) {
240       Config_Prop* aProp = (*aIt);
241       // check that the property is defined
242       QString aSection(aProp->section().c_str());
243       QString aName(aProp->name().c_str());
244       if (!aResMgr->hasValue(aSection, aName))
245         aResMgr->setValue(aSection, aName, QString(aProp->value().c_str()));
246
247       // Add item
248       if (aProp->type() != Config_Prop::Disabled) {
249         SUIT_PreferenceMgr::PrefItemType aPrefType = SUIT_PreferenceMgr::Auto;
250         switch (aProp->type()) {
251         case Config_Prop::Directory:
252           aPrefType = SUIT_PreferenceMgr::File;
253           break;
254         case Config_Prop::Cursor:
255           aPrefType = SUIT_PreferenceMgr::Selector;
256           break;
257         default:
258           aPrefType = (SUIT_PreferenceMgr::PrefItemType) aProp->type();
259         }
260
261         int anId = thePref->addPreference(QObject::tr(aProp->title().c_str()), aTab, aPrefType,
262                                           QString::fromStdString(aProp->section()),
263                                           QString::fromStdString(aProp->name()));
264
265         switch (aProp->type()) {
266         case Config_Prop::Directory:
267           thePref->setItemProperty("path_type", Qtx::PT_Directory, anId);
268           break;
269         case SUIT_PreferenceMgr::DblSpin:
270           if (aProp->min() != "") {
271             double aMin = QString(aProp->min().c_str()).toDouble();
272             thePref->setItemProperty("min", aMin, anId);
273           }
274           if (aProp->max() != "") {
275             double aMax = QString(aProp->max().c_str()).toDouble();
276             thePref->setItemProperty("max", aMax, anId);
277           }
278           break;
279         case SUIT_PreferenceMgr::IntSpin:
280           if (aProp->min() != "") {
281             int aMin = QString(aProp->min().c_str()).toInt();
282             thePref->setItemProperty("min", aMin, anId);
283           }
284           if (aProp->max() != "") {
285             int aMax = QString(aProp->max().c_str()).toInt();
286             thePref->setItemProperty("max", aMax, anId);
287           }
288           break;
289         case Config_Prop::Cursor:
290           {
291             QList<QVariant> aIndicesList;
292             QList<QVariant> aIconsList;
293             aIndicesList << 0 << 1 << 2;
294             aIconsList << QPixmap(":pictures/ArrowCursor.png") <<
295               QPixmap(":pictures/CrossCursor.png") <<
296               QPixmap(":pictures/HandCursor.png");
297
298             thePref->setItemProperty("indexes", aIndicesList, anId);
299             thePref->setItemProperty("icons", aIconsList, anId);
300           }
301           break;
302         default: // [to avoid compilation warnings]
303           break;
304         }
305       }
306     }
307   }
308 }
309
310 /**
311 * Implementation of preferences manager interface
312 */
313 class ModuleBase_PrefMgr: public ModuleBase_IPrefMgr
314 {
315 public:
316   /// Constructor
317   /// \param theMgr a preferences manager
318   ModuleBase_PrefMgr(ModuleBase_PreferencesMgr* theMgr):myMgr(theMgr) {}
319
320   virtual int addPreference(const QString& theLbl, int pId,
321                             SUIT_PreferenceMgr::PrefItemType theType,
322                             const QString& theSection, const QString& theName )
323   {
324     return myMgr->addItem(theLbl, pId, theType, theSection, theName);
325   }
326
327   virtual void setItemProperty( const QString& thePropName, const QVariant& theValue,
328                                const int theId = -1) {
329     myMgr->setItemProperty(thePropName, theValue, theId);
330   }
331
332   virtual SUIT_PreferenceMgr* prefMgr() const { return myMgr; }
333
334 private:
335   ModuleBase_PreferencesMgr* myMgr;
336 };
337
338 //**********************************************************
339 //**********************************************************
340 //**********************************************************
341 ModuleBase_PreferencesDlg::ModuleBase_PreferencesDlg(SUIT_ResourceMgr* theResurces,
342   QWidget* theParent)
343     : QDialog(theParent,
344       Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
345       myIsChanged(false)
346 {
347   setWindowTitle(tr("Edit preferences"));
348
349   QVBoxLayout* main = new QVBoxLayout(this);
350   main->setMargin(5);
351   main->setSpacing(5);
352
353   myPreferences = new ModuleBase_PreferencesMgr(theResurces, this);
354   main->addWidget(myPreferences);
355
356   setFocusProxy(myPreferences);
357   myPreferences->setFrameStyle(QFrame::Box | QFrame::Sunken);
358
359   QDialogButtonBox* aBtnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel |
360                                                    QDialogButtonBox::Reset,
361                                                    Qt::Horizontal, this);
362   QPushButton* aDefaultButton = aBtnBox->button(QDialogButtonBox::Reset);
363   aDefaultButton->setText(tr("Default"));
364   connect(aDefaultButton, SIGNAL(clicked()), this, SLOT(onDefault()));
365
366   main->addWidget(aBtnBox);
367   connect(aBtnBox, SIGNAL(accepted()), this, SLOT(accept()));
368   connect(aBtnBox, SIGNAL(rejected()), this, SLOT(reject()));
369   createEditors();
370
371   myPreferences->retrieve();
372 }
373
374 ModuleBase_PreferencesDlg::~ModuleBase_PreferencesDlg()
375 {
376 }
377
378 void ModuleBase_PreferencesDlg::createEditors()
379 {
380   int aPage = myPreferences->addItem(tr("Desktop"));
381   myPreferences->setItemIcon(aPage, QIcon(":pictures/view_prefs.png"));
382
383   createMenuPage(aPage);
384   createViewerPage(aPage);
385
386   aPage = myPreferences->addItem(tr("Module"));
387   myPreferences->setItemIcon(aPage, QIcon(":pictures/module.png"));
388
389   ModuleBase_PrefMgr aMgr(myPreferences);
390   ModuleBase_Preferences::createEditContent(&aMgr, aPage);
391 }
392
393 void ModuleBase_PreferencesDlg::createViewerPage(int thePageId)
394 {
395   int viewTab = myPreferences->addItem(tr("Viewer"), thePageId);
396
397   QStringList gradList;
398   gradList << tr("Horizontal gradient") << tr("Vertical gradient") << tr("First diagonal gradient")
399            << tr("Second diagonal gradient") << tr("First corner gradient")
400            << tr("Second corner gradient") << tr("Third corner gradient")
401            << tr("Fourth corner gradient");
402
403   QList<QVariant> idList;
404   for (int i = 0; i < gradList.size(); i++)
405     idList << i;
406
407   int bgGroup = myPreferences->addItem(tr("Background"), viewTab);
408
409   QString aImgFiles("Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)");
410
411   int bgId = myPreferences->addItem(tr("Viewer 3d"), bgGroup, SUIT_PreferenceMgr::Background,
412                                     ModuleBase_Preferences::VIEWER_SECTION, "background");
413   myPreferences->setItemProperty("gradient_names", gradList, bgId);
414   myPreferences->setItemProperty("gradient_ids", idList, bgId);
415   myPreferences->setItemProperty("texture_enabled", true, bgId);
416   myPreferences->setItemProperty("texture_center_enabled", true, bgId);
417   myPreferences->setItemProperty("texture_tile_enabled", true, bgId);
418   myPreferences->setItemProperty("texture_stretch_enabled", true, bgId);
419   myPreferences->setItemProperty("custom_enabled", false, bgId);
420   myPreferences->setItemProperty("image_formats", aImgFiles, bgId);
421
422   // Create other parameters group in viewer tab
423   int selectionGroup = myPreferences->addItem(tr("Default selection"), viewTab);
424   myPreferences->setItemProperty("columns", 3, selectionGroup);
425   myPreferences->addItem(tr("Faces"), selectionGroup,
426                          SUIT_PreferenceMgr::Bool,
427                          ModuleBase_Preferences::VIEWER_SECTION, "face-selection");
428   myPreferences->addItem(tr("Edges"), selectionGroup,
429                          SUIT_PreferenceMgr::Bool,
430                          ModuleBase_Preferences::VIEWER_SECTION, "edge-selection");
431   myPreferences->addItem(tr("Vertices"), selectionGroup,
432                          SUIT_PreferenceMgr::Bool,
433                          ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection");
434
435   int sensitivityGroup = myPreferences->addItem(tr("Selection sensitivity"), viewTab);
436   myPreferences->setItemProperty("columns", 2, sensitivityGroup);
437   myPreferences->addItem(tr("Vertex"), sensitivityGroup, SUIT_PreferenceMgr::DblSpin,
438                          ModuleBase_Preferences::VIEWER_SECTION, "point-selection-sensitivity");
439   myPreferences->addItem(tr("Edge"), sensitivityGroup, SUIT_PreferenceMgr::DblSpin,
440                          ModuleBase_Preferences::VIEWER_SECTION, "edge-selection-sensitivity");
441
442   int highlightGroup = myPreferences->addItem(tr("Additional highlighting"), viewTab);
443   myPreferences->setItemProperty("columns", 2, highlightGroup);
444   myPreferences->addItem(tr("In 3d mode"), highlightGroup,
445     SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "highlighting-3d");
446   myPreferences->addItem(tr("In 2d mode"), highlightGroup,
447     SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "highlighting-2d");
448
449   int colorScaleGroup = myPreferences->addItem(tr("Color scale"), viewTab);
450   myPreferences->setItemProperty("columns", 4, colorScaleGroup);
451   int aItem = myPreferences->addItem(tr("X position"), colorScaleGroup,
452     SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_x_position");
453   myPreferences->setItemProperty("min", 0, aItem);
454   myPreferences->setItemProperty("max", 1, aItem);
455
456   aItem = myPreferences->addItem(tr("Y position"), colorScaleGroup,
457     SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_y_position");
458   myPreferences->setItemProperty("min", 0, aItem);
459   myPreferences->setItemProperty("max", 1, aItem);
460
461   aItem = myPreferences->addItem(tr("Width"), colorScaleGroup,
462     SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_width");
463   myPreferences->setItemProperty("min", 0, aItem);
464   myPreferences->setItemProperty("max", 1, aItem);
465
466   aItem = myPreferences->addItem(tr("Height"), colorScaleGroup,
467     SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_height");
468   myPreferences->setItemProperty("min", 0, aItem);
469   myPreferences->setItemProperty("max", 1, aItem);
470
471   aItem = myPreferences->addItem(tr("Intervals number"), colorScaleGroup,
472     SUIT_PreferenceMgr::Integer, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_nb_intervals");
473   myPreferences->setItemProperty("min", 0, aItem);
474   myPreferences->setItemProperty("max", 100, aItem);
475
476   aItem = myPreferences->addItem(tr("Text height"), colorScaleGroup,
477     SUIT_PreferenceMgr::Integer, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_text_height");
478   myPreferences->setItemProperty("min", 0, aItem);
479   myPreferences->setItemProperty("max", 100, aItem);
480
481   aItem = myPreferences->addItem(tr("Text color"), colorScaleGroup,
482     SUIT_PreferenceMgr::Color, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_text_color");
483 }
484
485 void ModuleBase_PreferencesDlg::createMenuPage(int thePageId)
486 {
487   int aMenuTab = myPreferences->addItem(tr("Main menu"), thePageId);
488
489   int aSizeGroup = myPreferences->addItem(tr("Size"), aMenuTab);
490   myPreferences->setItemProperty("columns", 1, aSizeGroup);
491
492   int aRowsNb = myPreferences->addItem(tr("Number of rows"), aSizeGroup,
493                                        SUIT_PreferenceMgr::IntSpin,
494                                        ModuleBase_Preferences::MENU_SECTION,
495                                        "rows_number");
496   myPreferences->setItemProperty("min", 1, aRowsNb);
497   myPreferences->setItemProperty("max", 6, aRowsNb);
498
499   myPreferences->addItem(tr("Show Status Bar"), aSizeGroup,
500                          SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::MENU_SECTION,
501                          "status_bar");
502 }
503
504 void ModuleBase_PreferencesDlg::accept()
505 {
506   myPreferences->store();
507   myIsChanged = true;
508
509   // Save custom properties
510   ModuleBase_Preferences::updateConfigByResources();
511   QDialog::accept();
512 }
513
514 void ModuleBase_PreferencesDlg::modified(ModuleBase_Prefs& theModified) const
515 {
516   theModified = myPreferences->modified();
517 }
518
519 void ModuleBase_PreferencesDlg::onDefault()
520 {
521   // reset main resources. It throwns all resource manager items to the
522   // initial/default state. If there is no a default state of the item,
523   // it will be filled with an empty value. It concernerned to plugin
524   // config items, like visualization color. The main xml do not contains
525   // default values for them. So, it is important to reset the config
526   // properties after reseting the resources preferences.
527   ModuleBase_Preferences::resetResourcePreferences(myPreferences);
528   // reset plugin's resources. It fills the config resources with the default
529   // values, stores result in the resource manager and retrieve the preferences
530   // items with these values.
531   ModuleBase_Preferences::resetConfigPropPreferences(myPreferences);
532 }
533
534 void ModuleBase_PreferencesDlg::showEvent(QShowEvent* theEvent)
535 {
536   QDialog::showEvent(theEvent);
537   adjustSize();
538 }
539
540 //**********************************************************
541 //**********************************************************
542 //**********************************************************
543 void ModuleBase_PreferencesMgr::changedResources(const ResourceMap& theMap)
544 {
545   myModified.clear();
546   ResourceMap::ConstIterator it;
547   QString sec, param;
548   for (it = theMap.begin(); it != theMap.end(); ++it) {
549     ModuleBase_Pref aPref;
550     it.key()->resource(aPref.first, aPref.second);
551     myModified.append(aPref);
552   }
553 }