Version: 9.15.0
Yacsgui_Resource.cxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2025 CEA, EDF
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 
#define UNKNOWN_
Definition: Resource.hxx:133
#define _DEFAULT
Definition: Resource.hxx:68
#define DESACTIVATED_
Definition: Resource.hxx:142
#define FINISHED_
Definition: Resource.hxx:131
#define RUNNODEBRUSHCOLOR
Definition: Resource.hxx:120
#define STREAMLINKDRAW_COLOR
Definition: Resource.hxx:156
#define LINK_SEPARATION_WEIGHT
Definition: Resource.hxx:162
#define ADDROWCOLS
Definition: Resource.hxx:108
#define CtrlPort_hiPen_
Definition: Resource.hxx:183
#define VALIDNODECOLOR
Definition: Resource.hxx:121
#define _Scene_pen
Definition: Resource.hxx:70
#define DataPort_hiPen_
Definition: Resource.hxx:187
#define DataStreamPort_hiBrush_
Definition: Resource.hxx:189
#define CtrlPort_brush_
Definition: Resource.hxx:180
#define FAILED_
Definition: Resource.hxx:150
#define AUTOCOMPUTELINKS
Definition: Resource.hxx:110
#define ElementaryNode_pen_
Definition: Resource.hxx:174
#define CTRLLINK_SELECT_COLOR
Definition: Resource.hxx:159
#define PAUSE_
Definition: Resource.hxx:147
#define _ComposedNode_hiPen
Definition: Resource.hxx:77
#define READY_
Definition: Resource.hxx:137
#define PAUSED_
Definition: Resource.hxx:130
#define COMPONENTINSTANCENEW
Definition: Resource.hxx:104
#define _DESACTIVATED
Definition: Resource.hxx:58
#define _ComposedNode_brush
Definition: Resource.hxx:74
#define _validNodeColor
Definition: Resource.hxx:39
#define CTRLLINKDRAW_COLOR
Definition: Resource.hxx:158
#define _UNKNOWN
Definition: Resource.hxx:49
#define _WAITINGTASKS
Definition: Resource.hxx:45
#define _Scene_brush
Definition: Resource.hxx:72
#define _CtrlPort_hiBrush
Definition: Resource.hxx:87
#define ComposedNode_pen_
Definition: Resource.hxx:170
#define _SUSPENDED
Definition: Resource.hxx:60
#define _INVALID
Definition: Resource.hxx:52
#define ComposedNode_hiPen_
Definition: Resource.hxx:171
#define Header_hiBrush_
Definition: Resource.hxx:177
#define _PAUSE
Definition: Resource.hxx:63
#define _TOACTIVATE
Definition: Resource.hxx:56
#define ACTIVATED_
Definition: Resource.hxx:141
#define _ElementaryNode_hiBrush
Definition: Resource.hxx:79
#define _ComposedNode_pen
Definition: Resource.hxx:76
#define _DataStreamPort_pen
Definition: Resource.hxx:96
#define _COMPONENT_INSTANCE_NEW
Definition: Resource.hxx:31
#define STREAMLINK_SELECT_COLOR
Definition: Resource.hxx:157
#define LOADED_
Definition: Resource.hxx:139
#define DONE_
Definition: Resource.hxx:143
#define _ACTIVATED
Definition: Resource.hxx:57
#define ComposedNode_hiBrush_
Definition: Resource.hxx:169
#define _PAUSED
Definition: Resource.hxx:46
#define _Scene_hiBrush
Definition: Resource.hxx:73
#define _invalidNodeColor
Definition: Resource.hxx:40
#define DOCKWIDGETPRIORITY
Definition: Resource.hxx:114
#define _DONE
Definition: Resource.hxx:59
#define DataPort_brush_
Definition: Resource.hxx:184
#define _ERROR
Definition: Resource.hxx:67
#define _ElementaryNode_brush
Definition: Resource.hxx:78
#define ERROR_
Definition: Resource.hxx:151
#define STOPPED_
Definition: Resource.hxx:132
#define ElementaryNode_hiPen_
Definition: Resource.hxx:175
#define LINK_SELECT_COLOR
Definition: Resource.hxx:155
#define _DataPort_hiBrush
Definition: Resource.hxx:91
#define PROGRESSBARLABEL
Definition: Resource.hxx:116
#define _INTERNALERR
Definition: Resource.hxx:64
#define NOTYETINITIALIZED_
Definition: Resource.hxx:126
#define TABPANELSUP
Definition: Resource.hxx:113
#define INVALID_
Definition: Resource.hxx:136
#define Header_hiPen_
Definition: Resource.hxx:179
#define LINKDRAW_COLOR
Definition: Resource.hxx:154
#define Scene_hiPen_
Definition: Resource.hxx:165
#define DEFAULT_
Definition: Resource.hxx:152
#define _DataStreamPort_brush
Definition: Resource.hxx:94
#define DISABLED_
Definition: Resource.hxx:149
#define DataPort_hiBrush_
Definition: Resource.hxx:185
#define _CtrlPort_brush
Definition: Resource.hxx:86
#define DataStreamPort_pen_
Definition: Resource.hxx:190
#define _Scene_hiPen
Definition: Resource.hxx:71
#define _Header_brush
Definition: Resource.hxx:82
#define DataStreamPort_brush_
Definition: Resource.hxx:188
#define _Header_hiPen
Definition: Resource.hxx:85
#define _DataPort_pen
Definition: Resource.hxx:92
#define UNDEFINED_
Definition: Resource.hxx:135
#define _DataStreamPort_hiPen
Definition: Resource.hxx:97
#define _INITIALISED
Definition: Resource.hxx:43
#define _Header_hiBrush
Definition: Resource.hxx:83
#define INTERNALERR_
Definition: Resource.hxx:148
#define _editedNodeBrushColor
Definition: Resource.hxx:36
#define _CtrlPort_pen
Definition: Resource.hxx:88
#define LOADFAILED_
Definition: Resource.hxx:145
#define _READY
Definition: Resource.hxx:53
#define _FAILED
Definition: Resource.hxx:66
#define _ComposedNode_hiBrush
Definition: Resource.hxx:75
#define TOLOAD_
Definition: Resource.hxx:138
#define _normalNodeBrushColor
Definition: Resource.hxx:37
#define __dragOver
Definition: Resource.hxx:99
#define EXECFAILED_
Definition: Resource.hxx:146
#define _ElementaryNode_pen
Definition: Resource.hxx:80
#define _DataStreamPort_hiBrush
Definition: Resource.hxx:95
#define TOACTIVATE_
Definition: Resource.hxx:140
#define PYTHONFONT
Definition: Resource.hxx:105
#define EDITEDNODEBRUSHCOLOR
Definition: Resource.hxx:118
#define _DataPort_hiPen
Definition: Resource.hxx:93
#define _CtrlPort_hiPen
Definition: Resource.hxx:89
#define PYTHONEXTERNALEDITOR
Definition: Resource.hxx:106
#define _TOLOAD
Definition: Resource.hxx:54
#define ElementaryNode_hiBrush_
Definition: Resource.hxx:173
#define Scene_hiBrush_
Definition: Resource.hxx:167
#define _EXECFAILED
Definition: Resource.hxx:62
#define _Header_pen
Definition: Resource.hxx:84
#define INITIALISED_
Definition: Resource.hxx:127
#define DataStreamPort_hiPen_
Definition: Resource.hxx:191
#define Scene_brush_
Definition: Resource.hxx:166
#define dragOver_
Definition: Resource.hxx:193
#define _runNodeBrushColor
Definition: Resource.hxx:38
#define EMPHASIZEBRUSHCOLOR
Definition: Resource.hxx:124
#define NORMALNODEBRUSHCOLOR
Definition: Resource.hxx:119
#define _FINISHED
Definition: Resource.hxx:47
#define SIMPLIFYLINK
Definition: Resource.hxx:111
#define LINK_PEN_DARKNESS
Definition: Resource.hxx:160
#define _DataPort_brush
Definition: Resource.hxx:90
#define USERCATALOG
Definition: Resource.hxx:107
#define ElementaryNode_brush_
Definition: Resource.hxx:172
#define _RUNNING
Definition: Resource.hxx:44
#define ENSUREVISIBLEWHENMOVED
Definition: Resource.hxx:112
#define ComposedNode_brush_
Definition: Resource.hxx:168
#define SUSPENDED_
Definition: Resource.hxx:144
#define _ElementaryNode_hiPen
Definition: Resource.hxx:81
#define _UNDEFINED
Definition: Resource.hxx:51
#define Header_brush_
Definition: Resource.hxx:176
#define _LOADFAILED
Definition: Resource.hxx:61
#define DataPort_pen_
Definition: Resource.hxx:186
#define INVALIDNODECOLOR
Definition: Resource.hxx:122
#define _STOPPED
Definition: Resource.hxx:48
#define Header_pen_
Definition: Resource.hxx:178
#define _DISABLED
Definition: Resource.hxx:65
#define _NOTYETINITIALIZED
Definition: Resource.hxx:42
#define WAITINGTASKS_
Definition: Resource.hxx:129
#define PROGRESSBARCOLOR
Definition: Resource.hxx:115
#define LINK_THICKNESS
Definition: Resource.hxx:161
#define _LOADED
Definition: Resource.hxx:55
#define RUNNING_
Definition: Resource.hxx:128
#define CtrlPort_pen_
Definition: Resource.hxx:182
#define CtrlPort_hiBrush_
Definition: Resource.hxx:181
#define Scene_pen_
Definition: Resource.hxx:164
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
#define RESOURCE_YACS
static QColor Header_brush
Definition: Resource.hxx:283
static bool simplifyLink
Definition: Resource.hxx:212
static QColor CtrlPort_hiBrush
Definition: Resource.hxx:288
static QColor DESACTIVATED
Definition: Resource.hxx:243
static QColor ElementaryNode_hiPen
Definition: Resource.hxx:282
static QFont pythonfont
Definition: Resource.hxx:256
static QColor DONE
Definition: Resource.hxx:244
static QColor control_link_draw_color
Definition: Resource.hxx:263
static int dockWidgetPriority
Definition: Resource.hxx:214
static QColor Scene_brush
Definition: Resource.hxx:273
static QColor Scene_hiBrush
Definition: Resource.hxx:274
static QColor PAUSED
Definition: Resource.hxx:231
static QColor ACTIVATED
Definition: Resource.hxx:242
static QColor DataPort_brush
Definition: Resource.hxx:291
static bool COMPONENT_INSTANCE_NEW
Definition: Resource.hxx:206
static QColor ElementaryNode_pen
Definition: Resource.hxx:281
static QColor WAITINGTASKS
Definition: Resource.hxx:230
static bool tabPanelsUp
Definition: Resource.hxx:324
static QColor Scene_hiPen
Definition: Resource.hxx:272
static QColor NOTYETINITIALIZED
Definition: Resource.hxx:227
static QColor DISABLED
Definition: Resource.hxx:250
static int link_pen_darkness
Definition: Resource.hxx:266
static QColor FAILED
Definition: Resource.hxx:251
static QColor INVALID
Definition: Resource.hxx:237
static QColor DataStreamPort_hiBrush
Definition: Resource.hxx:296
static QColor DataPort_hiBrush
Definition: Resource.hxx:292
static bool addRowCols
Definition: Resource.hxx:209
static QColor DataStreamPort_hiPen
Definition: Resource.hxx:298
static QColor ComposedNode_brush
Definition: Resource.hxx:275
static QColor control_link_select_color
Definition: Resource.hxx:264
static QColor EXECFAILED
Definition: Resource.hxx:247
static QColor FINISHED
Definition: Resource.hxx:232
static QColor UNDEFINED
Definition: Resource.hxx:236
static QColor INTERNALERR
Definition: Resource.hxx:249
static QColor progressBarColor
Definition: Resource.hxx:215
static int progressBarLabel
Definition: Resource.hxx:216
static QColor emphasizeBrushColor
Definition: Resource.hxx:225
static QColor DataStreamPort_pen
Definition: Resource.hxx:297
static QColor Scene_pen
Definition: Resource.hxx:271
static QColor link_draw_color
Definition: Resource.hxx:259
static QString userCatalog
Definition: Resource.hxx:207
static QColor DataPort_pen
Definition: Resource.hxx:293
static QColor LOADED
Definition: Resource.hxx:240
static QColor RUNNING
Definition: Resource.hxx:229
static QColor DataStreamPort_brush
Definition: Resource.hxx:295
static QColor stream_link_draw_color
Definition: Resource.hxx:260
static QColor READY
Definition: Resource.hxx:238
static int link_separation_weight
Definition: Resource.hxx:267
static QColor stream_link_select_color
Definition: Resource.hxx:262
static bool autoComputeLinks
Definition: Resource.hxx:211
static QColor DEFAULT
Definition: Resource.hxx:253
static QColor Header_hiPen
Definition: Resource.hxx:286
static QColor normalNodeBrushColor
Definition: Resource.hxx:220
static QColor TOACTIVATE
Definition: Resource.hxx:241
static QColor STOPPED
Definition: Resource.hxx:233
static QColor UNKNOWN
Definition: Resource.hxx:234
static QColor editedNodeBrushColor
Definition: Resource.hxx:219
static QColor ElementaryNode_brush
Definition: Resource.hxx:279
static QColor dragOver
Definition: Resource.hxx:300
static QColor validNodeColor
Definition: Resource.hxx:222
static QColor Header_pen
Definition: Resource.hxx:285
static QColor CtrlPort_pen
Definition: Resource.hxx:289
static QColor INITIALISED
Definition: Resource.hxx:228
static QColor ComposedNode_hiPen
Definition: Resource.hxx:278
static QColor runNodeBrushColor
Definition: Resource.hxx:221
static QColor LOADFAILED
Definition: Resource.hxx:246
static QColor ElementaryNode_hiBrush
Definition: Resource.hxx:280
static QColor SUSPENDED
Definition: Resource.hxx:245
static double link_thickness
Definition: Resource.hxx:268
static QColor ComposedNode_hiBrush
Definition: Resource.hxx:276
static QString pythonExternalEditor
Definition: Resource.hxx:208
static QColor invalidNodeColor
Definition: Resource.hxx:223
static QColor link_select_color
Definition: Resource.hxx:261
static bool ensureVisibleWhenMoved
Definition: Resource.hxx:213
static QColor CtrlPort_hiPen
Definition: Resource.hxx:290
static QColor Header_hiBrush
Definition: Resource.hxx:284
static QColor CtrlPort_brush
Definition: Resource.hxx:287
static QColor TOLOAD
Definition: Resource.hxx:239
static QColor DataPort_hiPen
Definition: Resource.hxx:294
static QColor ComposedNode_pen
Definition: Resource.hxx:277
static QColor ERROR
Definition: Resource.hxx:252
static QColor PAUSE
Definition: Resource.hxx:248
int integerValue(const QString &name, const int def=0) const
void setValue(const QString &name, const int val)
virtual void createPreferences(Yacsgui *swm)
QString stringValue(const QString &name, const QString &def=QString()) const
virtual void preferencesChanged()
QColor colorValue(const QString &name, const QColor &def=QColor()) const
Yacsgui_Resource(SUIT_ResourceMgr *r)
double doubleValue(const QString &name, const double def=0) const
QFont fontValue(const QString &name, const QFont &def=QFont()) const
bool booleanValue(const QString &name, const bool def=false) const
def h(x, y, destx, desty)
Definition: graph.py:272