GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4QSettings.h
Go to the documentation of this file.
1// $Id$
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#ifndef TGO4QSETTINGS_H
15#define TGO4QSETTINGS_H
16
21
22#include <QtCore/QString>
23#include <QtCore/QStringList>
24#include <QFont>
25
26class QMainWindow;
27class QWidget;
28class QSettings;
29
33
35 private:
36
38 QSettings *sett{nullptr};
39
42
43 bool fUseWeb{false};
44
46
47 void Open();
48 public:
49
50 TGo4QSettings(const QString& filename);
51 virtual ~TGo4QSettings();
52
53 QString GetSettLoaction();
54
55 void Store();
56
57 // set generic function
58
59 void setBool(const QString& name, bool value = true);
60 bool getBool(const QString& name, bool def = true);
61 void setInt(const QString& name, int value = 0);
62 int getInt(const QString& name, int def = 0);
63 void setStr(const QString& name, const QString& value = "");
64 QString getStr(const QString& name, const QString& value = "");
65 void setDouble(const QString& name, double value = 0.);
66 double getDouble(const QString& name, double value = 0.);
67
68 // set of Go4Specific functions
69
70 void setBasicSettings();
71 void getBasicSettings();
72
73 void setAppFont(const QFont&);
74 void getAppFont();
75
76 void setTermFont(const QFont&);
77 QFont getTermFont();
78
79 void setAppStyle(const QString&);
80 QString getAppStyle();
81
82 void setClientName(const QString&);
83 QString getClientName();
84 void setClientNode(const QString&);
85 QString getClientNode();
86 void setClientDir(const QString&);
87 QString getClientDir();
88 void setClientExeMode(int mode);
89 int getClientExeMode();
90 void setClientExec(const QString&);
91 QString getClientExec(int mode = -1);
92 void setClientArgs(const QString&);
93 QString getClientArgs();
94 void setClientShellMode(int);
95 QString getClientShell();
97 void setClientTermMode(int);
99 QString getClientTerm();
100 void setClientIsServer(int kind);
101 int getClientIsServer();
102
103 void setClientPort(int);
104 int getClientPort();
105 void setClientControllerMode(int);
107 void setClientDefaultPass(bool);
109 void setClientConnectMode(int);
111 QString getClientAccountName();
112 void setClientAccountName(const QString&);
113
114 void setTermHistorySize(int sz);
115 int getTermHistorySize();
116
118 void setTermShowTimestamp(bool on);
119
120 QString getTermTimeFormat();
121 void setTermTimeFormat(const QString& form);
122
123
124 void setHServName(const QString&);
125 QString getHServName();
126 void setHServBase(const QString&);
127 QString getHServBase();
128 void setHServFilter(const QString&);
129 QString getHServFilter();
130 void setHServPort(int port);
131 int getHServPort();
132
133 void setPadCrosshair(bool on);
134 bool getPadCrosshair();
135
136 void setPadSuperimpose(bool on);
137 bool getPadSuperimpose();
138
139 void setPadEventStatus(bool on);
140 bool getPadEventStatus();
141
142 void setCanvasColor(int red, int green, int blue);
143 void getCanvasColor(int& red, int& green, int& blue);
144
145 void setPaletteOpt(int min, int def, int max);
146 void getPaletteOpt(int& min, int& def, int& max);
147
148 void setOptStat(int value);
149 int getOptStat();
150
151 void setOptStatW(int value);
152 int getOptStatW();
153
154 void setOptStatH(int value);
155 int getOptStatH();
156
157 void setStatBoxVisible(bool on = true);
158 bool getStatBoxVisible();
159
160 void setStatBoxErrors(bool on = true);
161 bool getStatBoxErrors();
162
163 void setCloneFlag(bool on = true);
164 bool getCloneFlag();
165
166 void setDrawOnceFlag(bool on = true);
167 bool getDrawOnceFlag();
168
169 void setDrawTimeFlag(bool on = true);
170 bool getDrawTimeFlag();
171
172 void setDrawDateFlag(bool on = true);
173 bool getDrawDateFlag();
174
175 void setDrawItemFlag(bool on = true);
176 bool getDrawItemFlag();
177
178 void setDrawLineWidth(int w = 1);
179 int getDrawLineWidth();
180
181 void setDrawFillColor(int col);
182 int getDrawFillColor();
183
184 void setDrawFillStyle(int style);
185 int getDrawFillStyle();
186
187
188 void setTH1DrawOpt(const QString& value);
189 QString getTH1DrawOpt();
190
191 void setTH2DrawOpt(const QString& value);
192 QString getTH2DrawOpt();
193
194 void setTH3DrawOpt(const QString& value);
195 QString getTH3DrawOpt();
196
197 void setTGraphDrawOpt(const QString& value);
198 QString getTGraphDrawOpt();
199
200 void setGStyleStatFormat(const QString&);
201 QString getGStyleStatFormat();
202
203 void storePanelSize(QWidget *w, const QString& kind = "ViewPanel");
204 QSize lastPanelSize(const QString& kind = "ViewPanel", int dfltwidth = 450, int dfltheight = 250);
205
206 void setBrowserColumn(const char *name, int width);
207 int getBrowserColumn(const char *name, int defwidth);
208
209 void setHistName(const QString& value);
210 QString getHistName();
211
212 void setHistTitle(const QString& value);
213 QString getHistTitle();
214
215 void setHistType(int value);
216 int getHistType();
217
218 void setHistAxisPars(int naxis, int npoints, double min, double max);
219 void getHistAxisPars(int naxis, int& npoints, double& min, double& max);
220
221 void setFetchDataWhenDraw(bool on = true);
223
224 void setFetchDataWhenCopy(bool on = true);
226
227 void setFetchDataWhenSave(bool on = true);
229
230 void setHideTGo4EventElement(bool on = true);
232
233 void setMoveSubwindowRubberBand(bool on = true);
235
236 void setWebBasedCanvas(bool on = true) { fUseWeb = on; }
237 bool getWebBasedCanvas() { return fUseWeb; }
238
239 void setNativeMenuBar(bool on = true);
240 bool getNativeMenuBar();
241
242 void setRemoteFileSett(const QString& hostname, const QString& filename, const QString& protocol);
243 void getRemoteFileSett(QString& hostname, QString& filename, QString& protocol);
244
245 void setPrinterSett(const QString& name, const QString& cmd);
246 void getPrinterSett(QString& name, QString& cmd);
247
249 void setMbsMonitorNode(const QString& name);
250 QString getMbsMonitorNode();
251 void setMbsMonitorFreq(int secs);
252 int getMbsMonitorFreq();
253 void setMbsMonitorBins(int num);
254 int getMbsMonitorBins();
255 void setMbsMonitorTrend(bool on = true);
256 bool getMbsMonitorTrend();
257 void setMbsMonitorMore(bool on = true);
258 bool getMbsMonitorMore();
259 void setMbsMonitorMonitorActive(bool on = true);
261 void setMbsMonitorBackwardsTrending(bool on = true);
263
265 void setDabcMonitorNode(const QString& name);
266 QString getDabcMonitorNode();
267 void setDabcMonitorFreq(int secs);
268 int getDabcMonitorFreq();
269 void setDabcMonitorBins(int num);
270 int getDabcMonitorBins();
271 void setDabcMonitorBackwardsTrending(bool on = true);
273
275 QStringList getCommandsHistoryGUI();
276 void setCommandsHistoryGUI(const QStringList & commands);
277
279 QStringList getCommandsHistoryAnalysis();
280 void setCommandsHistoryAnalysis(const QStringList & commands);
281
283 void restoreMainWindowState(QMainWindow* tgt);
284 void storeMainWindowState(QMainWindow* src);
285
287 QString getAnalysisMacroCommand(int id);
288 QString getAnalysisMacroTip(int id);
289 bool getAnalysisMacroAutomode(int id);
290 void setAnalysisMacroCommand(int id, const QString &com);
291 void setAnalysisMacroTip(int id, const QString &com);
292 void setAnalysisMacroAutomode(int id, bool on);
293
295 double getScreenScaleFactor();
296 void setScreenScaleFactor(double factor);
297
300 void setSavePadWhiteBackground(bool on);
301};
302
303extern TGo4QSettings *go4sett;
304
305#endif
TGo4QSettings * go4sett
Extends the usual QSettings by a global setup for the location of the settings file.
void setTH3DrawOpt(const QString &value)
QString getGStyleStatFormat()
QString getClientNode()
void Open()
Read settings from the file/registry.
QString getHServFilter()
void setHistTitle(const QString &value)
void setAnalysisMacroCommand(int id, const QString &com)
void setAppFont(const QFont &)
void getHistAxisPars(int naxis, int &npoints, double &min, double &max)
bool getFetchDataWhenDraw()
void setWebBasedCanvas(bool on=true)
virtual ~TGo4QSettings()
void setBool(const QString &name, bool value=true)
int getInt(const QString &name, int def=0)
void setTermHistorySize(int sz)
QString getStr(const QString &name, const QString &value="")
QStringList getCommandsHistoryGUI()
implement history for gui command line
double getDouble(const QString &name, double value=0.)
QString getTH3DrawOpt()
void setAnalysisMacroTip(int id, const QString &com)
void setFetchDataWhenDraw(bool on=true)
void setInt(const QString &name, int value=0)
bool getSavePadWhiteBackground()
switch to make pad and frame backgrounds white before saving/printing them
void setTermFont(const QFont &)
bool getClientDefaultPass()
bool getMoveSubwindowRubberBand()
void setClientControllerMode(int)
QString getClientAccountName()
QString fSettFileName
This is the name of the file with settings, if empty - default qt location will be used.
void setTH1DrawOpt(const QString &value)
void setClientExeMode(int mode)
QString getClientArgs()
void setMbsMonitorNode(const QString &name)
some things for the mbs monitor dockwindow:
void setHServPort(int port)
QString getHistTitle()
QString getClientName()
void setCommandsHistoryGUI(const QStringList &commands)
void setDrawFillStyle(int style)
void setHistAxisPars(int naxis, int npoints, double min, double max)
void restoreMainWindowState(QMainWindow *tgt)
main window state/geometry
void setHistName(const QString &value)
void setNativeMenuBar(bool on=true)
bool getWebBasedCanvas()
bool getTermShowTimestamp()
void setAppStyle(const QString &)
QString getDabcMonitorNode()
void setDabcMonitorFreq(int secs)
void setGStyleStatFormat(const QString &)
QString getTH2DrawOpt()
void setDrawOnceFlag(bool on=true)
TGo4QSettings(const QString &filename)
void setClientPort(int)
QString getClientExec(int mode=-1)
void setPaletteOpt(int min, int def, int max)
void setOptStat(int value)
void setTGraphDrawOpt(const QString &value)
QString getAnalysisMacroCommand(int id)
for predefined macro buttons in main gui:
bool getFetchDataWhenSave()
void setPrinterSett(const QString &name, const QString &cmd)
void setHServName(const QString &)
void getRemoteFileSett(QString &hostname, QString &filename, QString &protocol)
double getScreenScaleFactor()
for Qt>5.6: factor to scale up whole gui on high dpi screens
void setOptStatH(int value)
void setMbsMonitorTrend(bool on=true)
QString getHServBase()
void setStr(const QString &name, const QString &value="")
void setSavePadWhiteBackground(bool on)
void setStatBoxErrors(bool on=true)
void setTermTimeFormat(const QString &form)
void setPadEventStatus(bool on)
void setClientTermMode(int)
void setClientArgs(const QString &)
void setClientShellMode(int)
void getPaletteOpt(int &min, int &def, int &max)
void setRemoteFileSett(const QString &hostname, const QString &filename, const QString &protocol)
void storeMainWindowState(QMainWindow *src)
bool getMbsMonitorBackwardsTrending()
void setDrawFillColor(int col)
void setClientIsServer(int kind)
void setClientDir(const QString &)
void setDrawLineWidth(int w=1)
bool getBool(const QString &name, bool def=true)
bool getMbsMonitorMonitorActive()
QString getTGraphDrawOpt()
QSize lastPanelSize(const QString &kind="ViewPanel", int dfltwidth=450, int dfltheight=250)
QString getHServName()
int getBrowserColumn(const char *name, int defwidth)
int getClientControllerMode()
void setPadCrosshair(bool on)
void storePanelSize(QWidget *w, const QString &kind="ViewPanel")
void setDrawTimeFlag(bool on=true)
QStringList getCommandsHistoryAnalysis()
implement history for analysis command line
void setPadSuperimpose(bool on)
void setTermShowTimestamp(bool on)
void setClientExec(const QString &)
void setMbsMonitorMonitorActive(bool on=true)
void setDabcMonitorBins(int num)
void setMbsMonitorFreq(int secs)
void setClientDefaultPass(bool)
void setAnalysisMacroAutomode(int id, bool on)
void setDabcMonitorNode(const QString &name)
some things for the DABC monitor dockwindow:
bool getFetchDataWhenCopy()
void setMoveSubwindowRubberBand(bool on=true)
QString getHistName()
void setMbsMonitorBackwardsTrending(bool on=true)
void setOptStatW(int value)
void setCanvasColor(int red, int green, int blue)
void setHServBase(const QString &)
bool getHideTGo4EventElement()
void setMbsMonitorMore(bool on=true)
void setDrawDateFlag(bool on=true)
void setDabcMonitorBackwardsTrending(bool on=true)
QString getClientTerm()
void setClientConnectMode(int)
void setClientNode(const QString &)
void setScreenScaleFactor(double factor)
void setBrowserColumn(const char *name, int width)
void setFetchDataWhenSave(bool on=true)
QString getClientShell()
void setClientAccountName(const QString &)
void setHistType(int value)
QSettings * sett
Currently opened settings.
void setDrawItemFlag(bool on=true)
void getCanvasColor(int &red, int &green, int &blue)
void setClientName(const QString &)
QString GetSettLoaction()
QString getMbsMonitorNode()
void setHServFilter(const QString &)
QString getAnalysisMacroTip(int id)
void setCommandsHistoryAnalysis(const QStringList &commands)
void setStatBoxVisible(bool on=true)
bool getMbsMonitorTrend()
void getPrinterSett(QString &name, QString &cmd)
void setCloneFlag(bool on=true)
QString getTermTimeFormat()
void setHideTGo4EventElement(bool on=true)
void setMbsMonitorBins(int num)
void setTH2DrawOpt(const QString &value)
QString getAppStyle()
void setDouble(const QString &name, double value=0.)
QString getClientDir()
bool getAnalysisMacroAutomode(int id)
QString getTH1DrawOpt()
bool getDabcMonitorBackwardsTrending()
void setFetchDataWhenCopy(bool on=true)