annotate settings.h @ 2:fee291c8d42a

settings: profiles management first draft
author Goffi <goffi@goffi.org>
date Mon, 08 Aug 2011 10:30:23 +0200
parents parameters.h@22b44846b04b
children 220e5619bf87
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
1 /*
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
2 Bellaciao: a Salut à Toi frontend
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
3 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org)
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
4
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
5 This program is free software: you can redistribute it and/or modify
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
6 it under the terms of the GNU Affero General Public License as published by
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
7 the Free Software Foundation, either version 3 of the License, or
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
8 (at your option) any later version.
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
9
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
13 GNU Affero General Public License for more details.
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
14
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
15 You should have received a copy of the GNU Affero General Public License
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
17 */
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
18
2
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
19 #ifndef SETTINGS_H
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
20 #define SETTINGS_H
0
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
21
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
22
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
23 #include <QtGui>
2
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
24 #include "ui_settings.h"
0
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
25 #include "bridge.h"
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
26
2
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
27 class ProfileListWidgetItem : public QListWidgetItem
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
28 {
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
29
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
30 public:
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
31 ProfileListWidgetItem(const QString & profile, QListWidget * parent, bool isDefault=false);
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
32 const QString& getProfile();
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
33 private:
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
34 QString m_profile;
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
35 };
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
36
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
37 class Settings : public QWidget, private Ui::SettingsDlg
0
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
38 {
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
39 Q_OBJECT
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
40
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
41 public:
2
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
42 ~Settings();
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
43 static Settings* getDialog();
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
44
0
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
45
2
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
46 private slots:
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
47 void profileChanged(QListWidgetItem* item);
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
48 void profileCurrentChanged(QListWidgetItem* current, QListWidgetItem* previous);
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
49 void on_buttonNew_clicked();
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
50 void on_buttonDelete_clicked();
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
51 void saveSettings();
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
52 void cancelSettings();
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
53
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
54 protected:
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
55 Settings(QWidget *parent = 0);
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
56
0
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
57 private:
2
fee291c8d42a settings: profiles management first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
58 static Settings* _instance;
0
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
59 Bridge* m_bridge;
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
60
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
61 };
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
62
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
63
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
64
22b44846b04b Initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
65 #endif