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