Switch to unified view

a/src/qtgui/confgui/confgui.h b/src/qtgui/confgui/confgui.h
...
...
43
class QLineEdit;
43
class QLineEdit;
44
class QLISTBOX;
44
class QLISTBOX;
45
class QSpinBox;
45
class QSpinBox;
46
class QComboBox;
46
class QComboBox;
47
class QCheckBox;
47
class QCheckBox;
48
class QPushButton;
48
49
49
namespace confgui {
50
namespace confgui {
50
51
51
    // A class to isolate the gui widget from the config storage mechanism
52
    // A class to isolate the gui widget from the config storage mechanism
52
    class ConfLinkRep {
53
    class ConfLinkRep {
...
...
87
        // File names are encoded as local8bit in the config files. Other
88
        // File names are encoded as local8bit in the config files. Other
88
        // are encoded as utf-8
89
        // are encoded as utf-8
89
        bool         m_fsencoding;
90
        bool         m_fsencoding;
90
    virtual bool createCommon(const QString& lbltxt,
91
    virtual bool createCommon(const QString& lbltxt,
91
                  const QString& tltptxt);
92
                  const QString& tltptxt);
92
93
    public slots:
94
        virtual void setEnabled(bool) = 0;
93
    protected slots:
95
    protected slots:
94
        void setValue(const QString& newvalue);
96
        void setValue(const QString& newvalue);
95
        void setValue(int newvalue);
97
        void setValue(int newvalue);
96
        void setValue(bool newvalue);
98
        void setValue(bool newvalue);
97
    };
99
    };
98
100
99
100
    // Widgets for setting the different types of configuration parameters:
101
    // Widgets for setting the different types of configuration parameters:
101
102
102
    // Int
103
    // Int
103
    class ConfParamIntW : public ConfParamW {
104
    class ConfParamIntW : public ConfParamW {
105
  Q_OBJECT
104
    public:
106
    public:
105
    ConfParamIntW(QWidget *parent, ConfLink cflink, 
107
    ConfParamIntW(QWidget *parent, ConfLink cflink, 
106
              const QString& lbltxt,
108
              const QString& lbltxt,
107
              const QString& tltptxt,
109
              const QString& tltptxt,
108
              int minvalue = INT_MIN, 
110
              int minvalue = INT_MIN, 
109
              int maxvalue = INT_MAX);
111
              int maxvalue = INT_MAX);
110
    virtual void loadValue();
112
    virtual void loadValue();
113
    public slots:
114
        virtual void setEnabled(bool i) {if(m_sb) ((QWidget*)m_sb)->setEnabled(i);}
111
    protected:
115
    protected:
112
    QSpinBox *m_sb;
116
    QSpinBox *m_sb;
113
    };
117
    };
114
118
115
    // Arbitrary string
119
    // Arbitrary string
116
    class ConfParamStrW : public ConfParamW {
120
    class ConfParamStrW : public ConfParamW {
121
  Q_OBJECT
117
    public:
122
    public:
118
    ConfParamStrW(QWidget *parent, ConfLink cflink, 
123
    ConfParamStrW(QWidget *parent, ConfLink cflink, 
119
              const QString& lbltxt,
124
              const QString& lbltxt,
120
              const QString& tltptxt);
125
              const QString& tltptxt);
121
    virtual void loadValue();
126
    virtual void loadValue();
127
    public slots:
128
        virtual void setEnabled(bool i) {if(m_le) ((QWidget*)m_le)->setEnabled(i);}
122
    protected:
129
    protected:
123
    QLineEdit *m_le;
130
    QLineEdit *m_le;
124
    };
131
    };
125
132
126
    // Constrained string: choose from list
133
    // Constrained string: choose from list
127
    class ConfParamCStrW : public ConfParamW {
134
    class ConfParamCStrW : public ConfParamW {
135
  Q_OBJECT
128
    public:
136
    public:
129
    ConfParamCStrW(QWidget *parent, ConfLink cflink, 
137
    ConfParamCStrW(QWidget *parent, ConfLink cflink, 
130
              const QString& lbltxt,
138
              const QString& lbltxt,
131
              const QString& tltptxt, const QStringList& sl);
139
              const QString& tltptxt, const QStringList& sl);
132
    virtual void loadValue();
140
    virtual void loadValue();
141
    public slots:
142
        virtual void setEnabled(bool i) {if(m_cmb) ((QWidget*)m_cmb)->setEnabled(i);}
133
    protected:
143
    protected:
134
    QComboBox *m_cmb;
144
    QComboBox *m_cmb;
135
    };
145
    };
136
146
137
    // Boolean
147
    // Boolean
138
    class ConfParamBoolW : public ConfParamW {
148
    class ConfParamBoolW : public ConfParamW {
149
  Q_OBJECT
139
    public:
150
    public:
140
    ConfParamBoolW(QWidget *parent, ConfLink cflink, 
151
    ConfParamBoolW(QWidget *parent, ConfLink cflink, 
141
              const QString& lbltxt,
152
              const QString& lbltxt,
142
              const QString& tltptxt);
153
              const QString& tltptxt);
143
    virtual void loadValue();
154
    virtual void loadValue();
144
    protected:
155
    public slots:
156
        virtual void setEnabled(bool i) {if(m_cb) ((QWidget*)m_cb)->setEnabled(i);}
157
    public:
145
    QCheckBox *m_cb;
158
    QCheckBox *m_cb;
146
    };
159
    };
147
160
148
    // File name
161
    // File name
149
    class ConfParamFNW : public ConfParamW {
162
    class ConfParamFNW : public ConfParamW {
...
...
153
              const QString& lbltxt,
166
              const QString& lbltxt,
154
             const QString& tltptxt, bool isdir = false);
167
             const QString& tltptxt, bool isdir = false);
155
    virtual void loadValue();
168
    virtual void loadValue();
156
    protected slots:
169
    protected slots:
157
    void showBrowserDialog();
170
    void showBrowserDialog();
171
    public slots:
172
        virtual void setEnabled(bool i) 
173
        {
174
            if(m_le) ((QWidget*)m_le)->setEnabled(i);
175
            if(m_pb) ((QWidget*)m_pb)->setEnabled(i);
176
        }
158
    protected:
177
    protected:
159
    QLineEdit *m_le;
178
    QLineEdit *m_le;
179
        QPushButton *m_pb;
160
    bool       m_isdir;
180
    bool       m_isdir;
161
    };
181
    };
162
182
163
    // String list
183
    // String list
164
    class ConfParamSLW : public ConfParamW {
184
    class ConfParamSLW : public ConfParamW {
...
...
168
              const QString& lbltxt,
188
              const QString& lbltxt,
169
              const QString& tltptxt);
189
              const QString& tltptxt);
170
    virtual void loadValue();
190
    virtual void loadValue();
171
    QLISTBOX *getListBox() {return m_lb;}
191
    QLISTBOX *getListBox() {return m_lb;}
172
    
192
    
193
    public slots:
194
        virtual void setEnabled(bool i) {if(m_lb) ((QWidget*)m_lb)->setEnabled(i);}
173
    protected slots:
195
    protected slots:
174
    virtual void showInputDialog();
196
    virtual void showInputDialog();
175
    void deleteSelected();
197
    void deleteSelected();
176
    signals:
198
    signals:
177
        void entryDeleted(QString);
199
        void entryDeleted(QString);