GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4QSettings.cpp
Go to the documentation of this file.
1 // $Id: TGo4QSettings.cpp 2851 2020-05-18 14:01:39Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4QSettings.h"
15 
16 #include "TSystem.h"
17 
18 #include "TGo4Marker.h"
19 #include "TGo4Condition.h"
20 #include "TGo4MdiArea.h"
21 
22 #include <QtCore/QSettings>
23 #include <QtCore/QDir>
24 #include <QFont>
25 #include <QApplication>
26 #include <QMainWindow>
27 
28 
29 const char* MainWindowDefaultState = "000000ff00000000fd00000002000000000000012500000198fc0200000001fb0000001600420072006f00770073006500720044006f0063006b0100000057000001980000007a00ffffff00000003000003d500000082fc0100000001fc00000000000003d50000007f00fffffffa000000000200000003fb00000016004c006f00670049006e0066006f0044006f0063006b0100000000ffffffff0000005300fffffffb0000001a004d006200730056006900650077006500720044006f0063006b0000000000ffffffff0000006500fffffffb0000001e0044004100420043004d006f006e00690074006f00720044006f0063006b0000000279000000ce0000000000000000000002aa0000019800000004000000040000000800000008fc0000000800000002000000040000001600460069006c00650054006f006f006c0042006100720100000000ffffffff0000000000000000000000160047006f00340054006f006f006c007300420061007201000000c8ffffffff00000000000000000000001e0041006e0061006c00790073006900730054006f006f006c004200610072010000020c0000025800000000000000000000001a0044006900760069006400650050006100640044006f0063006b0000000395000000e40000000000000000000000020000000000000002000000020000002400420072006f0077007300650072004f007000740069006f006e00730044006f0063006b01000000000000010200000000000000000000001e0044007200610077004f007000740069006f006e00730044006f0063006b01000001020000037e00000000000000000000000200000002000000240048006900730044007200610077004f007000740069006f006e00730044006f0063006b0000000000000001290000000000000000000000180047006f0034005300740079006c00650044006f0063006b0000000000000004b10000000000000000000000020000000100000020005300630061006c0065004f007000740069006f006e00730044006f0063006b0000000000000004b10000000000000000000000030000000000000003000000010000001e0043006f006d006d0061006e0064004c0069006e00650044006f0063006b0000000000000004b1000000000000000000000003000000010000001c00540072006500650056006900650077006500720044006f0063006b0000000000000004b10000000000000000";
30 
31 const char* MainWindowDefaultGeometry = "01d9d0cb00010000000000140000000c000003f0000002ba0000001800000029000003ec000002b6000000000000";
32 
34 
35 TGo4QSettings::TGo4QSettings(const QString& filename)
36 {
37  fSettFileName = filename;
38 
39  fUseWeb = false;
40 
41  Open();
42 }
43 
45 {
46  // do not destroy QSettings - they will be automatically saved
47  // delete sett;
48 }
49 
51 {
52  if (fSettFileName.length() > 0) return fSettFileName;
53 #ifdef WIN32
54  return QString("Registry (default)");
55 #endif
56 
57  return QDir::homePath() + "/.config/GSI/go4.conf (default)";
58 }
59 
60 
62 {
63  if (fSettFileName.length()>0)
64  sett = new QSettings(fSettFileName, QSettings::NativeFormat);
65  else
66  sett = new QSettings("GSI","go4");
67 }
68 
70 {
71  delete sett;
72  Open();
73 }
74 
75 void TGo4QSettings::setBool(const QString& name, bool value)
76 {
77  sett->setValue(name, QString(value ? "true" : "false"));
78 }
79 
80 bool TGo4QSettings::getBool(const QString& name, bool def)
81 {
82  return sett->value(name, QString(def ? "true" : "false")).toString() == QString("true");
83 }
84 
85 void TGo4QSettings::setInt(const QString& name, int value)
86 {
87  sett->setValue(name, value);
88 }
89 
90 int TGo4QSettings::getInt(const QString& name, int def)
91 {
92  return sett->value(name, def).toInt();
93 }
94 
95 void TGo4QSettings::setStr(const QString& name, const QString& value)
96 {
97  sett->setValue(name, value);
98 }
99 
100 QString TGo4QSettings::getStr(const QString& name, const QString& def)
101 {
102  return sett->value(name, def).toString();
103 }
104 
105 void TGo4QSettings::setDouble(const QString& name, double value)
106 {
107  sett->setValue(name, value);
108 }
109 
110 double TGo4QSettings::getDouble(const QString& name, double def)
111 {
112  return sett->value(name, def).toDouble();
113 }
114 
115 // set of Go4 specific functions
116 
118 {
119  //writeEntry( "/Font", QApplication::font().toString() );
120  Bool_t HASLABEL, HASCONNECTOR, XDRAW, YDRAW, XBINDRAW, YBINDRAW, CONTDRAW;
121  TString NUMFORMAT;
122  TGo4Marker::GetGlobalStyle(HASLABEL, HASCONNECTOR, XDRAW, YDRAW,
123  XBINDRAW, YBINDRAW, CONTDRAW, NUMFORMAT);
124 
125  setBool("/markers/Markerlabel", HASLABEL);
126  setBool("/markers/Connectorline", HASCONNECTOR);
127  setBool("/markers/ShowX", XDRAW);
128  setBool("/markers/ShowY", YDRAW);
129  setBool("/markers/ShowXbin", XBINDRAW);
130  setBool("/markers/ShowYbin", YBINDRAW);
131  setBool("/markers/ShowBinContent", CONTDRAW);
132  setStr("/markers/LabelNumberFormat", NUMFORMAT.Data());
133 
134  Bool_t LABELDRAW, LIMITSDRAW, INTDRAW,
135  XMEANDRAW, YMEANDRAW, XRMSDRAW, YRMSDRAW,
136  XMAXDRAW, YMAXDRAW, CMAXDRAW;
137  TGo4Condition::GetGlobalStyle(LABELDRAW, LIMITSDRAW, INTDRAW,
138  XMEANDRAW, YMEANDRAW, XRMSDRAW, YRMSDRAW,
139  XMAXDRAW, YMAXDRAW, CMAXDRAW, NUMFORMAT);
140  setBool("/conditions/Conditionlabel", LABELDRAW);
141  setBool("/conditions/ShowLimits", LIMITSDRAW);
142  setBool("/conditions/ShowIntegral", INTDRAW);
143  setBool("/conditions/ShowXmean", XMEANDRAW);
144  setBool("/conditions/ShowYmean", YMEANDRAW);
145  setBool("/conditions/ShowXrms", XRMSDRAW);
146  setBool("/conditions/ShowYrms", YRMSDRAW);
147  setBool("/conditions/ShowXmax", XMAXDRAW);
148  setBool("/conditions/ShowYmax", YMAXDRAW);
149  setBool("/conditions/ShowCmax", CMAXDRAW);
150  setStr("/conditions/LabelNumberFormat", NUMFORMAT.Data());
151 }
152 
154 {
155  // QString AppStyle = readEntry( "/Style/AppStyle", "windows");
156  // QApplication::setStyle(AppStyle);
157 
158  // QFont font;
159  // font.fromString(readEntry( "/Font", "Arial,11,-1,5,50,0,0,0,0,0"));
160  // QApplication::setFont(font, true );
161 
162  TGo4Marker::SetGlobalStyle(getBool("/markers/Markerlabel", 1),
163  getBool("/markers/Connectorline", 1),
164  getBool("/markers/ShowX", 1),
165  getBool("/markers/ShowY", 0),
166  getBool("/markers/ShowXbin", 0),
167  getBool("/markers/ShowYbin", 0),
168  getBool("/markers/ShowBinContent", 1),
169  getStr("/markers/LabelNumberFormat", "%.4E").toLatin1().constData());
170 
171  TGo4Condition::SetGlobalStyle(getBool("/conditions/Conditionlabel", 1),
172  getBool("/conditions/ShowLimits", 1),
173  getBool("/conditions/ShowIntegral", 1),
174  getBool("/conditions/ShowXmean", 1),
175  getBool("/conditions/ShowYmean", 0),
176  getBool("/conditions/ShowXrms", 1),
177  getBool("/conditions/ShowYrms", 0),
178  getBool("/conditions/ShowXmax", 1),
179  getBool("/conditions/ShowYmax", 0),
180  getBool("/conditions/ShowCmax", 1),
181  getStr("/conditions/LabelNumberFormat", "%.4E").toLatin1().constData());
182 }
183 
184 
185 void TGo4QSettings::setAppFont(const QFont& font)
186 {
187  setStr("/Font", font.toString());
188 }
189 
191 {
192  QFont font;
193  font.fromString(getStr("/Font", "Arial,11,-1,5,50,0,0,0,0,0"));
194  QApplication::setFont(font);
195 }
196 
197 void TGo4QSettings::setTermFont(const QFont& font)
198 {
199  setStr("/TermFont", font.toString());
200 
201 }
203 {
204  QFont font;
205 // font.fromString(getStr("/TermFont", "Arial,11,-1,5,50,0,0,0,0,0"));
206  font.fromString(getStr("/TermFont", ""));
207  return font;
208 }
209 
210 void TGo4QSettings::setAppStyle(const QString& v)
211 {
212  setStr("/Style/AppStyle", v);
213 }
214 
216 {
217  return getStr("/Style/AppStyle", "windows");
218 }
219 
220 void TGo4QSettings::setClientName(const QString& v)
221 {
222  setStr("/ClientSetting/Name", v);
223 }
224 
226 {
227  return getStr("/ClientSetting/Name", "MyAnalysis");
228 }
229 
230 void TGo4QSettings::setClientNode(const QString& v)
231 {
232  setStr( "/ClientSetting/Node", v);
233 }
234 
236 {
237  return getStr("/ClientSetting/Node", "localhost");
238 }
239 
240 void TGo4QSettings::setClientDir(const QString& v)
241 {
242  setStr("/ClientSetting/Dir", v);
243 }
244 
246 {
247  return getStr("/ClientSetting/Dir", QDir::currentPath());
248 }
249 
251 {
252  setInt("/ClientSetting/ExeMode", mode);
253 }
254 
256 {
257  return getInt("/ClientSetting/ExeMode", 1);
258 }
259 
260 void TGo4QSettings::setClientExec(const QString& v)
261 {
262  if (getClientExeMode()==0) setStr("/ClientSetting/Exec", v);
263  else setStr("/ClientSetting/Lib", v);
264 }
265 
267 {
268  if (mode<0) mode = getClientExeMode();
269  return mode==0 ? getStr("/ClientSetting/Exec", "./MainUserAnalysis") : getStr("/ClientSetting/Lib", "libGo4UserAnalysis");
270 }
271 
272 void TGo4QSettings::setClientArgs(const QString& v)
273 {
274  setStr("/ClientSetting/Args", v);
275 }
276 
278 {
279  return getStr("/ClientSetting/Args", "");
280 }
281 
283 {
284  const char* name = "exec";
285  switch (v) {
286  case 0: name = "exec"; break;
287  case 1: name = "rsh"; break;
288  case 2: name = "ssh"; break;
289  }
290 
291  setStr( "/ClientSetting/Shell", name);
292 }
293 
295 {
296  return getStr("/ClientSetting/Shell", "exec");
297 }
298 
300 {
301  QString v = getClientShell();
302  int shellmode = 2;
303  if(v.contains("exec")) shellmode = 0; else
304  if(v.contains("rsh")) shellmode = 1; else
305  if(v.contains("ssh")) shellmode = 2;
306  return shellmode;
307 }
308 
309 
311 {
312  QString res = "qt";
313  switch(v) {
314  case 1: res = "qt"; break;
315  case 2: res = "xterm"; break;
316  case 3: res = "konsole"; break;
317  }
318  setStr("/ClientSetting/Term", res);
319 }
320 
322 {
323  return getStr("/ClientSetting/Term", "qt");
324 }
325 
327 {
328  QString v = getClientTerm();
329  int termmode = 1;
330  if(v.contains("qt")) termmode = 1; else
331  if(v.contains("xterm")) termmode = 2; else
332  if(v.contains("konsole")) termmode = 3;
333  return termmode;
334 }
335 
337 {
338  QString v = "false";
339  if (kind==1) v = "true";
340  if (kind==2) v = "http";
341  setStr("/ClientSetting/IsServer", v);
342 }
343 
345 {
346  QString v = getStr("/ClientSetting/IsServer", "false");
347  if (v == "true") return 1;
348  if (v == "http") return 2;
349  return 0;
350 }
351 
353 {
354  setInt( "/ClientSetting/ClientPort", nport);
355 }
356 
358 {
359  return getInt( "/ClientSetting/ClientPort", 5000);
360 }
361 
363 {
364  setInt( "/ClientSetting/Controller", mode);
365 }
366 
368 {
369  return getInt( "/ClientSetting/Controller", 0);
370 }
371 
373 {
374  setBool( "/ClientSetting/DefaultPass", on);
375 }
376 
378 {
379  return getBool( "/ClientSetting/DefaultPass", true);
380 }
381 
383 {
384  setInt( "/ClientSetting/Connection", mode);
385 }
386 
388 {
389  return getInt( "/ClientSetting/Connection", 0);
390 }
391 
393  {
394  return getStr( "/ClientSetting/Account", "observer");
395  }
396 
398 {
399  setStr( "/ClientSetting/Account", v);
400 }
401 
402 
403 
405 {
406  setInt( "/AnalisysTerminal/HistorySize", sz);
407 }
408 
410 {
411  return getInt( "/AnalisysTerminal/HistorySize", 100000);
412 }
413 
414 void TGo4QSettings::setHServName(const QString& v)
415 {
416  setStr( "/HistogramClient/server", v);
417 }
418 
420 {
421  return getStr( "/HistogramClient/server", "");
422 }
423 
424 void TGo4QSettings::setHServBase(const QString& v)
425 {
426  setStr( "/HistogramClient/base", v);
427 }
428 
430 {
431  return getStr( "/HistogramClient/base", "");
432 }
433 
434 void TGo4QSettings::setHServFilter(const QString& v)
435 {
436  setStr( "/HistogramClient/filter", v);
437 }
438 
440 {
441  return getStr( "/HistogramClient/filter", "*");
442 }
443 
445 {
446  setInt( "/HistogramClient/port", port);
447 }
448 
450 {
451  return getInt( "/HistogramClient/port", 6009);
452 }
453 
454 
456 {
457  setBool( "/geometry/Crosshairmode", on);
458 }
459 
461 {
462  return getBool( "/geometry/Crosshairmode", false);
463 }
464 
466 {
467  setBool( "/geometry/Superimpose", on);
468 }
469 
471 {
472  return getBool( "/geometry/Superimpose", false);
473 }
474 
476 {
477  setBool( "/geometry/Eventstatusmode", on);
478 }
479 
481 {
482  return getBool("/geometry/Eventstatusmode", false);
483 }
484 
485 void TGo4QSettings::setCanvasColor(int red, int green, int blue)
486 {
487  setInt( "/ViewPanel/BackRed", red );
488  setInt( "/ViewPanel/BackGrn", green);
489  setInt( "/ViewPanel/BackBlu", blue );
490 }
491 
492 void TGo4QSettings::getCanvasColor(int& red, int& green, int& blue)
493 {
494  red = getInt( "/ViewPanel/BackRed", 220);
495  green = getInt( "/ViewPanel/BackGrn", 220);
496  blue = getInt( "/ViewPanel/BackBlu", 220);
497 }
498 
499 
500 void TGo4QSettings::setPaletteOpt(int min, int def, int max)
501 {
502  setInt( "/ViewPanel/PaletteMin", min);
503  setInt( "/ViewPanel/PaletteDef", def);
504  setInt( "/ViewPanel/PaletteMax", max);
505 }
506 
507 void TGo4QSettings::getPaletteOpt(int& min, int& def, int& max)
508 {
509  min = getInt( "/ViewPanel/PaletteMin", 0);
510  def = getInt( "/ViewPanel/PaletteDef", 1);
511  max = getInt( "/ViewPanel/PaletteMax", 56);
512 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,5,0)
513  if (max==56) max = 112; // default values for old ROOT can be overwritten
514 #endif
515 }
516 
518 {
519  setBool("/ViewPanel/CloneFlag", on);
520 }
521 
523 {
524  return getBool( "/ViewPanel/CloneFlag", true);
525 }
526 
528 {
529  setBool("/ViewPanel/DrawOnce", on);
530 }
531 
533 {
534  return getBool("/ViewPanel/DrawOnce", false);
535 }
536 
538 {
539  setBool("/ViewPanel/DrawTime", on);
540 }
541 
543 {
544  return getBool("/ViewPanel/DrawTime", true);
545 }
546 
548 {
549  setBool("/ViewPanel/DrawDate", on);
550 }
551 
553 {
554  return getBool("/ViewPanel/DrawDate");
555 }
556 
558 {
559  setBool("/ViewPanel/DrawItem", on);
560 }
561 
563 {
564  return getBool("/ViewPanel/DrawItem");
565 }
566 
568 {
569  setInt("/ViewPanel/DrawLineWidth", w);
570 }
571 
573 {
574  return getInt("/ViewPanel/DrawLineWidth", 1);
575 }
576 
578 {
579  setInt("/ViewPanel/DrawFillColor", col);
580 }
581 
583 {
584  return getInt("/ViewPanel/DrawFillColor", 0);
585 }
586 
588 {
589  setInt("/ViewPanel/DrawFillStyle", style);
590 }
592 {
593  return getInt("/ViewPanel/DrawFillStyle", 1001);
594 }
595 
596 
597 
598 void TGo4QSettings::setTH1DrawOpt(const QString& v)
599 {
600  setStr("/ViewPanel/TH1DrawOpt", v);
601 }
602 
604 {
605  return getStr("/ViewPanel/TH1DrawOpt", "hist");
606 }
607 
608 void TGo4QSettings::setTH2DrawOpt(const QString& v)
609 {
610  setStr("/ViewPanel/TH2DrawOpt", v);
611 }
612 
614 {
615  return getStr("/ViewPanel/TH2DrawOpt", "col");
616 }
617 
618 void TGo4QSettings::setTH3DrawOpt(const QString& v)
619 {
620  setStr("/ViewPanel/TH3DrawOpt", v);
621 }
622 
624 {
625  return getStr("/ViewPanel/TH3DrawOpt", "hist");
626 }
627 
628 void TGo4QSettings::setTGraphDrawOpt(const QString& v)
629 {
630  setStr("/ViewPanel/TGraphDrawOpt", v);
631 }
632 
634 {
635  return getStr("/ViewPanel/TGraphDrawOpt", "al");
636 }
637 
639 {
640  setStr("/ViewPanel/GStyleStatFormat", v);
641 
642 }
643 
645 {
646  return getStr("/ViewPanel/GStyleStatFormat", "");
647 }
648 
650 {
651  tgt->restoreState(sett->value("/MainWindow/State", QByteArray::fromHex(MainWindowDefaultState)).toByteArray());
652 
653  tgt->restoreGeometry(sett->value("/MainWindow/Geometry", QByteArray::fromHex(MainWindowDefaultGeometry)).toByteArray());
654 }
655 
657 {
658  sett->setValue("/MainWindow/State", src->saveState());
659 
660  sett->setValue("/MainWindow/Geometry", src->saveGeometry());
661 }
662 
663 void TGo4QSettings::storePanelSize(QWidget* w, const QString& kind)
664 {
665  setInt(QString("/") + kind + QString("/Width"), w->width() );
666  setInt(QString("/") + kind + QString("/Height"), w->height() );
667 }
668 
669 QSize TGo4QSettings::lastPanelSize(const QString& kind, int dfltwidth, int dfltheight)
670 {
671  QSize rect(getInt(QString("/") + kind + QString("/Width"), dfltwidth),
672  getInt(QString("/") + kind + QString("/Height"), dfltheight));
673 
674  if (rect.height() > 1.5*TGo4MdiArea::Instance()->height())
675  rect.setHeight(1.5*TGo4MdiArea::Instance()->height());
676 
677  if (rect.width() > 1.5*TGo4MdiArea::Instance()->width())
678  rect.setWidth(1.5*TGo4MdiArea::Instance()->width());
679 
680  return rect;
681 }
682 
683 void TGo4QSettings::setBrowserColumn(const char* name, int width)
684 {
685  setInt( QString("/Browser/") + name, width);
686 }
687 
688 int TGo4QSettings::getBrowserColumn(const char* name, int defwidth)
689 {
690  return getInt( QString("/Browser/") + name, defwidth);
691 }
692 
693 
695 {
696  setInt( "/HistStatsBox/OptStats", value);
697 }
698 
700 {
701  return getInt( "/HistStatsBox/OptStats", 11111111);
702 }
703 
705 {
706  setInt( "/HistStatsBox/OptStatsW", value);
707 }
708 
710 {
711  return getInt( "/HistStatsBox/OptStatsW", 0);
712 }
713 
715 {
716  setInt( "/HistStatsBox/OptStatsH", value);
717 }
718 
720 {
721  return getInt( "/HistStatsBox/OptStatsH", 0);
722 }
723 
725 {
726  setBool( "/HistStatsBox/Visible", on);
727 }
728 
730 {
731  return getBool( "/HistStatsBox/Visible", true);
732 }
733 
735 {
736  setBool( "/HistStatsBox/Errors", on);
737 }
738 
740 {
741  return getBool( "/HistStatsBox/Errors", false);
742 }
743 
744 void TGo4QSettings::setHistName(const QString& value)
745 {
746  setStr("/NewHist/Name", value);
747 }
748 
750 {
751  return getStr("/NewHist/Name", "histo1");
752 }
753 
754 void TGo4QSettings::setHistTitle(const QString& value)
755 {
756  setStr("/NewHist/Title", value);
757 }
758 
760 {
761  return getStr("/NewHist/Title", "histogram title");
762 }
763 
765 {
766  setInt( "/NewHist/HType", value);
767 }
768 
770 {
771  return getInt( "/NewHist/HType", 14);
772 }
773 
774 void TGo4QSettings::setHistAxisPars(int naxis, int npoints, double min, double max)
775 {
776  QString sname = "/NewHist/Axis";
777  switch (naxis) {
778  case 0: sname+="X_"; break;
779  case 1: sname+="Y_"; break;
780  case 2: sname+="Z_"; break;
781  default: sname+="X_"; break;
782  }
783  setInt(sname+"NPoints", npoints);
784  setDouble(sname+"Min", min);
785  setDouble(sname+"Max", max);
786 }
787 
788 void TGo4QSettings::getHistAxisPars(int naxis, int& npoints, double& min, double& max)
789 {
790  QString sname = "/NewHist/Axis";
791  switch (naxis) {
792  case 0: sname+="X_"; break;
793  case 1: sname+="Y_"; break;
794  case 2: sname+="Z_"; break;
795  default: sname+="X_"; break;
796  }
797  npoints = getInt(sname+"NPoints", 100);
798  min = getDouble(sname+"Min", 0.);
799  max = getDouble(sname+"Max", 100.);
800 }
801 
803 {
804  setBool("/preferences/FetchWhenDraw", on);
805 }
806 
808 {
809  return getBool("/preferences/FetchWhenDraw", true);
810 }
811 
813 {
814  setBool("/preferences/FetchWhenCopy", on);
815 }
816 
818 {
819  return getBool("/preferences/FetchWhenCopy", false);
820 }
821 
823 {
824  setBool("/preferences/FetchWhenSave", on);
825 }
826 
828 {
829  return getBool("/preferences/FetchWhenSave", false);
830 }
831 
833 {
834  setBool("/preferences/HideEventElement", on);
835 }
836 
838 {
839  return getBool("/preferences/HideEventElement", false);
840 }
841 
842 
844 {
845  setBool("/preferences/MoveSubwindowRubberBand", on);
846 }
847 
849 {
850  return getBool("/preferences/MoveSubwindowRubberBand", true);
851 }
852 
853 void TGo4QSettings::setRemoteFileSett(const QString& hostname, const QString& filename, const QString& protocol)
854 {
855  setStr( "/OpenRemoteFile/Host", hostname);
856  setStr( "/OpenRemoteFile/File", filename);
857  setStr( "/OpenRemoteFile/Type", protocol);
858 }
859 
860 void TGo4QSettings::getRemoteFileSett(QString& hostname, QString& filename, QString& protocol)
861 {
862  hostname = getStr( "/OpenRemoteFile/Host", "machine.gsi.de");
863  filename = getStr( "/OpenRemoteFile/File", "tmp/hsimple.root");
864  protocol = getStr( "/OpenRemoteFile/Type", "root:");
865 }
866 
867 void TGo4QSettings::setPrinterSett(const QString& name, const QString& cmd)
868 {
869  setStr( "/Printer/Name", name);
870  setStr( "/Printer/Prog", cmd);
871 }
872 
873 void TGo4QSettings::getPrinterSett(QString& name, QString& cmd)
874 {
875  name = getStr( "/Printer/Name", gSystem->Getenv("PRINTER"));
876  cmd = getStr( "/Printer/Prog","lpr");
877 }
878 
879 void TGo4QSettings::setMbsMonitorNode(const QString& name)
880 {
881  setStr( "/MbsMonitor/Node", name);
882 }
883 
885 {
886  return getStr( "/MbsMonitor/Node", "r2-d2");
887 }
888 
890 {
891  setInt( "/MbsMonitor/Frequency", secs);
892 }
893 
895 {
896  return getInt( "/MbsMonitor/Frequency", 5);
897 }
898 
900 {
901  setInt( "/MbsMonitor/Bins", num);
902 }
903 
905 {
906  return getInt( "/MbsMonitor/Bins", 200);
907 }
908 
910 {
911  setBool( "/MbsMonitor/TrendOn", on);
912 }
913 
915 {
916  return getBool("/MbsMonitor/TrendOn", false);
917 }
918 
920 {
921  setBool("/MbsMonitor/ShowMore", on);
922 }
923 
925 {
926  return getBool("/MbsMonitor/ShowMore", true);
927 }
928 
930 {
931  setBool("/MbsMonitor/MonitorActive", on);
932 }
933 
935 {
936  return getBool("/MbsMonitor/MonitorActive", false);
937 }
938 
940 {
941  setBool("/MbsMonitor/BackwardsTrending", on);
942 }
943 
945 {
946  return getBool("/MbsMonitor/BackwardsTrending", true);
947 }
948 
949 void TGo4QSettings::setDabcMonitorNode(const QString& name)
950 {
951  setStr( "/DabcMonitor/Node", name);
952 }
953 
955 {
956  return getStr( "/DabcMonitor/Node", "dimDns.gsi.de");
957 }
958 
960 {
961  setInt( "/DabcMonitor/Frequency", secs);
962 }
963 
965 {
966  return getInt( "/DabcMonitor/Frequency", 5);
967 }
968 
970 {
971  setInt( "/DabcMonitor/Bins", num);
972 }
973 
975 {
976  return getInt( "/DabcMonitor/Bins", 200);
977 }
978 
980 {
981  setBool("/DabcMonitor/BackwardsTrending", on);
982 }
983 
985 {
986  return getBool("/DabcMonitor/BackwardsTrending", true);
987 }
988 
990 {
991  return sett->value("/CommandsHistoryGUI").toStringList();
992 }
993 
994 void TGo4QSettings::setCommandsHistoryGUI(const QStringList & commands)
995 {
996  sett->setValue("/CommandsHistoryGUI", commands);
997 }
998 
1000 {
1001  return sett->value("/CommandsHistoryAnalysis").toStringList();
1002 }
1003 
1004 void TGo4QSettings::setCommandsHistoryAnalysis(const QStringList & commands)
1005 {
1006  sett->setValue("/CommandsHistoryAnalysis", commands);
1007 }
1008 
1010 
1012 {
1013  QString descriptor=QString("/AnalysisMacro%1/Command").arg(id);
1014 
1015  return getStr(descriptor, "");
1016 }
1017 
1019 {
1020  QString descriptor=QString("/AnalysisMacro%1/Tip").arg(id);
1021  QString deftip=QString("Ctrl - %1").arg(id+1);
1022  return getStr(descriptor, deftip);
1023 }
1024 
1026 {
1027  QString descriptor=QString("/AnalysisMacro%1/Automode").arg(id);
1028  return getBool(descriptor, false);
1029 }
1030 
1032 {
1033  QString descriptor=QString("/AnalysisMacro%1/Automode").arg(id);
1034  setBool(descriptor, on);
1035 }
1036 
1037 
1038 void TGo4QSettings::setAnalysisMacroCommand(int id, const QString& com)
1039 {
1040  QString descriptor=QString("/AnalysisMacro%1/Command").arg(id);
1041  setStr(descriptor, com);
1042 }
1043 
1044 void TGo4QSettings::setAnalysisMacroTip(int id, const QString& com)
1045 {
1046  QString descriptor=QString("/AnalysisMacro%1/Tip").arg(id);
1047  setStr(descriptor, com);
1048 }
1049 
1051 {
1052  return getDouble("/Screen/ScaleFactor", 1.0);
1053 }
1055 {
1056  setDouble( "/Screen/ScaleFactor", factor);
1057 }
1058 
1060 {
1061  return getBool("/ViewPanel/SavePadWhiteBackground" , false);
1062 
1063 }
1064 
1066 {
1067 
1068  setBool("/ViewPanel/SavePadWhiteBackground", on);
1069 }
1070 
1072 {
1073  return getBool("/AnalisysTerminal/ShowTimestamp", false);
1074 }
1075 
1077 {
1078  setBool("/AnalisysTerminal/ShowTimestamp", on);
1079 }
1080 
1082 {
1083  return getStr( "/AnalisysTerminal/TimeFormat", "yyyy-MM-dd hh mm:ss.zzz");
1084 }
1085 
1086 void TGo4QSettings::setTermTimeFormat(const QString& form)
1087 {
1088  setStr( "/AnalisysTerminal/TimeFormat", form);
1089 }
1090 
void setClientControllerMode(int)
void setDrawDateFlag(bool on=true)
QString getClientDir()
QString GetSettLoaction()
void setScreenScaleFactor(double factor)
bool getSavePadWhiteBackground()
void setDabcMonitorNode(const QString &name)
QSettings * sett
Definition: TGo4QSettings.h:38
QString getAppStyle()
void setDouble(const QString &name, double value=0.)
QString getTGraphDrawOpt()
void getRemoteFileSett(QString &hostname, QString &filename, QString &protocol)
static void GetGlobalStyle(Bool_t &LABELDRAW, Bool_t &LIMITSDRAW, Bool_t &INTDRAW, Bool_t &XMEANDRAW, Bool_t &YMEANDRAW, Bool_t &XRMSDRAW, Bool_t &YRMSDRAW, Bool_t &XMAXDRAW, Bool_t &YMAXDRAW, Bool_t &CMAXDRAW, TString &NUMFORMAT)
int getClientShellMode()
void setPrinterSett(const QString &name, const QString &cmd)
QString getClientAccountName()
void setClientExeMode(int mode)
QStringList getCommandsHistoryAnalysis()
void storeMainWindowState(QMainWindow *src)
void setCommandsHistoryAnalysis(const QStringList &commands)
QString getClientShell()
void setStatBoxErrors(bool on=true)
void setClientArgs(const QString &)
bool getStatBoxVisible()
void setTH1DrawOpt(const QString &value)
void setHideTGo4EventElement(bool on=true)
bool getDrawOnceFlag()
double getScreenScaleFactor()
void setMbsMonitorMonitorActive(bool on=true)
void setMbsMonitorTrend(bool on=true)
void setClientAccountName(const QString &)
void setAnalysisMacroTip(int id, const QString &com)
void setClientDir(const QString &)
void setFetchDataWhenCopy(bool on=true)
TGo4QSettings(const QString &filename)
void getCanvasColor(int &red, int &green, int &blue)
void setHistType(int value)
QString getClientName()
void setPadEventStatus(bool on)
QString fSettFileName
Definition: TGo4QSettings.h:41
bool getFetchDataWhenCopy()
QString getTermTimeFormat()
static TGo4MdiArea * Instance()
Definition: TGo4MdiArea.cpp:26
void setDrawFillColor(int col)
void setPaletteOpt(int min, int def, int max)
bool getDrawItemFlag()
void storePanelSize(QWidget *w, const QString &kind="ViewPanel")
void setHServFilter(const QString &)
void setOptStat(int value)
QString getClientExec(int mode=-1)
void setStr(const QString &name, const QString &value="")
void setDabcMonitorFreq(int secs)
void setBasicSettings()
void setClientName(const QString &)
bool getPadCrosshair()
void setTH3DrawOpt(const QString &value)
void setClientTermMode(int)
void setDabcMonitorBins(int num)
QString getStr(const QString &name, const QString &value="")
void setDabcMonitorBackwardsTrending(bool on=true)
QString getTH2DrawOpt()
void setSavePadWhiteBackground(bool on)
int getClientControllerMode()
void setClientShellMode(int)
void setTermHistorySize(int sz)
QString getHistName()
bool getBool(const QString &name, bool def=true)
QString getHServName()
bool getPadSuperimpose()
bool getDrawTimeFlag()
void getHistAxisPars(int naxis, int &npoints, double &min, double &max)
void setBool(const QString &name, bool value=true)
static void SetGlobalStyle(Bool_t HASLABEL, Bool_t HASCONNECTOR, Bool_t XDRAW, Bool_t YDRAW, Bool_t XBINDRAW, Bool_t YBINDRAW, Bool_t CONTDRAW, const char *NUMFORMAT)
Definition: TGo4Marker.cxx:282
QString getHServFilter()
void setFetchDataWhenDraw(bool on=true)
void setCloneFlag(bool on=true)
void setClientPort(int)
void setClientIsServer(int kind)
void setPadCrosshair(bool on)
static void SetGlobalStyle(Bool_t LABELDRAW, Bool_t LIMITSDRAW, Bool_t INTDRAW, Bool_t XMEANDRAW, Bool_t YMEANDRAW, Bool_t XRMSDRAW, Bool_t YRMSDRAW, Bool_t XMAXDRAW, Bool_t YMAXDRAW, Bool_t CMAXDRAW, const char *NUMFORMAT)
bool getAnalysisMacroAutomode(int id)
void setBrowserColumn(const char *name, int width)
void getBasicSettings()
bool getMbsMonitorMonitorActive()
void setHServPort(int port)
bool getTermShowTimestamp()
QString getClientArgs()
void setHistAxisPars(int naxis, int npoints, double min, double max)
double getDouble(const QString &name, double value=0.)
void setTermFont(const QFont &)
int getInt(const QString &name, int def=0)
void setAppStyle(const QString &)
void setDrawLineWidth(int w=1)
void setHistName(const QString &value)
bool getMbsMonitorTrend()
bool getMbsMonitorMore()
int getDabcMonitorBins()
int getClientConnectMode()
QString getAnalysisMacroCommand(int id)
virtual ~TGo4QSettings()
void setMbsMonitorNode(const QString &name)
void setDrawOnceFlag(bool on=true)
TGo4QSettings * go4sett
void setAnalysisMacroCommand(int id, const QString &com)
QString getDabcMonitorNode()
bool getFetchDataWhenSave()
void setAnalysisMacroAutomode(int id, bool on)
void setHistTitle(const QString &value)
void setFetchDataWhenSave(bool on=true)
bool getPadEventStatus()
bool getStatBoxErrors()
void setRemoteFileSett(const QString &hostname, const QString &filename, const QString &protocol)
void restoreMainWindowState(QMainWindow *tgt)
QString getTH1DrawOpt()
bool getFetchDataWhenDraw()
void setMoveSubwindowRubberBand(bool on=true)
bool getMbsMonitorBackwardsTrending()
void setClientExec(const QString &)
QString getMbsMonitorNode()
QString getClientTerm()
void setDrawTimeFlag(bool on=true)
bool getDrawDateFlag()
const char * MainWindowDefaultGeometry
QSize lastPanelSize(const QString &kind="ViewPanel", int dfltwidth=450, int dfltheight=250)
void getPrinterSett(QString &name, QString &cmd)
void setTH2DrawOpt(const QString &value)
void setHServName(const QString &)
QStringList getCommandsHistoryGUI()
static void GetGlobalStyle(Bool_t &HASLABEL, Bool_t &HASCONNECTOR, Bool_t &XDRAW, Bool_t &YDRAW, Bool_t &XBINDRAW, Bool_t &YBINDRAW, Bool_t &CONTDRAW, TString &NUMFORMAT)
Definition: TGo4Marker.cxx:296
bool getClientDefaultPass()
void setClientNode(const QString &)
QString getTH3DrawOpt()
void getPaletteOpt(int &min, int &def, int &max)
void setTermShowTimestamp(bool on)
void setDrawFillStyle(int style)
void setDrawItemFlag(bool on=true)
void setCanvasColor(int red, int green, int blue)
bool getMoveSubwindowRubberBand()
int getBrowserColumn(const char *name, int defwidth)
void setMbsMonitorBins(int num)
QString getGStyleStatFormat()
const char * MainWindowDefaultState
void setMbsMonitorBackwardsTrending(bool on=true)
void setInt(const QString &name, int value=0)
void setClientConnectMode(int)
int getDabcMonitorFreq()
void setOptStatW(int value)
QString getAnalysisMacroTip(int id)
bool getHideTGo4EventElement()
void setHServBase(const QString &)
void setOptStatH(int value)
void setGStyleStatFormat(const QString &)
QString getHServBase()
void setClientDefaultPass(bool)
void setMbsMonitorFreq(int secs)
void setTermTimeFormat(const QString &form)
void setMbsMonitorMore(bool on=true)
QString getClientNode()
void setAppFont(const QFont &)
void setCommandsHistoryGUI(const QStringList &commands)
void setPadSuperimpose(bool on)
void setStatBoxVisible(bool on=true)
void setTGraphDrawOpt(const QString &value)
int getTermHistorySize()
QString getHistTitle()
bool getDabcMonitorBackwardsTrending()