Salome HOME
Base class for resource editor and one completed implementation.
[modules/gui.git] / src / Qtx / QtxResourceEditor.cxx
1 // File:      QtxResourceEditor.cxx
2 // Created:   
3 // Author:    Sergey TELKOV
4 // Copyright: 
5
6 #include "QtxResourceEditor.h"
7
8 /*
9   Class: QtxResourceEditor::Item
10   Descr: Class for incapsulation of one preference item
11 */
12
13 //=======================================================================
14 //function : Item
15 //purpose  : 
16 //=======================================================================
17
18 QtxResourceEditor::Item::Item( QtxResourceEditor* ed )
19 :myType( -1 ),
20 myEditor( ed )
21 {
22   myId = GenerateId();
23 }
24
25 //=======================================================================
26 //function : ~Item
27 //purpose  : 
28 //=======================================================================
29
30 QtxResourceEditor::Item::~Item()
31 {
32 }
33
34 //=======================================================================
35 //function : GetId
36 //purpose  : 
37 //=======================================================================
38
39 int QtxResourceEditor::Item::GetId() const
40 {
41   return myId;
42 }
43
44 //=======================================================================
45 //function : GetId
46 //purpose  : 
47 //=======================================================================
48
49 int QtxResourceEditor::Item::GetType() const
50 {
51   return myType;
52 }
53
54 //=======================================================================
55 //function : Set
56 //purpose  : 
57 //=======================================================================
58
59 void QtxResourceEditor::Item::Set( const QString& sect, const QString& name,
60                                    const int type, const QString& label )
61 {
62   myType  = type;
63   myName  = name;
64   myLabel = label;
65   mySection = sect;
66 }
67
68 //=======================================================================
69 //function : Get
70 //purpose  : 
71 //=======================================================================
72
73 QString QtxResourceEditor::Item::Get( QString& name, int& type, QString& label ) const
74 {
75   type = myType;
76   name = myName;
77   label = myLabel;
78   return mySection;
79 }
80
81 //=======================================================================
82 //function : SetList
83 //purpose  : 
84 //=======================================================================
85
86 void QtxResourceEditor::Item::SetList( const QValueList<int>&, const QStringList& )
87 {
88 }
89
90 //=======================================================================
91 //function : SetRange
92 //purpose  : 
93 //=======================================================================
94
95 void QtxResourceEditor::Item::SetRange( const double, const double, const double, const double )
96 {
97 }
98
99 //=======================================================================
100 //function : Update
101 //purpose  : default implementation do nothing
102 //=======================================================================
103
104 void QtxResourceEditor::Item::Update()
105 {
106 }
107
108 //=======================================================================
109 //function : 
110 //purpose  : 
111 //=======================================================================
112
113 bool QtxResourceEditor::Item::GetInteger( const QString& sect, const QString& name, int& val ) const
114 {
115   bool ok = resMgr() && resMgr()->hasValue( sect, name );
116   if( ok )
117     val = resMgr()->integerValue( sect, name );
118   return ok;
119 }
120
121 //=======================================================================
122 //function : 
123 //purpose  : 
124 //=======================================================================
125
126 bool QtxResourceEditor::Item::GetBoolean( const QString& sect, const QString& name, bool& val ) const
127 {
128   bool ok = resMgr() && resMgr()->hasValue( sect, name );
129   if( ok )
130     val = resMgr()->booleanValue( sect, name );
131   return ok;
132 }
133
134 //=======================================================================
135 //function : 
136 //purpose  : 
137 //=======================================================================
138
139 bool QtxResourceEditor::Item::GetDouble( const QString& sect, const QString& name, double& val ) const
140 {
141   bool ok = resMgr() && resMgr()->hasValue( sect, name );
142   if( ok )
143     val = resMgr()->doubleValue( sect, name );
144   return ok;
145 }
146
147 //=======================================================================
148 //function : 
149 //purpose  : 
150 //=======================================================================
151
152 bool QtxResourceEditor::Item::GetString( const QString& sect, const QString& name, QString& val ) const
153 {
154   bool ok = resMgr() && resMgr()->hasValue( sect, name );
155   if( ok )
156     val = resMgr()->stringValue( sect, name );
157   return ok;
158 }
159
160 //=======================================================================
161 //function : 
162 //purpose  : 
163 //=======================================================================
164
165 bool QtxResourceEditor::Item::GetColor( const QString& sect, const QString& name, QColor& val ) const
166 {
167   bool ok = resMgr() && resMgr()->hasValue( sect, name );
168   if( ok )
169     val = resMgr()->colorValue( sect, name );
170   return ok;
171 }
172
173 //=======================================================================
174 //function : 
175 //purpose  : 
176 //=======================================================================
177
178 void QtxResourceEditor::Item::SetInteger( const QString& sect, const QString& name, const int val )
179 {
180   if( resMgr() )
181     resMgr()->setValue( sect, name, val );
182 }
183
184 //=======================================================================
185 //function : 
186 //purpose  : 
187 //=======================================================================
188
189 void QtxResourceEditor::Item::SetBoolean( const QString& sect, const QString& name, const bool val )
190 {
191   if( resMgr() )
192     resMgr()->setValue( sect, name, val );
193 }
194
195 //=======================================================================
196 //function : 
197 //purpose  : 
198 //=======================================================================
199
200 void QtxResourceEditor::Item::SetDouble( const QString& sect, const QString& name, const double val )
201 {
202   if( resMgr() )
203     resMgr()->setValue( sect, name, val );
204 }
205
206 //=======================================================================
207 //function : 
208 //purpose  : 
209 //=======================================================================
210
211 void QtxResourceEditor::Item::SetString( const QString& sect, const QString& name, const QString& val )
212 {
213   if( resMgr() )
214     resMgr()->setValue( sect, name, val );
215 }
216
217 //=======================================================================
218 //function : 
219 //purpose  : 
220 //=======================================================================
221
222 void QtxResourceEditor::Item::SetColor( const QString& sect, const QString& name, const QColor& val )
223 {
224   if( resMgr() )
225     resMgr()->setValue( sect, name, val );
226 }
227
228 //=======================================================================
229 //function : 
230 //purpose  : 
231 //=======================================================================
232
233 QtxResourceMgr* QtxResourceEditor::Item::resMgr() const
234 {
235   return myEditor ? myEditor->resMgr() : NULL;
236 }
237
238 /*
239   Class: QtxResourceEditor::Group
240   Descr: Class for incapsulation of one group of preferences.
241 */
242
243 //=======================================================================
244 //function : Group
245 //purpose  : 
246 //=======================================================================
247
248 QtxResourceEditor::Group::Group( const QString& theName )
249 : myName( theName )
250 {
251 }
252
253 //=======================================================================
254 //function : ~Group
255 //purpose  : 
256 //=======================================================================
257
258 QtxResourceEditor::Group::~Group()
259 {
260 }
261
262 //=======================================================================
263 //function : GetName
264 //purpose  : 
265 //=======================================================================
266
267 QString QtxResourceEditor::Group::GetName() const
268 {
269   return myName;
270 }
271
272 //=======================================================================
273 //function : SetName
274 //purpose  : 
275 //=======================================================================
276
277 void QtxResourceEditor::Group::SetName( const QString& name )
278 {
279   myName = name;
280 }
281
282 //=======================================================================
283 //function : Add
284 //purpose  : 
285 //=======================================================================
286
287 int QtxResourceEditor::Group::Add( const QString& sect, const QString& name,
288                                    const int type, const QString& label )
289 {
290   int id = -1;
291   Item* item = createItem( type, label );
292   if ( item )
293   {
294     item->Set( sect, name, type, label );
295     myItems.append( item );
296     id = item->GetId();
297   }
298   return id;
299 }
300
301 //=======================================================================
302 //function : IsExist
303 //purpose  : 
304 //=======================================================================
305
306 bool QtxResourceEditor::Group::IsExist( const int id ) const
307 {
308   bool res = false;
309   for ( QPtrListIterator<Item> it( myItems ); it.current() && !res; ++it )
310     if ( it.current()->GetId() == id )
311       res = true;
312   return res;
313 }
314
315 //=======================================================================
316 //function : SetList
317 //purpose  : 
318 //=======================================================================
319
320 void QtxResourceEditor::Group::SetList( const int id, const QValueList<int>& ids,
321                                                 const QStringList& names )
322 {
323   Item* item = getItem( id );
324   if ( item )
325     item->SetList( ids, names );
326 }
327
328 //=======================================================================
329 //function : SetRange
330 //purpose  : 
331 //=======================================================================
332
333 void QtxResourceEditor::Group::SetRange( const int id, const double min, const double max,
334                                                  const double prec, const double step )
335 {
336   Item* item = getItem( id );
337   if ( item )
338     item->SetRange( min, max, prec, step );
339 }
340
341 //=======================================================================
342 //function : SetColumns
343 //purpose  : 
344 //=======================================================================
345
346 void QtxResourceEditor::Group::SetColumns( const int )
347 {
348 }
349
350 //=======================================================================
351 //function : SetTitle
352 //purpose  : 
353 //=======================================================================
354
355 void QtxResourceEditor::Group::SetTitle( const QString& )
356 {
357 }
358
359 //=======================================================================
360 //function : Store
361 //purpose  : 
362 //=======================================================================
363
364 void QtxResourceEditor::Group::Store()
365 {
366   for ( QPtrListIterator<Item> it( myItems ); it.current(); ++it )
367     it.current()->Store();
368 }
369
370 //=======================================================================
371 //function : Retrieve
372 //purpose  : 
373 //=======================================================================
374
375 void QtxResourceEditor::Group::Retrieve()
376 {
377   for ( QPtrListIterator<Item> it( myItems ); it.current(); ++it )
378     it.current()->Retrieve();
379 }
380
381 //=======================================================================
382 //function : Update
383 //purpose  : default implementation invoke update of all items
384 //=======================================================================
385
386 void QtxResourceEditor::Group::Update()
387 {
388   for ( QPtrListIterator<Item> it( myItems ); it.current(); ++it )
389     it.current()->Update();
390 }
391
392 //=======================================================================
393 //function : getItem
394 //purpose  : 
395 //=======================================================================
396
397 QtxResourceEditor::Item* QtxResourceEditor::Group::getItem( const int id ) const
398 {
399   Item* anItem = 0;
400   for ( QPtrListIterator<Item> it( myItems ); it.current() && !anItem; ++it )
401     if ( it.current()->GetId() == id )
402       anItem = it.current();
403   return anItem;
404 }
405
406 /*
407   Class: QtxResourceEditor::Tab
408   Descr: Class for incapsulation of one tab of preferences.
409 */
410
411 //=======================================================================
412 //function : Tab
413 //purpose  : 
414 //=======================================================================
415
416 QtxResourceEditor::Tab::Tab( const QString& name )
417 : myName( name )
418 {
419 }
420
421 //=======================================================================
422 //function : ~Tab
423 //purpose  : 
424 //=======================================================================
425
426 QtxResourceEditor::Tab::~Tab()
427 {
428 }
429
430 //=======================================================================
431 //function : Add
432 //purpose  : 
433 //=======================================================================
434
435 int QtxResourceEditor::Tab::Add( const QString& group, const QString& sect,
436                                  const QString& name, const int type, const QString& label )
437 {
438   Group* aGroup = getGroup( group );
439   if ( !aGroup )
440   {
441     aGroup = createGroup( group );
442     myGroups.append( aGroup );
443   }
444
445   if ( aGroup )
446     return aGroup->Add( sect, name, type, label );
447   else
448     return -1;
449 }
450
451 //=======================================================================
452 //function : GetName
453 //purpose  : 
454 //=======================================================================
455
456 QString QtxResourceEditor::Tab::GetName() const
457 {
458   return myName;
459 }
460
461 //=======================================================================
462 //function : SetList
463 //purpose  : 
464 //=======================================================================
465
466 void QtxResourceEditor::Tab::SetList( const int id, const QValueList<int>& ids,
467                                               const QStringList& names )
468 {
469   QString group;
470   if ( IsExist( id, group ) )
471   {
472     Group* aGroup = getGroup( group );
473     if ( aGroup )
474       aGroup->SetList( id, ids, names );
475   }
476 }
477
478 //=======================================================================
479 //function : SetRange
480 //purpose  : 
481 //=======================================================================
482
483 void QtxResourceEditor::Tab::SetRange( const int id, const double min, const double max,
484                                                const double prec, const double step )
485 {
486   QString group;
487   if ( IsExist( id, group ) )
488   {
489     Group* aGroup = getGroup( group );
490     if ( aGroup )
491       aGroup->SetRange( id, min, max, prec, step );
492   }
493 }
494
495 //=======================================================================
496 //function : getGroup
497 //purpose  : 
498 //=======================================================================
499
500 bool QtxResourceEditor::Tab::IsExist( const int id, QString& group ) const
501 {
502   Group* aGroup = 0;
503   for ( QPtrListIterator<Group> it( myGroups ); it.current() && !aGroup; ++it )
504     if ( it.current()->IsExist( id ) )
505       aGroup = it.current();
506
507   if ( aGroup )
508     group = aGroup->GetName();
509
510   return aGroup;
511 }
512
513 //=======================================================================
514 //function : SetColumns
515 //purpose  : 
516 //=======================================================================
517
518 void QtxResourceEditor::Tab::SetColumns( const QString& group, const int cols )
519 {
520   Group* aGroup = getGroup( group );
521   if ( aGroup )
522     aGroup->SetColumns( cols );
523 }
524
525 //=======================================================================
526 //function : SetTitle
527 //purpose  : 
528 //=======================================================================
529
530 void QtxResourceEditor::Tab::SetTitle( const QString& )
531 {
532 }
533
534 //=======================================================================
535 //function : SetTitle
536 //purpose  : 
537 //=======================================================================
538
539 void QtxResourceEditor::Tab::SetTitle( const QString& title, const QString& group )
540 {
541   Group* aGroup = getGroup( group );
542   if ( aGroup )
543     aGroup->SetTitle( title );
544 }
545
546 //=======================================================================
547 //function : Store
548 //purpose  : 
549 //=======================================================================
550
551 void QtxResourceEditor::Tab::Store()
552 {
553   for ( QPtrListIterator<Group> it( myGroups ); it.current(); ++it )
554     it.current()->Store();
555 }
556
557 //=======================================================================
558 //function : Retrieve
559 //purpose  : 
560 //=======================================================================
561
562 void QtxResourceEditor::Tab::Retrieve()
563 {
564   for ( QPtrListIterator<Group> it( myGroups ); it.current(); ++it )
565     it.current()->Retrieve();
566 }
567
568 //=======================================================================
569 //function : Update
570 //purpose  : default implementation invoke update of all groups
571 //=======================================================================
572
573 void QtxResourceEditor::Tab::Update()
574 {
575   for ( QPtrListIterator<Group> it( myGroups ); it.current(); ++it )
576     it.current()->Update();
577 }
578
579 //=======================================================================
580 //function : getGroup
581 //purpose  : 
582 //=======================================================================
583
584 QtxResourceEditor::Group* QtxResourceEditor::Tab::getGroup( const QString& name ) const
585 {
586   Group* aGroup = 0;
587   for ( QPtrListIterator<Group> it( myGroups ); it.current() && !aGroup; ++it )
588     if ( it.current()->GetName() == name )
589       aGroup = it.current();
590   return aGroup;
591 }
592
593 /*
594   Class: QtxResourceEditor::Category
595   Descr: Class for incapsulation of one tab widget of preferences.
596 */
597
598 //=======================================================================
599 //function : Category
600 //purpose  : 
601 //=======================================================================
602
603 QtxResourceEditor::Category::Category( const QString& name )
604 : myName( name )
605 {
606 }
607
608 //=======================================================================
609 //function : ~Category
610 //purpose  : 
611 //=======================================================================
612
613 QtxResourceEditor::Category::~Category()
614 {
615 }
616
617 //=======================================================================
618 //function : Add
619 //purpose  : 
620 //=======================================================================
621
622 int QtxResourceEditor::Category::Add( const QString& tab, const QString& group,
623                                       const QString& sect, const QString& name,
624                                       const int type, const QString& label )
625 {
626   Tab* aTab = getTab( tab );
627   if ( !aTab )
628   {
629     aTab = createTab( tab );
630     myTabs.append( aTab );
631   }
632
633   if ( aTab )
634     return aTab->Add( group, sect, name, type, label );
635   else
636     return -1;
637 }
638
639 //=======================================================================
640 //function : GetName
641 //purpose  : 
642 //=======================================================================
643
644 QString QtxResourceEditor::Category::GetName() const
645 {
646   return myName;
647 }
648
649 //=======================================================================
650 //function : SetList
651 //purpose  : 
652 //=======================================================================
653
654 void QtxResourceEditor::Category::SetList( const int id, const QValueList<int>& ids,
655                                                    const QStringList& names )
656 {
657   QString tab, group;
658   if ( IsExist( id, tab, group ) )
659   {
660     Tab* aTab = getTab( tab );
661     if ( aTab )
662       aTab->SetList( id, ids, names );
663   }
664 }
665
666 //=======================================================================
667 //function : SetRange
668 //purpose  : 
669 //=======================================================================
670
671 void QtxResourceEditor::Category::SetRange( const int id, const double min, const double max,
672                                                     const double prec, const double step )
673 {
674   QString tab, group;
675   if ( IsExist( id, tab, group ) )
676   {
677     Tab* aTab = getTab( tab );
678     if ( aTab )
679       aTab->SetRange( id, min, max, prec, step );
680   }
681 }
682
683 //=======================================================================
684 //function : getGroup
685 //purpose  : 
686 //=======================================================================
687
688 bool QtxResourceEditor::Category::IsExist( const int id, QString& tab, QString& group ) const
689 {
690   Tab* aTab = 0;
691   for ( QPtrListIterator<Tab> it( myTabs ); it.current() && !aTab; ++it )
692     if ( it.current()->IsExist( id, group ) )
693       aTab = it.current();
694
695   if ( aTab )
696     tab = aTab->GetName();
697
698   return aTab;
699 }
700
701 //=======================================================================
702 //function : SetColumns
703 //purpose  : 
704 //=======================================================================
705
706 void QtxResourceEditor::Category::SetColumns( const QString& tab, const QString& group, const int cols )
707 {
708   Tab* aTab = getTab( tab );
709   if ( aTab )
710     aTab->SetColumns( group, cols );
711 }
712
713 //=======================================================================
714 //function : SetTitle
715 //purpose  : 
716 //=======================================================================
717
718 void QtxResourceEditor::Category::SetTitle( const QString& )
719 {
720 }
721
722 //=======================================================================
723 //function : SetTitle
724 //purpose  : 
725 //=======================================================================
726
727 void QtxResourceEditor::Category::SetTitle( const QString& title, const QString& tab )
728 {
729   Tab* aTab = getTab( tab );
730   if ( aTab )
731     aTab->SetTitle( title );
732 }
733
734 //=======================================================================
735 //function : SetTitle
736 //purpose  : 
737 //=======================================================================
738
739 void QtxResourceEditor::Category::SetTitle( const QString& title, const QString& tab, const QString& group )
740 {
741   Tab* aTab = getTab( tab );
742   if ( aTab )
743     aTab->SetTitle( title, group );
744 }
745
746 //=======================================================================
747 //function : Store
748 //purpose  : 
749 //=======================================================================
750
751 void QtxResourceEditor::Category::Store()
752 {
753   for ( QPtrListIterator<Tab> it( myTabs ); it.current(); ++it )
754     it.current()->Store();
755 }
756
757 //=======================================================================
758 //function : Retrieve
759 //purpose  : 
760 //=======================================================================
761
762 void QtxResourceEditor::Category::Retrieve()
763 {
764   for ( QPtrListIterator<Tab> it( myTabs ); it.current(); ++it )
765     it.current()->Retrieve();
766 }
767
768 //=======================================================================
769 //function : Update
770 //purpose  : default implementation invoke update of all groups
771 //=======================================================================
772
773 void QtxResourceEditor::Category::Update()
774 {
775   for ( QPtrListIterator<Tab> it( myTabs ); it.current(); ++it )
776     it.current()->Update();
777 }
778
779 //=======================================================================
780 //function : getTab
781 //purpose  : 
782 //=======================================================================
783
784 QtxResourceEditor::Tab* QtxResourceEditor::Category::getTab( const QString& name ) const
785 {
786   Tab* aTab = 0;
787   for ( QPtrListIterator<Tab> it( myTabs ); it.current() && !aTab; ++it )
788     if ( it.current()->GetName() == name )
789       aTab = it.current();
790   return aTab;
791 }
792
793 /*
794   Class: QtxResourceEditor
795   Descr: Class for managing preferences items, also container of tabs
796 */
797
798 //=======================================================================
799 //function : QtxResourceEditor
800 //purpose  : 
801 //=======================================================================
802
803 QtxResourceEditor::QtxResourceEditor( QtxResourceMgr* mgr )
804 : myResMgr( mgr )
805 {
806 }
807
808 //=======================================================================
809 //function : ~QtxResourceEditor
810 //purpose  : 
811 //=======================================================================
812
813 QtxResourceEditor::~QtxResourceEditor()
814 {
815 }
816
817 //=======================================================================
818 //function : GenerateId
819 //purpose  : 
820 //=======================================================================
821
822 int QtxResourceEditor::GenerateId()
823 {
824   static int id = 1;
825   return id++;
826 }
827
828 //=======================================================================
829 //function : Add
830 //purpose  : 
831 //=======================================================================
832
833 int QtxResourceEditor::Add( const QString& cat, const QString& tab,
834                             const QString& group, const QString& sect,
835                             const QString& name, const int type, const QString& label )
836 {
837   Category* aCat = getCategory( cat );
838   if ( !aCat )
839   {
840     aCat = createCategory( cat );
841     myCategories.append( aCat );
842   }
843   return aCat->Add( tab, group, sect, name, type, label );
844 }
845
846 //=======================================================================
847 //function : IsExist
848 //purpose  : 
849 //=======================================================================
850
851 bool QtxResourceEditor::IsExist( const int id, QString& cat,
852                                          QString& tab, QString& group ) const
853 {
854   Category* aCat = 0;
855   for ( QPtrListIterator<Category> it( myCategories ); it.current() && !aCat; ++it )
856     if ( it.current()->IsExist( id, tab, group ) )
857       aCat = it.current();
858
859   if ( aCat )
860     cat = aCat->GetName();
861
862   return aCat;
863 }
864
865 //=======================================================================
866 //function : SetList
867 //purpose  : 
868 //=======================================================================
869
870 void QtxResourceEditor::SetList( const int id, const QValueList<int>& ids, const QStringList& names )
871 {
872   QString cat, tab, group;
873   if ( IsExist( id, cat, tab, group ) )
874   {
875     Category* aCat = getCategory( cat );
876     if ( aCat )
877       aCat->SetList( id, ids, names );
878   }
879 }
880
881 //=======================================================================
882 //function : SetRange
883 //purpose  : 
884 //=======================================================================
885
886 void QtxResourceEditor::SetRange( const int id, const double min, const double max,
887                                           const double prec, const double step )
888 {
889   QString cat, tab, group;
890   if ( IsExist( id, cat, tab, group ) )
891   {
892     Category* aCat = getCategory( cat );
893     if ( aCat )
894       aCat->SetRange( id, min, max, prec, step );
895   }
896 }
897
898 //=======================================================================
899 //function : SetColumns
900 //purpose  : 
901 //=======================================================================
902
903 void QtxResourceEditor::SetColumns( const QString& cat, const QString& tab,
904                                             const QString& group, const int cols )
905 {
906   Category* aCat = getCategory( cat );
907   if ( aCat )
908     aCat->SetColumns( tab, group, cols );
909 }
910
911 //=======================================================================
912 //function : SetTitle
913 //purpose  : 
914 //=======================================================================
915
916 void QtxResourceEditor::SetTitle( const QString& title, const QString& cat )
917 {
918   Category* aCat = getCategory( cat );
919   if ( aCat )
920     aCat->SetTitle( title );
921 }
922
923 //=======================================================================
924 //function : SetTitle
925 //purpose  : 
926 //=======================================================================
927
928 void QtxResourceEditor::SetTitle( const QString& title, const QString& cat, const QString& tab )
929 {
930   Category* aCat = getCategory( cat );
931   if ( aCat )
932     aCat->SetTitle( title, tab );
933 }
934
935 //=======================================================================
936 //function : SetTitle
937 //purpose  : 
938 //=======================================================================
939
940 void QtxResourceEditor::SetTitle( const QString& title, const QString& cat,
941                                           const QString& tab, const QString& group )
942 {
943   Category* aCat = getCategory( cat );
944   if ( aCat )
945     aCat->SetTitle( title, tab, group );
946 }
947
948 //=======================================================================
949 //function : Store
950 //purpose  : 
951 //=======================================================================
952
953 void QtxResourceEditor::Store()
954 {
955   for ( QPtrListIterator<Category> it( myCategories ); it.current(); ++it )
956     it.current()->Store();
957
958   //for ( QPtrListIterator<LH3DGui_PreferencesMgr> pmIt( myPrefMgrs ); pmIt.current(); ++pmIt )
959   //  pmIt.current()->UpdatePreferences();
960 }
961
962 //=======================================================================
963 //function : Retrieve
964 //purpose  : 
965 //=======================================================================
966
967 void QtxResourceEditor::Retrieve()
968 {
969   for ( QPtrListIterator<Category> it( myCategories ); it.current(); ++it )
970     it.current()->Retrieve();
971 }
972
973 //=======================================================================
974 //function : Update
975 //purpose  : invoke update of all tabs
976 //=======================================================================
977
978 void QtxResourceEditor::Update()
979 {
980   for ( QPtrListIterator<Category> it( myCategories ); it.current(); ++it )
981     it.current()->Update();
982 }
983
984 //=======================================================================
985 //function : getCategory
986 //purpose  : 
987 //=======================================================================
988
989 QtxResourceEditor::Category* QtxResourceEditor::getCategory( const QString& name ) const
990 {
991   Category* aCat = 0;
992   for ( QPtrListIterator<Category> it( myCategories ); it.current() && !aCat; ++it )
993     if ( it.current()->GetName() == name )
994       aCat = it.current();
995   return aCat;
996 }
997
998 //=======================================================================
999 //function : categories
1000 //purpose  : 
1001 //=======================================================================
1002
1003 const QtxResourceEditor::CategoryList& QtxResourceEditor::categories() const
1004 {
1005   return myCategories;
1006 }
1007
1008 //=======================================================================
1009 //function : categories
1010 //purpose  : 
1011 //=======================================================================
1012
1013 QtxResourceMgr* QtxResourceEditor::resMgr() const
1014 {
1015   return myResMgr;
1016 }