Version: 8.3.0
Yacsgui_Resource.cxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2016 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 "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 
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 
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  swm->addPreference( "Progress bar color", presentationGroup, LightApp_Preferences::Color, RESOURCE_YACS, "progressBarColor" );
122  int progressLabel = swm->addPreference( "Progress bar label", presentationGroup, LightApp_Preferences::Selector, RESOURCE_YACS, "progressBarLabel" );
123 
124  QStringList stringsList;
125  stringsList.append( "Horizontal" );
126  stringsList.append( "Vertical" );
127  QList<QVariant> indexesList;
128  indexesList.append(0);
129  indexesList.append(1);
130  swm->setPreferenceProperty( priority, "strings", stringsList );
131  swm->setPreferenceProperty( priority, "indexes", indexesList );
132 
133  stringsList.clear();
134  indexesList.clear();
135 
136  stringsList << "Percentage: \"50%\"" << "Nb.steps: \"5/10\"" << "Both: \"50% (5/10)\"";
137  indexesList << 0 << 1 << 2;
138  swm->setPreferenceProperty( progressLabel, "strings", stringsList );
139  swm->setPreferenceProperty( progressLabel, "indexes", indexesList );
140 
141  int pythonGroup = swm->addPreference( "Python", genTab );
142 
143  swm->addPreference( "Python Script Font", pythonGroup, LightApp_Preferences::Font, RESOURCE_YACS, "font" );
144  swm->addPreference( "Python External Editor", pythonGroup, LightApp_Preferences::String, RESOURCE_YACS, "pythonExternalEditor" );
145 
146  int catalogGroup = swm->addPreference( "Catalogs", genTab );
147 
148  swm->addPreference( "User catalog", catalogGroup, LightApp_Preferences::File, RESOURCE_YACS, "userCatalog" );
149 
150  int componentGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_COMPONENT" ), genTab );
151 
152  swm->addPreference( Yacsgui::tr( _COMPONENT_INSTANCE_NEW ), componentGroup, LightApp_Preferences::Bool, RESOURCE_YACS, _COMPONENT_INSTANCE_NEW );
153 
154  // Link colors tab
155  int linkTab = swm->addPreference( Yacsgui::tr( "Link colors" ) );
156 
157  int idGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_GENERAL" ), linkTab );
158  swm->setPreferenceProperty( idGroup, "columns", 1 );
159 
160  swm->addPreference( Yacsgui::tr( "Link draw color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "link_draw_color" );
161  swm->addPreference( Yacsgui::tr( "Link select color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "link_select_color" );
162  swm->addPreference( Yacsgui::tr( "Stream link draw color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "stream_link_draw_color" );
163  swm->addPreference( Yacsgui::tr( "Stream link select color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "stream_link_select_color" );
164  swm->addPreference( Yacsgui::tr( "Control link draw color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "control_link_draw_color" );
165  swm->addPreference( Yacsgui::tr( "Control link select color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "control_link_select_color" );
166  swm->addPreference( Yacsgui::tr( "Emphasis link color" ), idGroup, LightApp_Preferences::Color, RESOURCE_YACS, "emphasizeBrushColor" );
167 
168  swm->addPreference( Yacsgui::tr( "link pen darkness" ), idGroup, LightApp_Preferences::Integer, RESOURCE_YACS, "link_pen_darkness" );
169  swm->addPreference( Yacsgui::tr( "link thickness" ), idGroup, LightApp_Preferences::Double, RESOURCE_YACS, "link_thickness" );
170  swm->addPreference( Yacsgui::tr( "link separation weight" ), idGroup, LightApp_Preferences::Integer, RESOURCE_YACS, "link_separation_weight" );
171 
172  // --- node colors tab ---
173  int nodeTab = swm->addPreference( Yacsgui::tr( "PREF_TAB_NODE" ) );
174 
175  int nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_SCENE" ), nodeTab );
176  swm->setPreferenceProperty(nodeSubtab , "columns", 2);
177 
178  swm->addPreference( Yacsgui::tr( "Pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_pen );
179  swm->addPreference( Yacsgui::tr( "Brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_brush );
180  swm->addPreference( Yacsgui::tr( "High pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_hiPen );
181  swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Scene_hiBrush );
182 
183  nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_BLOC" ), nodeTab );
184  swm->setPreferenceProperty(nodeSubtab , "columns", 2);
185 
186  swm->addPreference( Yacsgui::tr( "Pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_pen );
187  swm->addPreference( Yacsgui::tr( "Brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_brush );
188  swm->addPreference( Yacsgui::tr( "High pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_hiPen );
189  swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ComposedNode_hiBrush );
190 
191  nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_NODE" ), nodeTab );
192  swm->setPreferenceProperty(nodeSubtab , "columns", 2);
193 
194  swm->addPreference( Yacsgui::tr( "Pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_pen );
195  swm->addPreference( Yacsgui::tr( "Brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_brush );
196  swm->addPreference( Yacsgui::tr( "High pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_hiPen );
197  swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _ElementaryNode_hiBrush );
198 
199  nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_HEADER" ), nodeTab );
200  swm->setPreferenceProperty(nodeSubtab , "columns", 2);
201 
202  swm->addPreference( Yacsgui::tr( "Pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_pen );
203  swm->addPreference( Yacsgui::tr( "Brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_brush );
204  swm->addPreference( Yacsgui::tr( "High pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_hiPen );
205  swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _Header_hiBrush );
206 
207  nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_CONTROL" ), nodeTab );
208  swm->setPreferenceProperty(nodeSubtab , "columns", 2);
209 
210  swm->addPreference( Yacsgui::tr( "Pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_pen );
211  swm->addPreference( Yacsgui::tr( "Brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_brush );
212  swm->addPreference( Yacsgui::tr( "High pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_hiPen );
213  swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _CtrlPort_hiBrush );
214 
215  nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_PORT" ), nodeTab );
216  swm->setPreferenceProperty(nodeSubtab , "columns", 2);
217 
218  swm->addPreference( Yacsgui::tr( "Pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_pen );
219  swm->addPreference( Yacsgui::tr( "Brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_brush );
220  swm->addPreference( Yacsgui::tr( "High pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_hiPen );
221  swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataPort_hiBrush );
222 
223  nodeSubtab = swm->addPreference( "Datastream port", nodeTab );
224  swm->setPreferenceProperty(nodeSubtab , "columns", 2);
225 
226  swm->addPreference( Yacsgui::tr( "Pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_pen );
227  swm->addPreference( Yacsgui::tr( "Brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_brush );
228  swm->addPreference( Yacsgui::tr( "High pen" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_hiPen );
229  swm->addPreference( Yacsgui::tr( "High brush" ), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, _DataStreamPort_hiBrush );
230 
231  nodeSubtab = swm->addPreference( Yacsgui::tr( "PREF_GROUP_DRAG" ), nodeTab );
232  swm->setPreferenceProperty(nodeSubtab, "columns", 1);
233 
234  swm->addPreference( Yacsgui::tr( "On dragging"), nodeSubtab, LightApp_Preferences::Color, RESOURCE_YACS, __dragOver );
235 
236  // --- Color of state of nodes tab ---
237  int stateTab = swm->addPreference( Yacsgui::tr( "PREF_TAB_STATE" ) );
238 
239  int editGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_EDIT" ), stateTab );
240  swm->setPreferenceProperty( editGroup, "columns", 1 );
241 
242  swm->addPreference( Yacsgui::tr( _editedNodeBrushColor ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _editedNodeBrushColor );
243  swm->addPreference( Yacsgui::tr( _normalNodeBrushColor ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _normalNodeBrushColor );
244  swm->addPreference( Yacsgui::tr( _runNodeBrushColor ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _runNodeBrushColor );
245  swm->addPreference( Yacsgui::tr( _validNodeColor ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _validNodeColor );
246  swm->addPreference( Yacsgui::tr( _invalidNodeColor ), editGroup, LightApp_Preferences::Color, RESOURCE_YACS, _invalidNodeColor );
247 
248  int runGroup = swm->addPreference( Yacsgui::tr( "PREF_GROUP_RUN" ), stateTab );
249  swm->setPreferenceProperty( runGroup, "columns", 2 );
250 
251  swm->addPreference( Yacsgui::tr( _NOTYETINITIALIZED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _NOTYETINITIALIZED );
252  swm->addPreference( Yacsgui::tr( _INITIALISED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _INITIALISED );
253  swm->addPreference( Yacsgui::tr( _RUNNING ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _RUNNING );
254  swm->addPreference( Yacsgui::tr( _WAITINGTASKS ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _WAITINGTASKS );
255  swm->addPreference( Yacsgui::tr( _PAUSED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _PAUSED );
256  swm->addPreference( Yacsgui::tr( _FINISHED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _FINISHED );
257  swm->addPreference( Yacsgui::tr( _STOPPED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _STOPPED );
258  swm->addPreference( Yacsgui::tr( _UNKNOWN ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _UNKNOWN );
259 
260  swm->addPreference( Yacsgui::tr( _UNDEFINED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _UNDEFINED );
261  swm->addPreference( Yacsgui::tr( _INVALID ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _INVALID );
262  swm->addPreference( Yacsgui::tr( _READY ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _READY );
263  swm->addPreference( Yacsgui::tr( _TOLOAD ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _TOLOAD );
264  swm->addPreference( Yacsgui::tr( _LOADED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _LOADED );
265  swm->addPreference( Yacsgui::tr( _TOACTIVATE ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _TOACTIVATE );
266  swm->addPreference( Yacsgui::tr( _ACTIVATED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _ACTIVATED );
267  swm->addPreference( Yacsgui::tr( _DESACTIVATED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DESACTIVATED );
268  swm->addPreference( Yacsgui::tr( _DONE ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DONE );
269  swm->addPreference( Yacsgui::tr( _SUSPENDED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _SUSPENDED );
270  swm->addPreference( Yacsgui::tr( _LOADFAILED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _LOADFAILED );
271  swm->addPreference( Yacsgui::tr( _EXECFAILED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _EXECFAILED );
272  swm->addPreference( Yacsgui::tr( _PAUSE ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _PAUSE );
273  swm->addPreference( Yacsgui::tr( _INTERNALERR ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _INTERNALERR );
274  swm->addPreference( Yacsgui::tr( _DISABLED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DISABLED );
275  swm->addPreference( Yacsgui::tr( _FAILED ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _FAILED );
276  swm->addPreference( Yacsgui::tr( _ERROR ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _ERROR );
277  swm->addPreference( Yacsgui::tr( _DEFAULT ), runGroup, LightApp_Preferences::Color, RESOURCE_YACS, _DEFAULT );
278 }
279 
281 {
282  DEBTRACE("preferencesChanged");
283 
284  // Notice: it is here for updating the view, etc.
285 
286  // General resource
288  Resource::pythonfont = fontValue( "font" ,PYTHONFONT);
289  Resource::pythonExternalEditor = stringValue( "pythonExternalEditor" ,PYTHONEXTERNALEDITOR);
290  Resource::userCatalog = stringValue( "userCatalog" ,USERCATALOG);
291  Resource::autoComputeLinks = booleanValue("autoComputeLinks", AUTOCOMPUTELINKS);
292  Resource::simplifyLink = booleanValue("simplifyLink", SIMPLIFYLINK);
293  Resource::addRowCols = booleanValue("addRowCols", ADDROWCOLS);
294  Resource::ensureVisibleWhenMoved = booleanValue("ensureVisibleWhenMoved", ENSUREVISIBLEWHENMOVED);
295  Resource::tabPanelsUp = booleanValue("tabPanelsUp", TABPANELSUP);
296  Resource::dockWidgetPriority = integerValue( "dockWidgetPriority" , DOCKWIDGETPRIORITY);
297  Resource::progressBarColor = colorValue("progressBarColor", PROGRESSBARCOLOR);
298  Resource::progressBarLabel = integerValue( "progressBarLabel" , PROGRESSBARLABEL);
299 
300  // Color of state of nodes
306 
309  Resource::RUNNING = colorValue(_RUNNING , RUNNING_ );
311  Resource::PAUSED = colorValue(_PAUSED , PAUSED_ );
312  Resource::FINISHED = colorValue(_FINISHED , FINISHED_ );
313  Resource::STOPPED = colorValue(_STOPPED , STOPPED_ );
314  Resource::UNKNOWN = colorValue(_UNKNOWN , UNKNOWN_ );
315 
316  Resource::UNDEFINED = colorValue(_UNDEFINED , UNDEFINED_ );
317  Resource::INVALID = colorValue(_INVALID , INVALID_ );
318  Resource::READY = colorValue(_READY , READY_ );
319  Resource::TOLOAD = colorValue(_TOLOAD , TOLOAD_ );
320  Resource::LOADED = colorValue(_LOADED , LOADED_ );
322  Resource::ACTIVATED = colorValue(_ACTIVATED , ACTIVATED_ );
324  Resource::DONE = colorValue(_DONE , DONE_ );
325  Resource::SUSPENDED = colorValue(_SUSPENDED , SUSPENDED_ );
328  Resource::PAUSE = colorValue(_PAUSE , PAUSE_ );
330  Resource::DISABLED = colorValue(_DISABLED , DISABLED_ );
331  Resource::FAILED = colorValue(_FAILED , FAILED_ );
332  Resource::ERROR = colorValue(_ERROR , ERROR_ );
333  Resource::DEFAULT = colorValue(_DEFAULT , DEFAULT_ );
334 
335  // Color of links
336  Resource::link_draw_color = colorValue("link_draw_color" , LINKDRAW_COLOR );
337  Resource::stream_link_draw_color = colorValue("stream_link_draw_color" , STREAMLINKDRAW_COLOR );
338  Resource::link_select_color = colorValue("link_select_color" , LINK_SELECT_COLOR );
339  Resource::stream_link_select_color = colorValue("stream_link_select_color" , STREAMLINK_SELECT_COLOR);
340  Resource::control_link_draw_color = colorValue("control_link_draw_color" , CTRLLINKDRAW_COLOR );
341  Resource::control_link_select_color = colorValue("control_link_select_color", CTRLLINK_SELECT_COLOR );
342  Resource::emphasizeBrushColor = colorValue("emphasizeBrushColor" , EMPHASIZEBRUSHCOLOR );
343 
344  Resource::link_pen_darkness = integerValue("link_pen_darkness", LINK_PEN_DARKNESS );
345  Resource::link_separation_weight = integerValue("link_separation_weight", LINK_SEPARATION_WEIGHT );
346  Resource::link_thickness = doubleValue("link_thickness", LINK_THICKNESS );
347 
348  // Color of nodes
349  Resource::Scene_pen = colorValue(_Scene_pen, Scene_pen_ );
377 
378  Resource::dragOver = colorValue(__dragOver, dragOver_ );
379 }
380 
381 void Yacsgui_Resource::preferencesChanged( const QString& sect, const QString& name )
382 {
383  if( sect==RESOURCE_YACS )
384  {
385  preferencesChanged();
386  }
387 }
388