00001 #ifndef PREFERENCESFUNCTION_QO_H 00002 #define PREFERENCESFUNCTION_QO_H 00003 00004 #include <QtGui/QWidget> 00005 #include <QSettings> 00006 #include <guitools/Feather/PreferencesFunction.ui.h> 00007 #include <guitools/Feather/CurveDisplay.h> 00008 00009 namespace casa { 00010 00016 class PreferencesFunction : public QWidget 00017 { 00018 Q_OBJECT 00019 00020 public: 00021 PreferencesFunction(int index, QWidget *parent = 0); 00022 ~PreferencesFunction(); 00023 00024 //Initialization of the default color 00025 void setColor( QColor color ); 00026 void setDisplayed( bool visible ); 00027 void setScatterEligible( bool eligible ); 00028 void setDisplayHidden(); 00029 void setName( const QString& name ); 00030 00031 00032 //Getters 00037 bool isDisplayed() const; 00042 bool isDisplayedGUI() const; 00046 bool isScatterEligible() const; 00047 QString getName() const; 00048 00049 //Initializes the defaults from user settings. 00050 void initialize( QSettings& settings); 00051 00052 //Writes what is currently displayed into the user settings. 00053 void persist( QSettings& settings ); 00054 00055 //Copies the defaults into what is displayed. 00056 void reset(); 00057 00058 const CurveDisplay getFunctionPreferences() const; 00059 00060 signals: 00061 void displayStatusChanged(); 00062 00063 private slots: 00064 void visibilityChanged(); 00065 void showColorDialog(); 00066 private: 00067 int id; 00068 bool scatterEligible; 00069 CurveDisplay curveSettings; 00070 QString getBaseStorageId() const; 00071 void setButtonColor( QColor color ); 00072 const QString COLOR_KEY; 00073 const QString VISIBILITY_KEY; 00074 QColor getButtonColor() const; 00075 static const QString FUNCTION_COLOR; 00076 Ui::PreferencesFunctionClass ui; 00077 }; 00078 00079 } 00080 00081 #endif // PREFERENCESFUNCTION_QO_H