00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CONFIGURATION_WIDGET_H
00022 #define CONFIGURATION_WIDGET_H
00023
00024 #include <QSplitter>
00025 #include <QTreeWidget>
00026 #include <QTreeWidgetItem>
00027 #include <QTableWidget>
00028 #include <QTableWidgetItem>
00029 #include "configurationparameters.h"
00030
00031 namespace farsa {
00032
00045 class ConfigurationWidget : public QSplitter
00046 {
00047 Q_OBJECT
00048
00049 public:
00056 ConfigurationWidget(QWidget *parent = NULL);
00057
00061 ~ConfigurationWidget();
00062
00068 void setConfigurationParameters(ConfigurationParameters *conf);
00069
00077 ConfigurationParameters* getConfigurationParameters()
00078 {
00079 return m_configurationParameters;
00080 }
00081
00089 const ConfigurationParameters* getCurrentParameters()
00090 {
00091 return &m_tmpParameters;
00092 }
00093
00100 void updateParameters();
00101
00108 void setReadOnly(bool readOnly);
00109
00115 bool readOnly() const
00116 {
00117 return m_readOnly;
00118 }
00119
00123 void store();
00124
00131 void restore();
00132
00140 bool valuesChanged() const
00141 {
00142 return m_valuesChanged;
00143 }
00144
00145 signals:
00153 void valueHasChanged(QString parameter, QString oldValue, QString newValue);
00154
00155 private slots:
00159 void changeTableContent(QTreeWidgetItem *item, int column);
00160
00164 void storeChangedItem(QTableWidgetItem *item);
00165
00166 private:
00174 void fillWidgetTree( QString groupName, QString groupFullPath, QTreeWidgetItem* root);
00175
00180 ConfigurationParameters *m_configurationParameters;
00181
00185 ConfigurationParameters m_tmpParameters;
00186
00191 bool m_readOnly;
00192
00197 bool m_valuesChanged;
00198
00205 QTreeWidget *m_treeWidget;
00206
00210 QTableWidget *m_tableWidget;
00211 };
00212
00213 }
00214
00215 #endif