Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / salomegui / Yacsgui_Resource.cxx
1 // Copyright (C) 2006-2012  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.
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 "Yacsgui_Resource.hxx"
21 #include "Resource.hxx"
22 #include "Yacsgui.hxx"
23 #include <SUIT_ResourceMgr.h>
24
25 //#define _DEVDEBUG_
26 #include "YacsTrace.hxx"
27
28 #define RESOURCE_YACS "YACS"
29
30 using namespace YACS::HMI;
31
32 Yacsgui_Resource::Yacsgui_Resource(SUIT_ResourceMgr* r)
33 {
34   DEBTRACE("Yacsgui_Resource::Yacsgui_Resource");
35   _resource = r;
36 }
37
38 // Get resources
39 // -------------
40
41 int Yacsgui_Resource::integerValue(const QString& name, const int def) const {
42   return _resource->integerValue(RESOURCE_YACS, name, def);
43 }
44
45 double Yacsgui_Resource::doubleValue(const QString& name, const double def) const {
46   return _resource->doubleValue(RESOURCE_YACS, name, def);
47 }
48
49 bool Yacsgui_Resource::booleanValue(const QString& name, const bool def) const {
50   return _resource->booleanValue(RESOURCE_YACS, name, def);
51 }
52
53 QFont Yacsgui_Resource::fontValue(const QString& name, const QFont def) const {
54   return _resource->fontValue(RESOURCE_YACS, name, def);
55 }
56
57 QColor Yacsgui_Resource::colorValue(const QString& name, const QColor def) const {
58   return _resource->colorValue(RESOURCE_YACS, name, def);
59 }
60
61 QColor Yacsgui_Resource::colorValue(const QString& name, const Qt::GlobalColor c) const {
62   QColor col(c);
63   return colorValue(name, col);
64 }
65
66 QColor Yacsgui_Resource::colorValue(const QString& name, const int h, const int s, const int v) const {
67   QColor col;
68   col.setHsv(h, s, v);
69   return colorValue(name, col);
70 }
71
72 QString Yacsgui_Resource::stringValue(const QString& name, const QString def) const {
73   return _resource->stringValue(RESOURCE_YACS, name, def);
74 }
75
76 // Set resources
77 // -------------
78
79 void Yacsgui_Resource::setValue( const QString& name, const int val ) {
80     _resource->setValue(RESOURCE_YACS, name, val);
81 }
82
83 void Yacsgui_Resource::setValue( const QString& name, const double val ) {
84     _resource->setValue(RESOURCE_YACS, name, val);
85 }
86
87 void Yacsgui_Resource::setValue( const QString& name, const bool val ) {
88     _resource->setValue(RESOURCE_YACS, name, val);
89 }
90
91 void Yacsgui_Resource::setValue( const QString& name, const QFont val ) {
92     _resource->setValue(RESOURCE_YACS, name, val);
93 }
94
95 void Yacsgui_Resource::setValue( const QString& name, const QColor val ) {
96     _resource->setValue(RESOURCE_YACS, name, val);
97 }
98
99 void Yacsgui_Resource::setValue( const QString& name, const QString val ) {
100     _resource->setValue(RESOURCE_YACS, name, val);
101 }
102
103 // Create preferences
104 // ------------------
105
106 void Yacsgui_Resource::createPreferences(Yacsgui* swm)
107 {
108   DEBTRACE("createPreferences");
109   // --- General tab ---
110   int genTab = swm->addPreference( Yacsgui::tr( "PREF_TAB_GENERAL" ) );
111
112   int presentationGroup = swm->addPreference( "Presentation", genTab );
113   swm->setPreferenceProperty(presentationGroup , "columns", 2);
114
115   swm->addPreference( "Auto Compute Links", presentationGroup, LightApp_Preferences::Bool, RESOURCE_YACS, "autoComputeLinks" );
116   swm->addPreference( "Simplify Links", presentationGroup, LightApp_Preferences::Bool, RESOURCE_YACS, "simplifyLink" );
117   swm->addPreference( "Better Separation for Links", presentationGroup, LightApp_Preferences::Bool, RESOURCE_YACS, "addRowCols" );
118   swm->addPreference( "Ensure Node Visible When Moved", presentationGroup, LightApp_Preferences::Bool, RESOURCE_YACS, "ensureVisibleWhenMoved" );
119   swm->addPreference( "Tabified Panels Up", presentationGroup, LightApp_Preferences::Bool, RESOURCE_YACS, "tabPanelsUp" );
120   int priority = swm->addPreference( "DockWidget priority", presentationGroup, LightApp_Preferences::Selector, RESOURCE_YACS, "dockWidgetPriority" );
121
122   QStringList priorityList;
123   priorityList.append( "Horizontal" );
124   priorityList.append( "Vertical" );
125
126   QList<QVariant> indexesList;
127   indexesList.append(0);
128   indexesList.append(1);
129
130   swm->setPreferenceProperty( priority, "strings", priorityList );
131   swm->setPreferenceProperty( priority, "indexes", indexesList );
132
133   int pythonGroup = swm->addPreference( "Python", genTab );
134
135   swm->addPreference( "Python Script Font", pythonGroup, LightApp_Preferences::Font, RESOURCE_YACS, "font" );
136   swm->addPreference( "Python External Editor", pythonGroup, LightApp_Preferences::String, RESOURCE_YACS, "pythonExternalEditor" );
137
138   int catalogGroup = swm->addPreference( "Catalogs", genTab );
139
140   swm->addPreference( "User catalog", catalogGroup, LightApp_Preferences::File, RESOURCE_YACS, "userCatalog" );
141
142   int componentGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_COMPONENT" ), genTab );
143
144   swm->addPreference( Yacsgui::tr( _COMPONENT_INSTANCE_NEW ), componentGroup, LightApp_Preferences::Bool, RESOURCE_YACS, _COMPONENT_INSTANCE_NEW );
145
146   // Link colors tab
147   int linkTab = swm->addPreference( Yacsgui::tr( "Link colors" ) );
148
149   int idGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_GENERAL" ), linkTab );
150   swm->setPreferenceProperty( idGroup, "columns", 1 );
151
152   swm->addPreference( Yacsgui::tr( "Link draw color" ),           idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "link_draw_color" );
153   swm->addPreference( Yacsgui::tr( "Link select color" ),         idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "link_select_color" );
154   swm->addPreference( Yacsgui::tr( "Stream link draw color" ),    idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "stream_link_draw_color" );
155   swm->addPreference( Yacsgui::tr( "Stream link select color" ),  idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "stream_link_select_color" );
156   swm->addPreference( Yacsgui::tr( "Control link draw color" ),   idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "control_link_draw_color" );
157   swm->addPreference( Yacsgui::tr( "Control link select color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "control_link_select_color" );
158   swm->addPreference( Yacsgui::tr( "Emphasis link color" ),       idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "emphasizeBrushColor" );
159
160   swm->addPreference( Yacsgui::tr( "link pen darkness" ),         idGroup, LightApp_Preferences::Integer, RESOURCE_YACS, "link_pen_darkness" );
161   swm->addPreference( Yacsgui::tr( "link thickness" ),         idGroup, LightApp_Preferences::Double, RESOURCE_YACS, "link_thickness" );
162   swm->addPreference( Yacsgui::tr( "link separation weight" ),    idGroup, LightApp_Preferences::Integer, RESOURCE_YACS, "link_separation_weight" );
163
164   // --- node colors tab ---
165   int nodeTab = swm->addPreference( Yacsgui::tr( "PREF_TAB_NODE" ) );
166
167   int nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_SCENE" ), nodeTab );
168   swm->setPreferenceProperty(nodeSubtab , "columns", 2);
169
170   swm->addPreference( Yacsgui::tr( "Pen"        ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_pen     );
171   swm->addPreference( Yacsgui::tr( "Brush"      ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_brush   );
172   swm->addPreference( Yacsgui::tr( "High pen"   ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_hiPen   );
173   swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_hiBrush );
174
175   nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_BLOC" ), nodeTab );
176   swm->setPreferenceProperty(nodeSubtab , "columns", 2);
177
178   swm->addPreference( Yacsgui::tr( "Pen"        ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_pen     );
179   swm->addPreference( Yacsgui::tr( "Brush"      ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_brush   );
180   swm->addPreference( Yacsgui::tr( "High pen"   ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_hiPen   );
181   swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_hiBrush );
182
183   nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_NODE" ), nodeTab );
184   swm->setPreferenceProperty(nodeSubtab , "columns", 2);
185
186   swm->addPreference( Yacsgui::tr( "Pen"        ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_pen     );
187   swm->addPreference( Yacsgui::tr( "Brush"      ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_brush   );
188   swm->addPreference( Yacsgui::tr( "High pen"   ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_hiPen   );
189   swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_hiBrush );
190
191   nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_HEADER" ), nodeTab );
192   swm->setPreferenceProperty(nodeSubtab , "columns", 2);
193
194   swm->addPreference( Yacsgui::tr( "Pen"        ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_pen     );
195   swm->addPreference( Yacsgui::tr( "Brush"      ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_brush   );
196   swm->addPreference( Yacsgui::tr( "High pen"   ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_hiPen   );
197   swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_hiBrush );
198
199   nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_CONTROL" ), nodeTab );
200   swm->setPreferenceProperty(nodeSubtab , "columns", 2);
201
202   swm->addPreference( Yacsgui::tr( "Pen"        ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_pen     );
203   swm->addPreference( Yacsgui::tr( "Brush"      ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_brush   );
204   swm->addPreference( Yacsgui::tr( "High pen"   ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_hiPen   );
205   swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_hiBrush );
206
207   nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_PORT" ), nodeTab );
208   swm->setPreferenceProperty(nodeSubtab , "columns", 2);
209
210   swm->addPreference( Yacsgui::tr( "Pen"        ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_pen     );
211   swm->addPreference( Yacsgui::tr( "Brush"      ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_brush   );
212   swm->addPreference( Yacsgui::tr( "High pen"   ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_hiPen   );
213   swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_hiBrush );
214
215   nodeSubtab = swm->addPreference( "Datastream port", nodeTab );
216   swm->setPreferenceProperty(nodeSubtab , "columns", 2);
217
218   swm->addPreference( Yacsgui::tr( "Pen"        ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_pen     );
219   swm->addPreference( Yacsgui::tr( "Brush"      ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_brush   );
220   swm->addPreference( Yacsgui::tr( "High pen"   ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_hiPen   );
221   swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_hiBrush );
222
223   nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_DRAG" ), nodeTab );
224   swm->setPreferenceProperty(nodeSubtab, "columns", 1);
225
226   swm->addPreference( Yacsgui::tr( "On dragging"), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, __dragOver );
227
228   // --- Color of state of nodes tab ---
229   int stateTab = swm->addPreference( Yacsgui::tr( "PREF_TAB_STATE" ) );
230
231   int editGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_EDIT" ), stateTab );
232   swm->setPreferenceProperty( editGroup, "columns", 1 );
233
234   swm->addPreference( Yacsgui::tr( _editedNodeBrushColor ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _editedNodeBrushColor );
235   swm->addPreference( Yacsgui::tr( _normalNodeBrushColor ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _normalNodeBrushColor );
236   swm->addPreference( Yacsgui::tr( _runNodeBrushColor    ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _runNodeBrushColor    );
237   swm->addPreference( Yacsgui::tr( _validNodeColor       ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _validNodeColor       );
238   swm->addPreference( Yacsgui::tr( _invalidNodeColor     ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _invalidNodeColor     );
239
240   int runGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_RUN" ), stateTab );
241   swm->setPreferenceProperty( runGroup, "columns", 2 );
242
243   swm->addPreference( Yacsgui::tr( _NOTYETINITIALIZED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _NOTYETINITIALIZED );
244   swm->addPreference( Yacsgui::tr( _INITIALISED       ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _INITIALISED       );
245   swm->addPreference( Yacsgui::tr( _RUNNING           ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _RUNNING           );
246   swm->addPreference( Yacsgui::tr( _WAITINGTASKS      ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _WAITINGTASKS      );
247   swm->addPreference( Yacsgui::tr( _PAUSED            ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _PAUSED            );
248   swm->addPreference( Yacsgui::tr( _FINISHED          ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _FINISHED          );
249   swm->addPreference( Yacsgui::tr( _STOPPED           ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _STOPPED           );
250   swm->addPreference( Yacsgui::tr( _UNKNOWN           ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _UNKNOWN           );
251
252   swm->addPreference( Yacsgui::tr( _UNDEFINED         ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _UNDEFINED         );
253   swm->addPreference( Yacsgui::tr( _INVALID           ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _INVALID           );
254   swm->addPreference( Yacsgui::tr( _READY             ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _READY             );
255   swm->addPreference( Yacsgui::tr( _TOLOAD            ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _TOLOAD            );
256   swm->addPreference( Yacsgui::tr( _LOADED            ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _LOADED            );
257   swm->addPreference( Yacsgui::tr( _TOACTIVATE        ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _TOACTIVATE        );
258   swm->addPreference( Yacsgui::tr( _ACTIVATED         ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _ACTIVATED         );
259   swm->addPreference( Yacsgui::tr( _DESACTIVATED      ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DESACTIVATED      );
260   swm->addPreference( Yacsgui::tr( _DONE              ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DONE              );
261   swm->addPreference( Yacsgui::tr( _SUSPENDED         ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _SUSPENDED         );
262   swm->addPreference( Yacsgui::tr( _LOADFAILED        ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _LOADFAILED        );
263   swm->addPreference( Yacsgui::tr( _EXECFAILED        ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _EXECFAILED        );
264   swm->addPreference( Yacsgui::tr( _PAUSE             ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _PAUSE             );
265   swm->addPreference( Yacsgui::tr( _INTERNALERR       ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _INTERNALERR       );
266   swm->addPreference( Yacsgui::tr( _DISABLED          ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DISABLED          );
267   swm->addPreference( Yacsgui::tr( _FAILED            ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _FAILED            );
268   swm->addPreference( Yacsgui::tr( _ERROR             ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _ERROR             );
269   swm->addPreference( Yacsgui::tr( _DEFAULT           ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DEFAULT           );
270 }
271
272 void Yacsgui_Resource::preferencesChanged()
273 {
274   DEBTRACE("preferencesChanged");
275
276   // Notice: it is here for updating the view, etc.
277
278   // General resource
279   Resource::COMPONENT_INSTANCE_NEW = booleanValue(_COMPONENT_INSTANCE_NEW, COMPONENTINSTANCENEW);
280   Resource::pythonfont           = fontValue( "font" ,PYTHONFONT);
281   Resource::pythonExternalEditor   = stringValue( "pythonExternalEditor" ,PYTHONEXTERNALEDITOR);
282   Resource::userCatalog           = stringValue( "userCatalog" ,USERCATALOG);
283   Resource::autoComputeLinks = booleanValue("autoComputeLinks", AUTOCOMPUTELINKS);
284   Resource::simplifyLink = booleanValue("simplifyLink", SIMPLIFYLINK);
285   Resource::addRowCols = booleanValue("addRowCols", ADDROWCOLS);
286   Resource::ensureVisibleWhenMoved = booleanValue("ensureVisibleWhenMoved", ENSUREVISIBLEWHENMOVED);
287   Resource::tabPanelsUp = booleanValue("tabPanelsUp", TABPANELSUP);
288   Resource::dockWidgetPriority   = integerValue( "dockWidgetPriority" , DOCKWIDGETPRIORITY);
289
290   // Color of state of nodes
291   Resource::editedNodeBrushColor = colorValue(_editedNodeBrushColor, EDITEDNODEBRUSHCOLOR);
292   Resource::normalNodeBrushColor = colorValue(_normalNodeBrushColor, NORMALNODEBRUSHCOLOR);
293   Resource::runNodeBrushColor    = colorValue(_runNodeBrushColor   , RUNNODEBRUSHCOLOR);
294   Resource::validNodeColor       = colorValue(_validNodeColor      , VALIDNODECOLOR);
295   Resource::invalidNodeColor     = colorValue(_invalidNodeColor    , INVALIDNODECOLOR);
296
297   Resource::NOTYETINITIALIZED    = colorValue(_NOTYETINITIALIZED   ,  NOTYETINITIALIZED_);
298   Resource::INITIALISED          = colorValue(_INITIALISED         ,  INITIALISED_);
299   Resource::RUNNING              = colorValue(_RUNNING             , RUNNING_     );
300   Resource::WAITINGTASKS         = colorValue(_WAITINGTASKS        , WAITINGTASKS_);
301   Resource::PAUSED               = colorValue(_PAUSED              , PAUSED_      );
302   Resource::FINISHED             = colorValue(_FINISHED            , FINISHED_    );
303   Resource::STOPPED              = colorValue(_STOPPED             , STOPPED_     );
304   Resource::UNKNOWN              = colorValue(_UNKNOWN             , UNKNOWN_     );
305
306   Resource::UNDEFINED            = colorValue(_UNDEFINED           , UNDEFINED_   );
307   Resource::INVALID              = colorValue(_INVALID             , INVALID_     );
308   Resource::READY                = colorValue(_READY               , READY_       );
309   Resource::TOLOAD               = colorValue(_TOLOAD              , TOLOAD_      );
310   Resource::LOADED               = colorValue(_LOADED              , LOADED_      );
311   Resource::TOACTIVATE           = colorValue(_TOACTIVATE          , TOACTIVATE_  );
312   Resource::ACTIVATED            = colorValue(_ACTIVATED           , ACTIVATED_   );
313   Resource::DESACTIVATED         = colorValue(_DESACTIVATED        , DESACTIVATED_);
314   Resource::DONE                 = colorValue(_DONE                , DONE_        );
315   Resource::SUSPENDED            = colorValue(_SUSPENDED           , SUSPENDED_   );
316   Resource::LOADFAILED           = colorValue(_LOADFAILED          , LOADFAILED_  );
317   Resource::EXECFAILED           = colorValue(_EXECFAILED          , EXECFAILED_  );
318   Resource::PAUSE                = colorValue(_PAUSE               , PAUSE_       );
319   Resource::INTERNALERR          = colorValue(_INTERNALERR         , INTERNALERR_ );
320   Resource::DISABLED             = colorValue(_DISABLED            , DISABLED_    );
321   Resource::FAILED               = colorValue(_FAILED              , FAILED_      );
322   Resource::ERROR                = colorValue(_ERROR               , ERROR_       );
323   Resource::DEFAULT              = colorValue(_DEFAULT             , DEFAULT_     );
324
325   // Color of links
326   Resource::link_draw_color           = colorValue("link_draw_color"          , LINKDRAW_COLOR         );
327   Resource::stream_link_draw_color    = colorValue("stream_link_draw_color"   , STREAMLINKDRAW_COLOR   );
328   Resource::link_select_color         = colorValue("link_select_color"        , LINK_SELECT_COLOR      );
329   Resource::stream_link_select_color  = colorValue("stream_link_select_color" , STREAMLINK_SELECT_COLOR);
330   Resource::control_link_draw_color   = colorValue("control_link_draw_color"  , CTRLLINKDRAW_COLOR     );
331   Resource::control_link_select_color = colorValue("control_link_select_color", CTRLLINK_SELECT_COLOR  );
332   Resource::emphasizeBrushColor       = colorValue("emphasizeBrushColor"      , EMPHASIZEBRUSHCOLOR    );
333
334   Resource::link_pen_darkness = integerValue("link_pen_darkness", LINK_PEN_DARKNESS  );
335   Resource::link_separation_weight = integerValue("link_separation_weight", LINK_SEPARATION_WEIGHT  );
336   Resource::link_thickness = doubleValue("link_thickness", LINK_THICKNESS  );
337
338   // Color of nodes
339   Resource::Scene_pen              = colorValue(_Scene_pen,               Scene_pen_             );
340   Resource::Scene_hiPen            = colorValue(_Scene_hiPen,             Scene_hiPen_           );
341   Resource::Scene_brush            = colorValue(_Scene_brush,             Scene_brush_           );
342   Resource::Scene_hiBrush          = colorValue(_Scene_hiBrush,           Scene_hiBrush_         );
343   Resource::ComposedNode_brush     = colorValue(_ComposedNode_brush,      ComposedNode_brush_    );
344   Resource::ComposedNode_hiBrush   = colorValue(_ComposedNode_hiBrush,    ComposedNode_hiBrush_  );
345   Resource::ComposedNode_pen       = colorValue(_ComposedNode_pen,        ComposedNode_pen_      );
346   Resource::ComposedNode_hiPen     = colorValue(_ComposedNode_hiPen,      ComposedNode_hiPen_    );
347   Resource::ElementaryNode_brush   = colorValue(_ElementaryNode_brush,    ElementaryNode_brush_  );
348   Resource::ElementaryNode_hiBrush = colorValue(_ElementaryNode_hiBrush,  ElementaryNode_hiBrush_);
349   Resource::ElementaryNode_pen     = colorValue(_ElementaryNode_pen,      ElementaryNode_pen_    );
350   Resource::ElementaryNode_hiPen   = colorValue(_ElementaryNode_hiPen,    ElementaryNode_hiPen_  );
351   Resource::Header_brush           = colorValue(_Header_brush,            Header_brush_          );
352   Resource::Header_hiBrush         = colorValue(_Header_hiBrush,          Header_hiBrush_        );
353   Resource::Header_pen             = colorValue(_Header_pen,              Header_pen_            );
354   Resource::Header_hiPen           = colorValue(_Header_hiPen,            Header_hiPen_          );
355   Resource::CtrlPort_brush         = colorValue(_CtrlPort_brush,          CtrlPort_brush_        );
356   Resource::CtrlPort_hiBrush       = colorValue(_CtrlPort_hiBrush,        CtrlPort_hiBrush_      );
357   Resource::CtrlPort_pen           = colorValue(_CtrlPort_pen,            CtrlPort_pen_          );
358   Resource::CtrlPort_hiPen         = colorValue(_CtrlPort_hiPen,          CtrlPort_hiPen_        );
359   Resource::DataPort_brush         = colorValue(_DataPort_brush,          DataPort_brush_        );
360   Resource::DataPort_hiBrush       = colorValue(_DataPort_hiBrush,        DataPort_hiBrush_      );
361   Resource::DataPort_pen           = colorValue(_DataPort_pen,            DataPort_pen_          );
362   Resource::DataPort_hiPen         = colorValue(_DataPort_hiPen,          DataPort_hiPen_        );
363   Resource::DataStreamPort_brush   = colorValue(_DataStreamPort_brush,    DataStreamPort_brush_  );
364   Resource::DataStreamPort_hiBrush = colorValue(_DataStreamPort_hiBrush,  DataStreamPort_hiBrush_);
365   Resource::DataStreamPort_pen     = colorValue(_DataStreamPort_pen,      DataStreamPort_pen_    );
366   Resource::DataStreamPort_hiPen   = colorValue(_DataStreamPort_hiPen,    DataStreamPort_hiPen_  );
367
368   Resource::dragOver               = colorValue(__dragOver,               dragOver_              );
369 }
370
371 void Yacsgui_Resource::preferencesChanged( const QString& sect, const QString& name ) 
372 {
373   if( sect==RESOURCE_YACS )
374     {
375       preferencesChanged();
376     }
377 }
378