settings.h

00001 
00002 /***************************************************************************
00003  *   This file is part of Aspect, a simple PEC tool.                       *
00004  *                                                                         *
00005  *   Copyright (C) 2007 by Wolfgang Hoffmann <woho@woho.de>                *
00006  *                                                                         *
00007  *   This program is free software, licensed under the GPL v2.             *
00008  *   See the file COPYING for more details.                                *
00009  ***************************************************************************/
00010 
00011 
00012 #ifndef ASPECT_SETTINGS_H
00013 #define ASPECT_SETTINGS_H
00014 
00015 
00016 #include <QDialog>
00017 #include <QSettings>
00018 #include <QString>
00019 #include <QStringList>
00020 
00021 
00022 namespace Ui { class SettingsDialog; };
00023 
00024 
00025 class Settings: public QObject
00026     {
00027     Q_OBJECT
00028 
00029 public:
00030     ~Settings();
00031 
00032     static QSettings &settings() { return *(g_oSettings.m_pQSettings); };
00033 
00034     static void connect(QObject *pReceiver, const char *szSlot);
00035     static void freeze();
00036     static void thaw();
00037 
00038     static QString getPathLog();
00039     static void setPathLog(const QString &qsPath);
00040     static QStringList getPathHistory();
00041     static QString getPathDefault();
00042     static void setPathDefault(const QString &qsPath);
00043 
00044     static bool getLoggingGeneral();
00045     static void setLoggingGeneral(bool bOn);
00046     static bool getLoggingMcu();
00047     static void setLoggingMcu(bool bOn);
00048 
00049     static QString getMcuPort();
00050     static void setMcuPort(const QString &qsPort);
00051     static int getMcuFirmware();
00052     static void setMcuFirmware(int nFirmware);
00053     static int getMcuWormWheelTeeth();
00054     static void setMcuWormWheelTeeth(int nTeeth);
00055 
00056     static int getPecGenTraversal();
00057     static void setPecGenTraversal(int nTraversal);
00058     static double getPecGenAccel();
00059     static void setPecGenAccel(double dfAccel);
00060     static int getPecGenAggressMin();
00061     static void setPecGenAggressMin(int nAggressMin);
00062     static int getPecGenAggressMax();
00063     static void setPecGenAggressMax(int nAggressMax);
00064     static int getPecGenFactorMax();
00065     static void setPecGenFactorMax(int nFactorMax);
00066 
00067     static bool getExperimentalTabProfile();
00068     static void setExperimentalTabProfile(bool bEnable);
00069     static bool getExperimentalMenuMount();
00070     static void setExperimentalMenuMount(bool bEnable);
00071 
00072 signals:
00073     void settingsChanged();
00074 
00075 private:
00076     Settings();
00077     static void emitChanged();
00078     void emitChangedInternal(bool bFromChange);
00079 
00080 private:
00081     static Settings g_oSettings;
00082     QSettings *m_pQSettings;
00083     bool m_bFrozen;
00084     bool m_bChanged;
00085     };
00086 
00087 
00088 class SettingsDialog: public QDialog
00089     {
00090     Q_OBJECT
00091 
00092 public:
00093     SettingsDialog(QWidget *pParent = 0);
00094     ~SettingsDialog();
00095 
00096 public slots:
00097     void on_logfilesGeneral_clicked();
00098     void on_logfilesMcu_clicked();
00099     void on_logfilesCopy_clicked();
00100     void on_pecGenTraversal_activated(int nIndex);
00101     void on_pecGenAccel_valueChanged(double dfValue);
00102     void on_pecGenAggressMin_valueChanged(int nValue);
00103     void on_pecGenAggressMax_valueChanged(int nValue);
00104     void on_pecGenFactor_valueChanged(int nValue);
00105     void on_expTabProfile_clicked(bool bChecked);
00106     void on_expMenuMount_clicked(bool bChecked);
00107 
00108 private:
00109     Ui::SettingsDialog *m_pUi;
00110     };
00111 
00112 
00113 #endif // ASPECT_SETTINGS_H
00114 

Generated on Sun Jun 3 16:45:46 2007 for Aspect by  doxygen 1.5.1