Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4QSettings.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #ifndef TGO4QSETTINGS_H
00017 #define TGO4QSETTINGS_H
00018 
00024 #include "qsettings.h"
00025 
00026 class QMainWindow;
00027 class QWidget;
00028 
00033 class TGo4QSettings : public QSettings {
00034     public:
00035 
00036     TGo4QSettings();
00037     TGo4QSettings ( Format format );
00038     virtual  ~TGo4QSettings();
00039 
00041     void DumpSettingsLocation();
00042 
00043     static void SetToCurrentDir(bool on);
00044 
00045     static void SetUserPath(const QString& mypath)
00046         {
00047           fgbUSEMYLOCATION=true;
00048           fgxSETTINGSLOCATION=mypath;
00049           fgxSETTINGSNAME=fgxHOMESETTINGSNAME+"local";
00050         }
00051 
00052      static void SetHomeSettingsFile(const QString& name)
00053         {
00054           fgxHOMESETTINGSNAME=name;
00055         }
00056 
00057 
00058     static bool UsesUserPath(){return fgbUSEMYLOCATION;}
00059 
00060     static const QString& GetUserPath() {return fgxSETTINGSLOCATION;}
00061 
00062     static const QString& GetSettingsName() {return fgxSETTINGSNAME;}
00063 
00064     static QString getSettingsFileName();
00065 
00066     static void RestoreSettings(QMainWindow* tgt);
00067 
00068     static void StoreSettings(QMainWindow* src);
00069 
00070 
00071     // set generic function
00072 
00073     void    setBool(const QString& name, bool value = true);
00074     bool    getBool(const QString& name, bool def = true);
00075     void    setInt(const QString& name, int value = 0);
00076     int     getInt(const QString& name, int def = 0);
00077     void    setStr(const QString& name, const QString& value = "");
00078     QString getStr(const QString& name, const QString& value = "");
00079 
00080     // set of Go4Specific functions
00081 
00082     void    setBasicSettings();
00083     void    getBasicSettings();
00084 
00085     void    setAppStyle(const QString&);
00086     QString getAppStyle();
00087 
00088     void    setClientName(const QString&);
00089     QString getClientName();
00090     void    setClientNode(const QString&);
00091     QString getClientNode();
00092     void    setClientDir(const QString&);
00093     QString getClientDir();
00094     void    setClientExec(const QString&);
00095     QString getClientExec();
00096     void    setClientShellMode(int);
00097     QString getClientShell();
00098     int     getClientShellMode();
00099     void    setClientTermMode(int);
00100     int     getClientTermMode();
00101     QString getClientTerm();
00102     void    setClientIsServer(bool on);
00103     bool    getClientIsServer();
00104     void    setClientPort(int);
00105     int     getClientPort();
00106     void    setClientControllerMode(int);
00107     int     getClientControllerMode();
00108     void    setClientDefaultPass(bool);
00109     bool    getClientDefaultPass();
00110 
00111     void    setTermHistorySize(int sz);
00112     int     getTermHistorySize();
00113 
00114     void    setHServName(const QString&);
00115     QString getHServName();
00116     void    setHServBase(const QString&);
00117     QString getHServBase();
00118     void    setHServFilter(const QString&);
00119     QString getHServFilter();
00120     void    setHServPort(int port);
00121     int     getHServPort();
00122 
00123     void    setPadCrosshair(bool on);
00124     bool    getPadCrosshair();
00125 
00126     void    setPadEventStatus(bool on);
00127     bool    getPadEventStatus();
00128 
00129     void    setCanvasColor(int red, int green, int blue);
00130     void    getCanvasColor(int& red, int& green, int& blue);
00131 
00132     void    setOptStat(int value);
00133     int     getOptStat();
00134 
00135     void    setStatBoxVisible(bool on = true);
00136     bool    getStatBoxVisible();
00137 
00138     void    setStatBoxErrors(bool on = true);
00139     bool    getStatBoxErrors();
00140 
00141     void    setCloneFlag(bool on = true);
00142     bool    getCloneFlag();
00143 
00144     void    setDrawTimeFlag(bool on = true);
00145     bool    getDrawTimeFlag();
00146 
00147     void    setDrawDateFlag(bool on = true);
00148     bool    getDrawDateFlag();
00149 
00150     void    setDrawItemFlag(bool on = true);
00151     bool    getDrawItemFlag();
00152 
00153     void    storeGeometry(QMainWindow* w);
00154     void    restoreGeometry(QMainWindow* w);
00155 
00156     void    storePanelSize(QWidget* w);
00157     void    restorePanelSize(QWidget* w);
00158 
00159     void    setBrowserColumn(const char* name, int width);
00160     int     getBrowserColumn(const char* name, int defwidth);
00161 
00162     void    setHistName(const QString& value);
00163     QString getHistName();
00164 
00165     void    setHistType(int value);
00166     int     getHistType();
00167 
00168     void    setHistAxisPars(int naxis, int npoints, double min, double max);
00169     void    getHistAxisPars(int naxis, int& npoints, double& min, double& max);
00170 
00171     void    setFetchDataWhenDraw(bool on = true);
00172     bool    getFetchDataWhenDraw();
00173 
00174     void    setFetchDataWhenCopy(bool on = true);
00175     bool    getFetchDataWhenCopy();
00176 
00177     void    setFetchDataWhenSave(bool on = true);
00178     bool    getFetchDataWhenSave();
00179 
00180     void    setRemoteFileSett(const QString& hostname, const QString& filename, const QString& protocol);
00181     void    getRemoteFileSett(QString& hostname, QString& filename, QString& protocol);
00182 
00183     void    setPrinterSett(const QString& name, const QString& cmd);
00184     void    getPrinterSett(QString& name, QString& cmd);
00185 
00187     void    setMbsMonitorNode(const QString& name);
00188     QString getMbsMonitorNode();
00189     void    setMbsMonitorFreq(int secs);
00190     int     getMbsMonitorFreq();
00191     void    setMbsMonitorBins(int num);
00192     int     getMbsMonitorBins();
00193     void    setMbsMonitorTrend(bool on = true);
00194     bool    getMbsMonitorTrend();
00195     void    setMbsMonitorMore(bool on = true);
00196     bool    getMbsMonitorMore();
00197     void    setMbsMonitorMonitorActive(bool on = true);
00198     bool    getMbsMonitorMonitorActive();
00199     void    setMbsMonitorBackwardsTrending(bool on = true);
00200     bool    getMbsMonitorBackwardsTrending();
00201     
00203     void    setDabcMonitorNode(const QString& name);
00204     QString getDabcMonitorNode();
00205     void    setDabcMonitorFreq(int secs);
00206     int     getDabcMonitorFreq();
00207     void    setDabcMonitorBins(int num);
00208     int     getDabcMonitorBins();
00209     void    setDabcMonitorBackwardsTrending(bool on = true);
00210     bool    getDabcMonitorBackwardsTrending();
00211     
00213     QStringList getCommandsHistoryGUI();
00214     void setCommandsHistoryGUI(QStringList & commands);
00215 
00216     protected:
00217 
00219     void SetSettingsPath();
00220 
00221     private:
00222 
00223 
00227     static bool fgbUSEMYLOCATION;
00228 
00230     static QString fgxSETTINGSLOCATION;
00231 
00234     static QString fgxHOMESETTINGSNAME;
00235 
00236 
00241     static QString fgxSETTINGSNAME;
00242 };
00243 
00244 extern TGo4QSettings* go4sett;
00245 
00246 #endif // TGO4ANALYSISWINDOW_H
00247 
00248 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:22 2008 for Go4-v3.04-1 by  doxygen 1.4.2