00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __CONFIGURATION_BASE_BOX_H_
00025 #define __CONFIGURATION_BASE_BOX_H_
00026
00027 #include "ini/ini.h"
00028 #include "global.h"
00029 #include <QGroupBox>
00030 #include <QPushButton>
00031 #include <QStandardItem>
00032
00041 class MAIN_EXPORT ConfigurationBaseBox : public QGroupBox
00042 {
00043 Q_OBJECT;
00044
00045 public:
00046 ConfigurationBaseBox(QWidget* parent = NULL)
00047 : QGroupBox(parent)
00048 {
00049 this->bAllowSave = false;
00050 this->bSettingsAlreadyRead = false;
00051 hide();
00052 }
00053
00054 virtual ~ConfigurationBaseBox() {}
00055
00056 bool allowSave() { return this->bAllowSave; }
00057 bool areSettingsAlreadyRead() { return this->bSettingsAlreadyRead; }
00058
00066 virtual QIcon icon() const = 0;
00067
00072 virtual QString name() const = 0;
00073
00074 void setAllowSave(bool b)
00075 {
00076 this->bAllowSave = b;
00077 }
00078
00079 void read()
00080 {
00081 this->bSettingsAlreadyRead = true;
00082 readSettings();
00083 }
00084
00085 bool save()
00086 {
00087 if (this->bAllowSave)
00088 {
00089 saveSettings();
00090 return true;
00091 }
00092 else
00093 {
00094 return false;
00095 }
00096 }
00097
00098 signals:
00103 void appearanceChanged();
00104
00110 void wantChangeDefaultButton(QPushButton* btn);
00111
00112 protected:
00113 bool bAllowSave;
00114 bool bSettingsAlreadyRead;
00115
00121 virtual void readSettings()=0;
00122
00128 virtual void saveSettings()=0;
00129
00130 };
00131
00132 #endif