author | mickeyl <mickeyl> | 2003-11-06 10:17:45 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-11-06 10:17:45 (UTC) |
commit | 55ea6367fba8a82fbdca74599422717e4b3c3ec6 (patch) (unidiff) | |
tree | b40bb13a1b4f05b4eda61cf0c4a02e32719a70c4 /core | |
parent | 56ad1eb7fb39ddc78026a0df096703fcf42f5a94 (diff) | |
download | opie-55ea6367fba8a82fbdca74599422717e4b3c3ec6.zip opie-55ea6367fba8a82fbdca74599422717e4b3c3ec6.tar.gz opie-55ea6367fba8a82fbdca74599422717e4b3c3ec6.tar.bz2 |
merge core/settings/*
- light-and-power and security were a bit ugly, so I recommend someone
who actually dealt with these files looking into if I got it right
(not to tell about the frustratation about the fact that the ones who
dealt with these files didn't do the merge in the first place :(
24 files changed, 94 insertions, 130 deletions
diff --git a/core/settings/button/button.pro b/core/settings/button/button.pro index b10b619..e1c6724 100644 --- a/core/settings/button/button.pro +++ b/core/settings/button/button.pro | |||
@@ -1,40 +1,37 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on release | 2 | |
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = buttonsettings.h \ | 3 | HEADERS = buttonsettings.h \ |
5 | buttonutils.h \ | 4 | buttonutils.h \ |
6 | remapdlg.h | 5 | remapdlg.h |
7 | 6 | ||
8 | SOURCES = main.cpp \ | 7 | SOURCES = main.cpp \ |
9 | buttonsettings.cpp \ | 8 | buttonsettings.cpp \ |
10 | buttonutils.cpp \ | 9 | buttonutils.cpp \ |
11 | remapdlg.cpp | 10 | remapdlg.cpp |
12 | 11 | ||
13 | INTERFACES = remapdlgbase.ui | 12 | INTERFACES = remapdlgbase.ui |
14 | 13 | ||
15 | INCLUDEPATH += $(OPIEDIR)/include | 14 | INCLUDEPATH += $(OPIEDIR)/include |
16 | DEPENDPATH += $(OPIEDIR)/include | 15 | DEPENDPATH += $(OPIEDIR)/include |
17 | LIBS += -lqpe -lopie | 16 | LIBS += -lqpe -lopie |
18 | TARGET = buttonsettings | 17 | TARGET = buttonsettings |
19 | 18 | ||
20 | TRANSLATIONS = ../../../i18n/de/buttonsettings.ts \ | 19 | TRANSLATIONS = ../../../i18n/de/buttonsettings.ts \ |
21 | ../../../i18n/nl/buttonsettings.ts \ | 20 | ../../../i18n/nl/buttonsettings.ts \ |
22 | ../../../i18n/xx/buttonsettings.ts \ | 21 | ../../../i18n/xx/buttonsettings.ts \ |
23 | ../../../i18n/en/buttonsettings.ts \ | 22 | ../../../i18n/en/buttonsettings.ts \ |
24 | ../../../i18n/es/buttonsettings.ts \ | 23 | ../../../i18n/es/buttonsettings.ts \ |
25 | ../../../i18n/fr/buttonsettings.ts \ | 24 | ../../../i18n/fr/buttonsettings.ts \ |
26 | ../../../i18n/hu/buttonsettings.ts \ | 25 | ../../../i18n/hu/buttonsettings.ts \ |
27 | ../../../i18n/ja/buttonsettings.ts \ | 26 | ../../../i18n/ja/buttonsettings.ts \ |
28 | ../../../i18n/ko/buttonsettings.ts \ | 27 | ../../../i18n/ko/buttonsettings.ts \ |
29 | ../../../i18n/no/buttonsettings.ts \ | 28 | ../../../i18n/no/buttonsettings.ts \ |
30 | ../../../i18n/pl/buttonsettings.ts \ | 29 | ../../../i18n/pl/buttonsettings.ts \ |
31 | ../../../i18n/pt/buttonsettings.ts \ | 30 | ../../../i18n/pt/buttonsettings.ts \ |
32 | ../../../i18n/pt_BR/buttonsettings.ts \ | 31 | ../../../i18n/pt_BR/buttonsettings.ts \ |
33 | ../../../i18n/sl/buttonsettings.ts \ | 32 | ../../../i18n/sl/buttonsettings.ts \ |
34 | ../../../i18n/zh_CN/buttonsettings.ts \ | 33 | ../../../i18n/zh_CN/buttonsettings.ts \ |
35 | ../../../i18n/zh_TW/buttonsettings.ts \ | 34 | ../../../i18n/zh_TW/buttonsettings.ts \ |
36 | ../../../i18n/da/buttonsettings.ts | 35 | ../../../i18n/da/buttonsettings.ts |
37 | 36 | ||
38 | |||
39 | |||
40 | include ( $(OPIEDIR)/include.pro ) | 37 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index 942d5e4..b6a07a8 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -1,256 +1,256 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | 31 | ||
32 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
33 | 33 | ||
34 | #include <opie/odevice.h> | 34 | #include <opie/odevice.h> |
35 | 35 | ||
36 | #include "buttonsettings.h" | 36 | #include "buttonsettings.h" |
37 | #include "buttonutils.h" | 37 | #include "buttonutils.h" |
38 | #include "remapdlg.h" | 38 | #include "remapdlg.h" |
39 | 39 | ||
40 | using namespace Opie; | 40 | using namespace Opie; |
41 | 41 | ||
42 | struct buttoninfo { | 42 | struct buttoninfo { |
43 | const ODeviceButton *m_button; | 43 | const ODeviceButton *m_button; |
44 | int m_index; | 44 | int m_index; |
45 | 45 | ||
46 | OQCopMessage m_pmsg; | 46 | OQCopMessage m_pmsg; |
47 | QLabel *m_picon; | 47 | QLabel *m_picon; |
48 | QLabel *m_plabel; | 48 | QLabel *m_plabel; |
49 | 49 | ||
50 | OQCopMessage m_hmsg; | 50 | OQCopMessage m_hmsg; |
51 | QLabel *m_hicon; | 51 | QLabel *m_hicon; |
52 | QLabel *m_hlabel; | 52 | QLabel *m_hlabel; |
53 | 53 | ||
54 | bool m_pdirty : 1; | 54 | bool m_pdirty : 1; |
55 | bool m_hdirty : 1; | 55 | bool m_hdirty : 1; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | 58 | ||
59 | ButtonSettings::ButtonSettings ( ) | 59 | ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f ) |
60 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) | 60 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) |
61 | { | 61 | { |
62 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); | 62 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); |
63 | (void) ButtonUtils::inst ( ); // initialise | 63 | (void) ButtonUtils::inst ( ); // initialise |
64 | 64 | ||
65 | setCaption ( tr( "Button Settings" )); | 65 | setCaption ( tr( "Button Settings" )); |
66 | 66 | ||
67 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); | 67 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); |
68 | 68 | ||
69 | QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); | 69 | QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); |
70 | toplay-> addWidget ( l ); | 70 | toplay-> addWidget ( l ); |
71 | 71 | ||
72 | QGridLayout *lay = new QGridLayout ( toplay ); | 72 | QGridLayout *lay = new QGridLayout ( toplay ); |
73 | lay-> setMargin ( 0 ); | 73 | lay-> setMargin ( 0 ); |
74 | lay-> setColStretch ( 0, 0 ); | 74 | lay-> setColStretch ( 0, 0 ); |
75 | lay-> setColStretch ( 1, 0 ); | 75 | lay-> setColStretch ( 1, 0 ); |
76 | lay-> setColStretch ( 2, 0 ); | 76 | lay-> setColStretch ( 2, 0 ); |
77 | lay-> setColStretch ( 3, 10 ); | 77 | lay-> setColStretch ( 3, 10 ); |
78 | 78 | ||
79 | m_infos. setAutoDelete ( true ); | 79 | m_infos. setAutoDelete ( true ); |
80 | 80 | ||
81 | int i = 1; | 81 | int i = 1; |
82 | int index = 0; | 82 | int index = 0; |
83 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { | 83 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { |
84 | if ( it != buttons. begin ( )) { | 84 | if ( it != buttons. begin ( )) { |
85 | QFrame *f = new QFrame ( this ); | 85 | QFrame *f = new QFrame ( this ); |
86 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); | 86 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); |
87 | lay-> addMultiCellWidget ( f, i, i, 0, 3 ); | 87 | lay-> addMultiCellWidget ( f, i, i, 0, 3 ); |
88 | i++; | 88 | i++; |
89 | } | 89 | } |
90 | 90 | ||
91 | buttoninfo *bi = new buttoninfo ( ); | 91 | buttoninfo *bi = new buttoninfo ( ); |
92 | bi-> m_button = &(*it); | 92 | bi-> m_button = &(*it); |
93 | bi-> m_index = index++; | 93 | bi-> m_index = index++; |
94 | bi-> m_pmsg = (*it). pressedAction ( ); | 94 | bi-> m_pmsg = (*it). pressedAction ( ); |
95 | bi-> m_hmsg = (*it). heldAction ( ); | 95 | bi-> m_hmsg = (*it). heldAction ( ); |
96 | bi-> m_pdirty = false; | 96 | bi-> m_pdirty = false; |
97 | bi-> m_hdirty = false; | 97 | bi-> m_hdirty = false; |
98 | 98 | ||
99 | l = new QLabel ( this ); | 99 | l = new QLabel ( this ); |
100 | l-> setPixmap (( *it ). pixmap ( )); | 100 | l-> setPixmap (( *it ). pixmap ( )); |
101 | 101 | ||
102 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); | 102 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); |
103 | 103 | ||
104 | l = new QLabel ( tr( "Press:" ), this ); | 104 | l = new QLabel ( tr( "Press:" ), this ); |
105 | lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom ); | 105 | lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom ); |
106 | l = new QLabel ( tr( "Hold:" ), this ); | 106 | l = new QLabel ( tr( "Hold:" ), this ); |
107 | lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); | 107 | lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); |
108 | 108 | ||
109 | l = new QLabel ( this ); | 109 | l = new QLabel ( this ); |
110 | l-> setFixedSize ( 16, 16 ); | 110 | l-> setFixedSize ( 16, 16 ); |
111 | lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom ); | 111 | lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom ); |
112 | bi-> m_picon = l; | 112 | bi-> m_picon = l; |
113 | 113 | ||
114 | l = new QLabel ( this ); | 114 | l = new QLabel ( this ); |
115 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); | 115 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); |
116 | lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom ); | 116 | lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom ); |
117 | bi-> m_plabel = l; | 117 | bi-> m_plabel = l; |
118 | 118 | ||
119 | l = new QLabel ( this ); | 119 | l = new QLabel ( this ); |
120 | l-> setFixedSize ( 16, 16 ); | 120 | l-> setFixedSize ( 16, 16 ); |
121 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); | 121 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); |
122 | bi-> m_hicon = l; | 122 | bi-> m_hicon = l; |
123 | 123 | ||
124 | l = new QLabel ( this ); | 124 | l = new QLabel ( this ); |
125 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); | 125 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); |
126 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); | 126 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); |
127 | bi-> m_hlabel = l; | 127 | bi-> m_hlabel = l; |
128 | 128 | ||
129 | i += 2; | 129 | i += 2; |
130 | 130 | ||
131 | m_infos. append ( bi ); | 131 | m_infos. append ( bi ); |
132 | } | 132 | } |
133 | 133 | ||
134 | toplay-> addStretch ( 10 ); | 134 | toplay-> addStretch ( 10 ); |
135 | 135 | ||
136 | m_last_button = 0; | 136 | m_last_button = 0; |
137 | m_lock = false; | 137 | m_lock = false; |
138 | 138 | ||
139 | m_timer = new QTimer ( this ); | 139 | m_timer = new QTimer ( this ); |
140 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( ))); | 140 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( ))); |
141 | 141 | ||
142 | updateLabels ( ); | 142 | updateLabels ( ); |
143 | 143 | ||
144 | QPEApplication::grabKeyboard ( ); | 144 | QPEApplication::grabKeyboard ( ); |
145 | } | 145 | } |
146 | 146 | ||
147 | ButtonSettings::~ButtonSettings ( ) | 147 | ButtonSettings::~ButtonSettings ( ) |
148 | { | 148 | { |
149 | QPEApplication::ungrabKeyboard ( ); | 149 | QPEApplication::ungrabKeyboard ( ); |
150 | } | 150 | } |
151 | 151 | ||
152 | void ButtonSettings::updateLabels ( ) | 152 | void ButtonSettings::updateLabels ( ) |
153 | { | 153 | { |
154 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 154 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
155 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); | 155 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); |
156 | 156 | ||
157 | (*it)-> m_picon-> setPixmap ( cip. m_icon ); | 157 | (*it)-> m_picon-> setPixmap ( cip. m_icon ); |
158 | (*it)-> m_plabel-> setText ( cip. m_name ); | 158 | (*it)-> m_plabel-> setText ( cip. m_name ); |
159 | 159 | ||
160 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); | 160 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); |
161 | 161 | ||
162 | (*it)-> m_hicon-> setPixmap ( cih. m_icon ); | 162 | (*it)-> m_hicon-> setPixmap ( cih. m_icon ); |
163 | (*it)-> m_hlabel-> setText ( cih. m_name ); | 163 | (*it)-> m_hlabel-> setText ( cih. m_name ); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | 166 | ||
167 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) | 167 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) |
168 | { | 168 | { |
169 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 169 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
170 | if ((*it)-> m_button-> keycode ( ) == key ) | 170 | if ((*it)-> m_button-> keycode ( ) == key ) |
171 | return *it; | 171 | return *it; |
172 | } | 172 | } |
173 | return 0; | 173 | return 0; |
174 | } | 174 | } |
175 | 175 | ||
176 | void ButtonSettings::keyPressEvent ( QKeyEvent *e ) | 176 | void ButtonSettings::keyPressEvent ( QKeyEvent *e ) |
177 | { | 177 | { |
178 | buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); | 178 | buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); |
179 | 179 | ||
180 | if ( bi && !e-> isAutoRepeat ( )) { | 180 | if ( bi && !e-> isAutoRepeat ( )) { |
181 | m_timer-> stop ( ); | 181 | m_timer-> stop ( ); |
182 | m_last_button = bi; | 182 | m_last_button = bi; |
183 | m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); | 183 | m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); |
184 | } | 184 | } |
185 | else | 185 | else |
186 | QDialog::keyPressEvent ( e ); | 186 | QDialog::keyPressEvent ( e ); |
187 | } | 187 | } |
188 | 188 | ||
189 | void ButtonSettings::keyReleaseEvent ( QKeyEvent *e ) | 189 | void ButtonSettings::keyReleaseEvent ( QKeyEvent *e ) |
190 | { | 190 | { |
191 | buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); | 191 | buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); |
192 | 192 | ||
193 | if ( bi && !e-> isAutoRepeat ( ) && m_timer-> isActive ( )) { | 193 | if ( bi && !e-> isAutoRepeat ( ) && m_timer-> isActive ( )) { |
194 | m_timer-> stop ( ); | 194 | m_timer-> stop ( ); |
195 | edit ( bi, false ); | 195 | edit ( bi, false ); |
196 | } | 196 | } |
197 | else | 197 | else |
198 | QDialog::keyReleaseEvent ( e ); | 198 | QDialog::keyReleaseEvent ( e ); |
199 | } | 199 | } |
200 | 200 | ||
201 | void ButtonSettings::keyTimeout ( ) | 201 | void ButtonSettings::keyTimeout ( ) |
202 | { | 202 | { |
203 | if ( m_last_button ) { | 203 | if ( m_last_button ) { |
204 | edit ( m_last_button, true ); | 204 | edit ( m_last_button, true ); |
205 | m_last_button = false; | 205 | m_last_button = false; |
206 | } | 206 | } |
207 | } | 207 | } |
208 | 208 | ||
209 | void ButtonSettings::edit ( buttoninfo *bi, bool hold ) | 209 | void ButtonSettings::edit ( buttoninfo *bi, bool hold ) |
210 | { | 210 | { |
211 | 211 | ||
212 | if ( m_lock ) | 212 | if ( m_lock ) |
213 | return; | 213 | return; |
214 | m_lock = true; | 214 | m_lock = true; |
215 | 215 | ||
216 | RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); | 216 | RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); |
217 | 217 | ||
218 | d-> showMaximized ( ); | 218 | d-> showMaximized ( ); |
219 | if ( d-> exec ( ) == QDialog::Accepted ) { | 219 | if ( d-> exec ( ) == QDialog::Accepted ) { |
220 | 220 | ||
221 | 221 | ||
222 | if ( hold ) { | 222 | if ( hold ) { |
223 | bi-> m_hmsg = d-> message ( ); | 223 | bi-> m_hmsg = d-> message ( ); |
224 | bi-> m_hdirty = true; | 224 | bi-> m_hdirty = true; |
225 | } | 225 | } |
226 | else { | 226 | else { |
227 | bi-> m_pmsg = d-> message ( ); | 227 | bi-> m_pmsg = d-> message ( ); |
228 | bi-> m_pdirty = true; | 228 | bi-> m_pdirty = true; |
229 | } | 229 | } |
230 | 230 | ||
231 | updateLabels ( ); | 231 | updateLabels ( ); |
232 | } | 232 | } |
233 | 233 | ||
234 | delete d; | 234 | delete d; |
235 | 235 | ||
236 | m_lock = false; | 236 | m_lock = false; |
237 | } | 237 | } |
238 | 238 | ||
239 | void ButtonSettings::accept ( ) | 239 | void ButtonSettings::accept ( ) |
240 | { | 240 | { |
241 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 241 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
242 | buttoninfo *bi = *it; | 242 | buttoninfo *bi = *it; |
243 | 243 | ||
244 | if ( bi-> m_pdirty ) | 244 | if ( bi-> m_pdirty ) |
245 | ODevice::inst ( )-> remapPressedAction ( bi-> m_index, bi-> m_pmsg ); | 245 | ODevice::inst ( )-> remapPressedAction ( bi-> m_index, bi-> m_pmsg ); |
246 | if ( bi-> m_hdirty ) | 246 | if ( bi-> m_hdirty ) |
247 | ODevice::inst ( )-> remapHeldAction ( bi-> m_index, bi-> m_hmsg ); | 247 | ODevice::inst ( )-> remapHeldAction ( bi-> m_index, bi-> m_hmsg ); |
248 | } | 248 | } |
249 | QDialog::accept ( ); | 249 | QDialog::accept ( ); |
250 | } | 250 | } |
251 | 251 | ||
252 | void ButtonSettings::done ( int r ) | 252 | void ButtonSettings::done ( int r ) |
253 | { | 253 | { |
254 | QDialog::done ( r ); | 254 | QDialog::done ( r ); |
255 | close ( ); | 255 | close ( ); |
256 | } | 256 | } |
diff --git a/core/settings/button/buttonsettings.h b/core/settings/button/buttonsettings.h index d41a209..67694d3 100644 --- a/core/settings/button/buttonsettings.h +++ b/core/settings/button/buttonsettings.h | |||
@@ -21,51 +21,52 @@ | |||
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef __BUTTON_SETTINGS_H__ | 28 | #ifndef __BUTTON_SETTINGS_H__ |
29 | #define __BUTTON_SETTINGS_H__ | 29 | #define __BUTTON_SETTINGS_H__ |
30 | 30 | ||
31 | #include <qdialog.h> | 31 | #include <qdialog.h> |
32 | #include <qlist.h> | 32 | #include <qlist.h> |
33 | #include <opie/odevice.h> | 33 | #include <opie/odevice.h> |
34 | 34 | ||
35 | class QTimer; | 35 | class QTimer; |
36 | 36 | ||
37 | using namespace Opie; | 37 | using namespace Opie; |
38 | 38 | ||
39 | class buttoninfo; | 39 | class buttoninfo; |
40 | 40 | ||
41 | class ButtonSettings : public QDialog { | 41 | class ButtonSettings : public QDialog { |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | 43 | ||
44 | public: | 44 | public: |
45 | ButtonSettings ( ); | 45 | ButtonSettings ( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0 ); |
46 | ~ButtonSettings ( ); | 46 | ~ButtonSettings ( ); |
47 | 47 | ||
48 | static QString appName() { return QString::fromLatin1("buttonsettings"); } | ||
48 | virtual void accept ( ); | 49 | virtual void accept ( ); |
49 | virtual void done ( int r ); | 50 | virtual void done ( int r ); |
50 | 51 | ||
51 | private slots: | 52 | private slots: |
52 | void keyTimeout ( ); | 53 | void keyTimeout ( ); |
53 | void updateLabels ( ); | 54 | void updateLabels ( ); |
54 | 55 | ||
55 | protected: | 56 | protected: |
56 | virtual void keyPressEvent ( QKeyEvent *e ); | 57 | virtual void keyPressEvent ( QKeyEvent *e ); |
57 | virtual void keyReleaseEvent ( QKeyEvent *e ); | 58 | virtual void keyReleaseEvent ( QKeyEvent *e ); |
58 | 59 | ||
59 | private: | 60 | private: |
60 | buttoninfo *buttonInfoForKeycode ( ushort key ); | 61 | buttoninfo *buttonInfoForKeycode ( ushort key ); |
61 | 62 | ||
62 | void edit ( buttoninfo *bi, bool hold ); | 63 | void edit ( buttoninfo *bi, bool hold ); |
63 | QString qcopToString ( const OQCopMessage &c ); | 64 | QString qcopToString ( const OQCopMessage &c ); |
64 | 65 | ||
65 | private: | 66 | private: |
66 | QTimer *m_timer; | 67 | QTimer *m_timer; |
67 | buttoninfo *m_last_button; | 68 | buttoninfo *m_last_button; |
68 | 69 | ||
69 | QList <buttoninfo> m_infos; | 70 | QList <buttoninfo> m_infos; |
70 | bool m_lock; | 71 | bool m_lock; |
71 | }; | 72 | }; |
diff --git a/core/settings/button/main.cpp b/core/settings/button/main.cpp index db274f8..c063c3c 100644 --- a/core/settings/button/main.cpp +++ b/core/settings/button/main.cpp | |||
@@ -1,43 +1,33 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "buttonsettings.h" | 28 | #include "buttonsettings.h" |
29 | 29 | ||
30 | #include <qpe/qpeapplication.h> | 30 | #include <qpe/qpeapplication.h> |
31 | #include <opie/oapplicationfactory.h> | ||
31 | 32 | ||
32 | 33 | OPIE_EXPORT_APP( OApplicationFactory<ButtonSettings> ) | |
33 | int main ( int argc, char** argv ) | ||
34 | { | ||
35 | QPEApplication a ( argc,argv ); | ||
36 | |||
37 | ButtonSettings dlg; | ||
38 | a. showMainWidget ( &dlg ); | ||
39 | dlg. showMaximized ( ); | ||
40 | |||
41 | return a. exec ( ); | ||
42 | } | ||
43 | |||
diff --git a/core/settings/citytime/citytime.h b/core/settings/citytime/citytime.h index 63e3102..cc3d487 100644 --- a/core/settings/citytime/citytime.h +++ b/core/settings/citytime/citytime.h | |||
@@ -15,49 +15,49 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #ifndef TIMEWIDGETIMPL_H | 21 | #ifndef TIMEWIDGETIMPL_H |
22 | #define TIMEWIDGETIMPL_H | 22 | #define TIMEWIDGETIMPL_H |
23 | 23 | ||
24 | #include <qlist.h> | 24 | #include <qlist.h> |
25 | #include <qwidget.h> | 25 | #include <qwidget.h> |
26 | 26 | ||
27 | #include "citytimebase.h" | 27 | #include "citytimebase.h" |
28 | 28 | ||
29 | const int CITIES = 6; // the number of cities... | 29 | const int CITIES = 6; // the number of cities... |
30 | 30 | ||
31 | class ZoneMap; | 31 | class ZoneMap; |
32 | 32 | ||
33 | class CityTime : public CityTimeBase | 33 | class CityTime : public CityTimeBase |
34 | { | 34 | { |
35 | Q_OBJECT | 35 | Q_OBJECT |
36 | public: | 36 | public: |
37 | CityTime(QWidget* parent = 0, const char *name = 0, WFlags fl = 0); | 37 | CityTime(QWidget* parent = 0, const char *name = 0, WFlags fl = 0); |
38 | ~CityTime(); | 38 | ~CityTime(); |
39 | 39 | static QString appName() { return QString::fromLatin1("citytime"); } | |
40 | public slots: | 40 | public slots: |
41 | void beginNewTz(); | 41 | void beginNewTz(); |
42 | void slotNewTz( const QString& strNewCountry, const QString& strNewCity ); | 42 | void slotNewTz( const QString& strNewCountry, const QString& strNewCity ); |
43 | void changeClock( bool newClock ); | 43 | void changeClock( bool newClock ); |
44 | 44 | ||
45 | protected: | 45 | protected: |
46 | void timerEvent( QTimerEvent* ); | 46 | void timerEvent( QTimerEvent* ); |
47 | void mousePressEvent( QMouseEvent* event ); | 47 | void mousePressEvent( QMouseEvent* event ); |
48 | 48 | ||
49 | private: | 49 | private: |
50 | void showTime( void ); // get and show the time for various places... | 50 | void showTime( void ); // get and show the time for various places... |
51 | void readInTimes( void ); // a method to get information from the config | 51 | void readInTimes( void ); // a method to get information from the config |
52 | QString strRealTz; // save the TZ var | 52 | QString strRealTz; // save the TZ var |
53 | QString nameRealTz; // and what it is called | 53 | QString nameRealTz; // and what it is called |
54 | QString strHome; // the home variable... | 54 | QString strHome; // the home variable... |
55 | bool bAdded; // a flag to indicate things have been added... | 55 | bool bAdded; // a flag to indicate things have been added... |
56 | bool bWhichClock; | 56 | bool bWhichClock; |
57 | int timerId; | 57 | int timerId; |
58 | 58 | ||
59 | 59 | ||
60 | QWidget* selWidget; | 60 | QWidget* selWidget; |
61 | // a spot to hold the time zone for each city | 61 | // a spot to hold the time zone for each city |
62 | QString strCityTz[CITIES]; | 62 | QString strCityTz[CITIES]; |
63 | QList<QToolButton> listCities; | 63 | QList<QToolButton> listCities; |
diff --git a/core/settings/citytime/citytime.pro b/core/settings/citytime/citytime.pro index c7f4d08..402bcf6 100644 --- a/core/settings/citytime/citytime.pro +++ b/core/settings/citytime/citytime.pro | |||
@@ -1,32 +1,30 @@ | |||
1 | CONFIG += qt warn_on release | 1 | CONFIG += qt warn_on release quick-app |
2 | TEMPLATE = app | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | #INTERFACES = citytimebase.ui | ||
5 | HEADERS = citytime.h citytimebase.h zonemap.h sun.h stylusnormalizer.h | 2 | HEADERS = citytime.h citytimebase.h zonemap.h sun.h stylusnormalizer.h |
6 | SOURCES = citytime.cpp citytimebase.cpp zonemap.cpp main.cpp sun.c stylusnormalizer.cpp | 3 | SOURCES = citytime.cpp citytimebase.cpp zonemap.cpp main.cpp sun.c stylusnormalizer.cpp |
7 | TARGET = citytime | ||
8 | INCLUDEPATH += $(OPIEDIR)/include | 4 | INCLUDEPATH += $(OPIEDIR)/include |
9 | DEPENDPATH += $(OPIEDIR)/include | 5 | DEPENDPATH += $(OPIEDIR)/include |
10 | LIBS += -lqpe | 6 | LIBS += -lqpe |
11 | 7 | ||
8 | TARGET= citytime | ||
9 | |||
12 | TRANSLATIONS = ../../../i18n/de/citytime.ts \ | 10 | TRANSLATIONS = ../../../i18n/de/citytime.ts \ |
13 | ../../../i18n/nl/citytime.ts \ | 11 | ../../../i18n/nl/citytime.ts \ |
14 | ../../../i18n/xx/citytime.ts \ | 12 | ../../../i18n/xx/citytime.ts \ |
15 | ../../../i18n/en/citytime.ts \ | 13 | ../../../i18n/en/citytime.ts \ |
16 | ../../../i18n/es/citytime.ts \ | 14 | ../../../i18n/es/citytime.ts \ |
17 | ../../../i18n/fr/citytime.ts \ | 15 | ../../../i18n/fr/citytime.ts \ |
18 | ../../../i18n/hu/citytime.ts \ | 16 | ../../../i18n/hu/citytime.ts \ |
19 | ../../../i18n/ja/citytime.ts \ | 17 | ../../../i18n/ja/citytime.ts \ |
20 | ../../../i18n/ko/citytime.ts \ | 18 | ../../../i18n/ko/citytime.ts \ |
21 | ../../../i18n/no/citytime.ts \ | 19 | ../../../i18n/no/citytime.ts \ |
22 | ../../../i18n/pl/citytime.ts \ | 20 | ../../../i18n/pl/citytime.ts \ |
23 | ../../../i18n/pt/citytime.ts \ | 21 | ../../../i18n/pt/citytime.ts \ |
24 | ../../../i18n/pt_BR/citytime.ts \ | 22 | ../../../i18n/pt_BR/citytime.ts \ |
25 | ../../../i18n/sl/citytime.ts \ | 23 | ../../../i18n/sl/citytime.ts \ |
26 | ../../../i18n/zh_CN/citytime.ts \ | 24 | ../../../i18n/zh_CN/citytime.ts \ |
27 | ../../../i18n/zh_TW/citytime.ts \ | 25 | ../../../i18n/zh_TW/citytime.ts \ |
28 | ../../../i18n/da/citytime.ts | 26 | ../../../i18n/da/citytime.ts |
29 | 27 | ||
30 | 28 | ||
31 | 29 | ||
32 | include ( $(OPIEDIR)/include.pro ) | 30 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/settings/citytime/main.cpp b/core/settings/citytime/main.cpp index e8664c6..69bfe44 100644 --- a/core/settings/citytime/main.cpp +++ b/core/settings/citytime/main.cpp | |||
@@ -1,30 +1,25 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "citytime.h" | 21 | #include "citytime.h" |
22 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
23 | #include <opie/oapplicationfactory.h> | ||
23 | 24 | ||
24 | int main( int argc, char** argv ) | 25 | OPIE_EXPORT_APP( OApplicationFactory<CityTime> ) |
25 | { | ||
26 | QPEApplication a( argc, argv ); | ||
27 | CityTime main; | ||
28 | a.showMainWidget( &main ); | ||
29 | return a.exec(); | ||
30 | } | ||
diff --git a/core/settings/launcher/launcher.pro b/core/settings/launcher/launcher.pro index cea268d..9d05832 100644 --- a/core/settings/launcher/launcher.pro +++ b/core/settings/launcher/launcher.pro | |||
@@ -1,27 +1,25 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = launchersettings.h \ | 2 | HEADERS = launchersettings.h \ |
5 | tabssettings.h \ | 3 | tabssettings.h \ |
6 | taskbarsettings.h \ | 4 | taskbarsettings.h \ |
7 | menusettings.h \ | 5 | menusettings.h \ |
8 | inputmethodsettings.h \ | 6 | inputmethodsettings.h \ |
9 | tabconfig.h \ | 7 | tabconfig.h \ |
10 | tabdialog.h | 8 | tabdialog.h |
11 | 9 | ||
12 | SOURCES = main.cpp \ | 10 | SOURCES = main.cpp \ |
13 | launchersettings.cpp \ | 11 | launchersettings.cpp \ |
14 | tabssettings.cpp \ | 12 | tabssettings.cpp \ |
15 | taskbarsettings.cpp \ | 13 | taskbarsettings.cpp \ |
16 | menusettings.cpp \ | 14 | menusettings.cpp \ |
17 | inputmethodsettings.cpp \ | 15 | inputmethodsettings.cpp \ |
18 | tabdialog.cpp | 16 | tabdialog.cpp |
19 | 17 | ||
20 | INCLUDEPATH += $(OPIEDIR)/include | 18 | INCLUDEPATH += $(OPIEDIR)/include |
21 | DEPENDPATH += $(OPIEDIR)/include | 19 | DEPENDPATH += $(OPIEDIR)/include |
22 | LIBS += -lqpe -lopie | 20 | LIBS += -lqpe -lopie |
23 | TARGET = launchersettings | 21 | TARGET = launchersettings |
24 | 22 | ||
25 | 23 | ||
26 | 24 | ||
27 | 25 | ||
diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index 3982194..efc4a86 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp | |||
@@ -16,49 +16,50 @@ | |||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | 31 | ||
32 | #include <opie/otabwidget.h> | 32 | #include <opie/otabwidget.h> |
33 | 33 | ||
34 | #include "launchersettings.h" | 34 | #include "launchersettings.h" |
35 | #include "tabssettings.h" | 35 | #include "tabssettings.h" |
36 | #include "menusettings.h" | 36 | #include "menusettings.h" |
37 | #include "taskbarsettings.h" | 37 | #include "taskbarsettings.h" |
38 | #include "inputmethodsettings.h" | 38 | #include "inputmethodsettings.h" |
39 | 39 | ||
40 | LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) | 40 | LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) |
41 | : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) | ||
41 | { | 42 | { |
42 | setCaption ( tr( "Launcher Settings" )); | 43 | setCaption ( tr( "Launcher Settings" )); |
43 | 44 | ||
44 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 45 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
45 | 46 | ||
46 | OTabWidget *tw = new OTabWidget ( this, "otab" ); | 47 | OTabWidget *tw = new OTabWidget ( this, "otab" ); |
47 | lay-> addWidget ( tw ); | 48 | lay-> addWidget ( tw ); |
48 | 49 | ||
49 | m_tabs = new TabsSettings ( tw ); | 50 | m_tabs = new TabsSettings ( tw ); |
50 | m_taskbar = new TaskbarSettings ( tw ); | 51 | m_taskbar = new TaskbarSettings ( tw ); |
51 | m_menu = new MenuSettings ( tw ); | 52 | m_menu = new MenuSettings ( tw ); |
52 | m_imethods = new InputMethodSettings ( tw ); | 53 | m_imethods = new InputMethodSettings ( tw ); |
53 | 54 | ||
54 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); | 55 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); |
55 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); | 56 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); |
56 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); | 57 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); |
57 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); | 58 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); |
58 | 59 | ||
59 | tw-> setCurrentTab ( m_taskbar ); | 60 | tw-> setCurrentTab ( m_taskbar ); |
60 | } | 61 | } |
61 | 62 | ||
62 | void LauncherSettings::accept ( ) | 63 | void LauncherSettings::accept ( ) |
63 | { | 64 | { |
64 | m_taskbar-> accept ( ); | 65 | m_taskbar-> accept ( ); |
diff --git a/core/settings/launcher/launchersettings.h b/core/settings/launcher/launchersettings.h index 71165a3..7458d8b 100644 --- a/core/settings/launcher/launchersettings.h +++ b/core/settings/launcher/launchersettings.h | |||
@@ -18,37 +18,38 @@ | |||
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef __LAUNCHER_SETTINGS_H__ | 28 | #ifndef __LAUNCHER_SETTINGS_H__ |
29 | #define __LAUNCHER_SETTINGS_H__ | 29 | #define __LAUNCHER_SETTINGS_H__ |
30 | 30 | ||
31 | #include <qdialog.h> | 31 | #include <qdialog.h> |
32 | 32 | ||
33 | class TabsSettings; | 33 | class TabsSettings; |
34 | class TaskbarSettings; | 34 | class TaskbarSettings; |
35 | class MenuSettings; | 35 | class MenuSettings; |
36 | class InputMethodSettings; | 36 | class InputMethodSettings; |
37 | 37 | ||
38 | class LauncherSettings : public QDialog { | 38 | class LauncherSettings : public QDialog { |
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | 40 | ||
41 | public: | 41 | public: |
42 | LauncherSettings ( ); | 42 | static QString appName() { return QString::fromLatin1("launchersettings"); } |
43 | LauncherSettings (QWidget *parent = 0, const char* name = 0, WFlags fl = 0 ); | ||
43 | 44 | ||
44 | virtual void accept ( ); | 45 | virtual void accept ( ); |
45 | virtual void done ( int r ); | 46 | virtual void done ( int r ); |
46 | 47 | ||
47 | private: | 48 | private: |
48 | TabsSettings *m_tabs; | 49 | TabsSettings *m_tabs; |
49 | TaskbarSettings *m_taskbar; | 50 | TaskbarSettings *m_taskbar; |
50 | MenuSettings *m_menu; | 51 | MenuSettings *m_menu; |
51 | InputMethodSettings* m_imethods; | 52 | InputMethodSettings* m_imethods; |
52 | }; | 53 | }; |
53 | 54 | ||
54 | #endif | 55 | #endif |
diff --git a/core/settings/launcher/main.cpp b/core/settings/launcher/main.cpp index f65dab8..4cc1d35 100644 --- a/core/settings/launcher/main.cpp +++ b/core/settings/launcher/main.cpp | |||
@@ -7,37 +7,29 @@ | |||
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "launchersettings.h" | 28 | #include "launchersettings.h" |
29 | 29 | ||
30 | #include <qpe/qpeapplication.h> | 30 | #include <qpe/qpeapplication.h> |
31 | #include <opie/oapplicationfactory.h> | ||
31 | 32 | ||
33 | OPIE_EXPORT_APP( OApplicationFactory<LauncherSettings> ) | ||
32 | 34 | ||
33 | int main ( int argc, char** argv ) | ||
34 | { | ||
35 | QPEApplication a ( argc,argv ); | ||
36 | |||
37 | LauncherSettings dlg; | ||
38 | a. showMainWidget ( &dlg ); | ||
39 | dlg. showMaximized ( ); | ||
40 | |||
41 | return a. exec ( ); | ||
42 | } | ||
43 | 35 | ||
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp index 6fca621..faa7cf4 100644 --- a/core/settings/launcher/menusettings.cpp +++ b/core/settings/launcher/menusettings.cpp | |||
@@ -1,90 +1,93 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "menusettings.h" | 29 | #include "menusettings.h" |
30 | 30 | ||
31 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | #include <qpe/qlibrary.h> | 32 | #include <qpe/qlibrary.h> |
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/menuappletinterface.h> | 34 | #include <qpe/menuappletinterface.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 35 | #include <qpe/qcopenvelope_qws.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qheader.h> | 40 | #include <qheader.h> |
41 | #include <qlayout.h> | 41 | #include <qlayout.h> |
42 | #include <qlabel.h> | 42 | #include <qlabel.h> |
43 | #include <qwhatsthis.h> | 43 | #include <qwhatsthis.h> |
44 | 44 | ||
45 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | 46 | ||
47 | 47 | ||
48 | MenuSettings::MenuSettings ( QWidget *parent, const char *name ) | 48 | MenuSettings::MenuSettings ( QWidget *parent, const char *name ) |
49 | : QWidget ( parent, name ) | 49 | : QWidget ( parent, name ) |
50 | { | 50 | { |
51 | m_applets_changed = false; | 51 | m_applets_changed = false; |
52 | 52 | ||
53 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 53 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
54 | 54 | ||
55 | QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); | 55 | QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); |
56 | lay-> addWidget ( l ); | 56 | lay-> addWidget ( l ); |
57 | 57 | ||
58 | m_list = new QListView ( this ); | 58 | m_list = new QListView ( this ); |
59 | m_list-> addColumn ( "foobar" ); | 59 | m_list-> addColumn ( "foobar" ); |
60 | m_list-> header ( )-> hide ( ); | 60 | m_list-> header ( )-> hide ( ); |
61 | 61 | ||
62 | lay-> addWidget ( m_list ); | 62 | lay-> addWidget ( m_list ); |
63 | 63 | ||
64 | m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); | 64 | m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); |
65 | lay-> addWidget ( m_menutabs ); | 65 | lay-> addWidget ( m_menutabs ); |
66 | 66 | ||
67 | m_menusubpopup = new QCheckBox ( tr( "Show Applications in subpopups" ), this ); | ||
68 | lay-> addWidget ( m_menusubpopup ); | ||
69 | |||
67 | QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." )); | 70 | QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." )); |
68 | QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." )); | 71 | QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." )); |
69 | 72 | ||
70 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); | 73 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); |
71 | 74 | ||
72 | init ( ); | 75 | init ( ); |
73 | } | 76 | } |
74 | 77 | ||
75 | void MenuSettings::init ( ) | 78 | void MenuSettings::init ( ) |
76 | { | 79 | { |
77 | Config cfg ( "StartMenu" ); | 80 | Config cfg ( "StartMenu" ); |
78 | cfg. setGroup ( "Applets" ); | 81 | cfg. setGroup ( "Applets" ); |
79 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 82 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
80 | 83 | ||
81 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 84 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
82 | #ifdef Q_OS_MACX | 85 | #ifdef Q_OS_MACX |
83 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); | 86 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); |
84 | #else | 87 | #else |
85 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 88 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
86 | #endif /* Q_OS_MACX */ | 89 | #endif /* Q_OS_MACX */ |
87 | 90 | ||
88 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 91 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
89 | QString name; | 92 | QString name; |
90 | QPixmap icon; | 93 | QPixmap icon; |
@@ -98,66 +101,75 @@ void MenuSettings::init ( ) | |||
98 | QString type = (*it). left ((*it). find (".")); | 101 | QString type = (*it). left ((*it). find (".")); |
99 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; | 102 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; |
100 | if ( trans-> load ( tfn )) | 103 | if ( trans-> load ( tfn )) |
101 | qApp-> installTranslator ( trans ); | 104 | qApp-> installTranslator ( trans ); |
102 | else | 105 | else |
103 | delete trans; | 106 | delete trans; |
104 | name = iface-> name ( ); | 107 | name = iface-> name ( ); |
105 | icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); | 108 | icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); |
106 | iface-> release ( ); | 109 | iface-> release ( ); |
107 | lib-> unload ( ); | 110 | lib-> unload ( ); |
108 | 111 | ||
109 | QCheckListItem *item; | 112 | QCheckListItem *item; |
110 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); | 113 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); |
111 | if ( !icon. isNull ( )) | 114 | if ( !icon. isNull ( )) |
112 | item-> setPixmap ( 0, icon ); | 115 | item-> setPixmap ( 0, icon ); |
113 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); | 116 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); |
114 | m_applets [*it] = item; | 117 | m_applets [*it] = item; |
115 | } else { | 118 | } else { |
116 | delete lib; | 119 | delete lib; |
117 | } | 120 | } |
118 | } | 121 | } |
119 | 122 | ||
120 | cfg. setGroup ( "Menu" ); | 123 | cfg. setGroup ( "Menu" ); |
121 | m_menutabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true )); | 124 | m_menutabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true )); |
125 | m_menusubpopup-> setChecked ( cfg. readBoolEntry ( "LauncherSubPopup", true )); | ||
122 | } | 126 | } |
123 | 127 | ||
124 | void MenuSettings::appletChanged() | 128 | void MenuSettings::appletChanged() |
125 | { | 129 | { |
126 | m_applets_changed = true; | 130 | m_applets_changed = true; |
127 | } | 131 | } |
128 | 132 | ||
129 | void MenuSettings::accept ( ) | 133 | void MenuSettings::accept ( ) |
130 | { | 134 | { |
131 | bool apps_changed = false; | 135 | bool apps_changed = false; |
132 | 136 | ||
133 | Config cfg ( "StartMenu" ); | 137 | Config cfg ( "StartMenu" ); |
134 | cfg. setGroup ( "Applets" ); | 138 | cfg. setGroup ( "Applets" ); |
135 | if ( m_applets_changed ) { | 139 | if ( m_applets_changed ) { |
136 | QStringList exclude; | 140 | QStringList exclude; |
137 | QMap <QString, QCheckListItem *>::Iterator it; | 141 | QMap <QString, QCheckListItem *>::Iterator it; |
138 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { | 142 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { |
139 | if ( !(*it)-> isOn ( )) | 143 | if ( !(*it)-> isOn ( )) |
140 | exclude << it. key ( ); | 144 | exclude << it. key ( ); |
141 | } | 145 | } |
142 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); | 146 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); |
143 | } | 147 | } |
144 | cfg. writeEntry ( "SafeMode", false ); | 148 | cfg. writeEntry ( "SafeMode", false ); |
145 | 149 | ||
146 | cfg. setGroup ( "Menu" ); | 150 | cfg. setGroup ( "Menu" ); |
147 | 151 | ||
148 | if ( m_menutabs-> isChecked ( ) != cfg. readBoolEntry ( "LauncherTabs", true )) { | 152 | if ( m_menutabs-> isChecked ( ) != cfg. readBoolEntry ( "LauncherTabs", true )) { |
149 | apps_changed = true; | 153 | apps_changed = true; |
150 | cfg. writeEntry ( "LauncherTabs", m_menutabs-> isChecked ( )); | 154 | cfg. writeEntry ( "LauncherTabs", m_menutabs-> isChecked ( )); |
151 | } | 155 | } |
152 | 156 | ||
157 | if ( m_menusubpopup-> isChecked ( ) != cfg. readBoolEntry ( "LauncherSubPopup", true )) { | ||
158 | apps_changed = true; | ||
159 | cfg. writeEntry ( "LauncherSubPopup", m_menusubpopup-> isChecked ( )); | ||
160 | } | ||
161 | |||
153 | cfg. write ( ); | 162 | cfg. write ( ); |
154 | 163 | ||
155 | if ( m_applets_changed ) { | 164 | if ( m_applets_changed ) { |
156 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); | 165 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); |
157 | m_applets_changed = false; | 166 | m_applets_changed = false; |
158 | } | 167 | } |
159 | if ( apps_changed ) { | 168 | if ( apps_changed ) { |
169 | // currently use reloadApplets() since reloadApps is now used exclusive for server | ||
170 | // to refresh the tabs. But what we want here is also a refresh of the startmenu entries | ||
160 | QCopEnvelope ( "QPE/TaskBar", "reloadApps()" ); | 171 | QCopEnvelope ( "QPE/TaskBar", "reloadApps()" ); |
172 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); | ||
161 | } | 173 | } |
162 | } | 174 | } |
163 | 175 | ||
diff --git a/core/settings/launcher/menusettings.h b/core/settings/launcher/menusettings.h index 5986958..5bb7afa 100644 --- a/core/settings/launcher/menusettings.h +++ b/core/settings/launcher/menusettings.h | |||
@@ -33,28 +33,28 @@ | |||
33 | 33 | ||
34 | class QListView; | 34 | class QListView; |
35 | class QCheckListItem; | 35 | class QCheckListItem; |
36 | class QCheckBox; | 36 | class QCheckBox; |
37 | 37 | ||
38 | 38 | ||
39 | class MenuSettings : public QWidget { | 39 | class MenuSettings : public QWidget { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | 41 | ||
42 | public: | 42 | public: |
43 | MenuSettings ( QWidget *parent = 0, const char *name = 0 ); | 43 | MenuSettings ( QWidget *parent = 0, const char *name = 0 ); |
44 | 44 | ||
45 | void accept ( ); | 45 | void accept ( ); |
46 | 46 | ||
47 | protected slots: | 47 | protected slots: |
48 | void appletChanged ( ); | 48 | void appletChanged ( ); |
49 | 49 | ||
50 | protected: | 50 | protected: |
51 | void init ( ); | 51 | void init ( ); |
52 | 52 | ||
53 | private: | 53 | private: |
54 | QListView *m_list; | 54 | QListView *m_list; |
55 | QMap <QString, QCheckListItem *> m_applets; | 55 | QMap <QString, QCheckListItem *> m_applets; |
56 | bool m_applets_changed; | 56 | bool m_applets_changed; |
57 | QCheckBox *m_menutabs; | 57 | QCheckBox *m_menutabs, *m_menusubpopup; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #endif | 60 | #endif |
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 7cd00bd..3d8b456 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -60,88 +60,88 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | |||
60 | 60 | ||
61 | m_list = new QListBox ( this ); | 61 | m_list = new QListBox ( this ); |
62 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); | 62 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); |
63 | 63 | ||
64 | QWhatsThis::add ( m_list, tr( "foobar" )); | 64 | QWhatsThis::add ( m_list, tr( "foobar" )); |
65 | 65 | ||
66 | QPushButton *p1, *p2, *p3; | 66 | QPushButton *p1, *p2, *p3; |
67 | p1 = new QPushButton ( tr( "New" ), this ); | 67 | p1 = new QPushButton ( tr( "New" ), this ); |
68 | lay-> addWidget ( p1, 1, 1 ); | 68 | lay-> addWidget ( p1, 1, 1 ); |
69 | connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); | 69 | connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); |
70 | 70 | ||
71 | p2 = new QPushButton ( tr( "Edit" ), this ); | 71 | p2 = new QPushButton ( tr( "Edit" ), this ); |
72 | lay-> addWidget ( p2, 2, 1 ); | 72 | lay-> addWidget ( p2, 2, 1 ); |
73 | connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); | 73 | connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); |
74 | 74 | ||
75 | p3 = new QPushButton ( tr( "Delete" ), this ); | 75 | p3 = new QPushButton ( tr( "Delete" ), this ); |
76 | lay-> addWidget ( p3, 3, 1 ); | 76 | lay-> addWidget ( p3, 3, 1 ); |
77 | connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); | 77 | connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); |
78 | 78 | ||
79 | lay-> setRowStretch ( 4, 10 ); | 79 | lay-> setRowStretch ( 4, 10 ); |
80 | 80 | ||
81 | m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); | 81 | m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); |
82 | lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); | 82 | lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); |
83 | 83 | ||
84 | m_busyblink = new QCheckBox ( tr( "Enable blinking busy indicator" ), this ); | 84 | m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); |
85 | lay-> addMultiCellWidget ( m_busyblink, 6, 6, 0, 1 ); | 85 | lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); |
86 | 86 | ||
87 | p1-> setEnabled ( false ); | 87 | p1-> setEnabled ( false ); |
88 | p3-> setEnabled ( false ); | 88 | p3-> setEnabled ( false ); |
89 | 89 | ||
90 | init ( ); | 90 | init ( ); |
91 | 91 | ||
92 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); | 92 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); |
93 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 93 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
94 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); | 94 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); |
95 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 95 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
96 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); | 96 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); |
97 | QWhatsThis::add ( m_busyblink, tr( "Activate this, if you want a blinking busy indicator for starting applications in the Launcher." )); | 97 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); |
98 | } | 98 | } |
99 | 99 | ||
100 | void TabsSettings::init ( ) | 100 | void TabsSettings::init ( ) |
101 | { | 101 | { |
102 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); | 102 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); |
103 | QStringList types = rootFolder. types ( ); | 103 | QStringList types = rootFolder. types ( ); |
104 | 104 | ||
105 | m_list-> insertItem ( tr( "All Tabs" )); | 105 | m_list-> insertItem ( tr( "All Tabs" )); |
106 | m_ids << GLOBALID; | 106 | m_ids << GLOBALID; |
107 | 107 | ||
108 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 108 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
109 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); | 109 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); |
110 | m_ids << *it; | 110 | m_ids << *it; |
111 | } | 111 | } |
112 | QImage img ( Resource::loadImage ( "DocsIcon" )); | 112 | QImage img ( Resource::loadImage ( "DocsIcon" )); |
113 | QPixmap pix; | 113 | QPixmap pix; |
114 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); | 114 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); |
115 | m_list-> insertItem ( pix, tr( "Documents" )); | 115 | m_list-> insertItem ( pix, tr( "Documents" )); |
116 | m_ids += "Documents"; // No tr | 116 | m_ids += "Documents"; // No tr |
117 | 117 | ||
118 | Config cfg ( "Launcher" ); | 118 | Config cfg ( "Launcher" ); |
119 | 119 | ||
120 | readTabSettings ( cfg ); | 120 | readTabSettings ( cfg ); |
121 | 121 | ||
122 | cfg. setGroup ( "GUI" ); | 122 | cfg. setGroup ( "GUI" ); |
123 | m_busyblink-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "blink" ); | 123 | m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); |
124 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); | 124 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); |
125 | } | 125 | } |
126 | 126 | ||
127 | 127 | ||
128 | void TabsSettings::readTabSettings ( Config &cfg ) | 128 | void TabsSettings::readTabSettings ( Config &cfg ) |
129 | { | 129 | { |
130 | QString grp ( "Tab %1" ); // No tr | 130 | QString grp ( "Tab %1" ); // No tr |
131 | m_tabs. clear ( ); | 131 | m_tabs. clear ( ); |
132 | 132 | ||
133 | TabConfig global_def; | 133 | TabConfig global_def; |
134 | global_def. m_view = TabConfig::Icon; | 134 | global_def. m_view = TabConfig::Icon; |
135 | global_def. m_bg_type = TabConfig::Ruled; | 135 | global_def. m_bg_type = TabConfig::Ruled; |
136 | global_def. m_bg_image = "launcher/opie-background"; | 136 | global_def. m_bg_image = "launcher/opie-background"; |
137 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); | 137 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); |
138 | global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); | 138 | global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); |
139 | global_def. m_font_use = false; | 139 | global_def. m_font_use = false; |
140 | global_def. m_font_family = font ( ). family ( ); | 140 | global_def. m_font_family = font ( ). family ( ); |
141 | global_def. m_font_size = font ( ). pointSize ( ); | 141 | global_def. m_font_size = font ( ). pointSize ( ); |
142 | global_def. m_font_weight = 50; | 142 | global_def. m_font_weight = 50; |
143 | global_def. m_font_italic = false; | 143 | global_def. m_font_italic = false; |
144 | global_def. m_changed = false; | 144 | global_def. m_changed = false; |
145 | 145 | ||
146 | 146 | ||
147 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 147 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
@@ -243,49 +243,49 @@ void TabsSettings::accept ( ) | |||
243 | break; | 243 | break; |
244 | case TabConfig::SolidColor: | 244 | case TabConfig::SolidColor: |
245 | cfg.writeEntry( "BackgroundType", "SolidColor" ); | 245 | cfg.writeEntry( "BackgroundType", "SolidColor" ); |
246 | be << *it << tc. m_bg_type << tc. m_bg_color; | 246 | be << *it << tc. m_bg_type << tc. m_bg_color; |
247 | break; | 247 | break; |
248 | case TabConfig::Image: | 248 | case TabConfig::Image: |
249 | cfg.writeEntry( "BackgroundType", "Image" ); | 249 | cfg.writeEntry( "BackgroundType", "Image" ); |
250 | be << *it << tc. m_bg_type << tc. m_bg_image; | 250 | be << *it << tc. m_bg_type << tc. m_bg_image; |
251 | break; | 251 | break; |
252 | } | 252 | } |
253 | 253 | ||
254 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); | 254 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); |
255 | te << *it << tc. m_text_color; | 255 | te << *it << tc. m_text_color; |
256 | 256 | ||
257 | QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); | 257 | QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); |
258 | fe << *it; | 258 | fe << *it; |
259 | fe << ( tc. m_font_use ? tc. m_font_family : QString::null ); | 259 | fe << ( tc. m_font_use ? tc. m_font_family : QString::null ); |
260 | fe << tc. m_font_size; | 260 | fe << tc. m_font_size; |
261 | fe << tc. m_font_weight; | 261 | fe << tc. m_font_weight; |
262 | fe << ( tc. m_font_italic ? 1 : 0 ); | 262 | fe << ( tc. m_font_italic ? 1 : 0 ); |
263 | 263 | ||
264 | tc. m_changed = false; | 264 | tc. m_changed = false; |
265 | } | 265 | } |
266 | cfg. setGroup ( "GUI" ); | 266 | cfg. setGroup ( "GUI" ); |
267 | QString busytype = QString ( m_busyblink-> isChecked ( ) ? "blink" : "" ); | 267 | QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" ); |
268 | cfg. writeEntry ( "BusyType", busytype ); | 268 | cfg. writeEntry ( "BusyType", busytype ); |
269 | 269 | ||
270 | cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) ); | 270 | cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) ); |
271 | 271 | ||
272 | { | 272 | { |
273 | QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); | 273 | QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); |
274 | e << busytype; | 274 | e << busytype; |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | void TabsSettings::newClicked ( ) | 278 | void TabsSettings::newClicked ( ) |
279 | { | 279 | { |
280 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); | 280 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); |
281 | } | 281 | } |
282 | 282 | ||
283 | void TabsSettings::deleteClicked ( ) | 283 | void TabsSettings::deleteClicked ( ) |
284 | { | 284 | { |
285 | int ind = m_list-> currentItem ( ); | 285 | int ind = m_list-> currentItem ( ); |
286 | 286 | ||
287 | if ( ind < 0 ) | 287 | if ( ind < 0 ) |
288 | return; | 288 | return; |
289 | 289 | ||
290 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); | 290 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); |
291 | } | 291 | } |
diff --git a/core/settings/launcher/tabssettings.h b/core/settings/launcher/tabssettings.h index 439def6..600c65c 100644 --- a/core/settings/launcher/tabssettings.h +++ b/core/settings/launcher/tabssettings.h | |||
@@ -38,31 +38,31 @@ class Config; | |||
38 | 38 | ||
39 | 39 | ||
40 | class TabsSettings : public QWidget { | 40 | class TabsSettings : public QWidget { |
41 | Q_OBJECT | 41 | Q_OBJECT |
42 | 42 | ||
43 | public: | 43 | public: |
44 | TabsSettings ( QWidget *parent = 0, const char *name = 0 ); | 44 | TabsSettings ( QWidget *parent = 0, const char *name = 0 ); |
45 | 45 | ||
46 | void accept ( ); | 46 | void accept ( ); |
47 | 47 | ||
48 | protected slots: | 48 | protected slots: |
49 | void newClicked ( ); | 49 | void newClicked ( ); |
50 | void deleteClicked ( ); | 50 | void deleteClicked ( ); |
51 | void editClicked ( ); | 51 | void editClicked ( ); |
52 | 52 | ||
53 | protected: | 53 | protected: |
54 | void init ( ); | 54 | void init ( ); |
55 | void readTabSettings ( Config & ); | 55 | void readTabSettings ( Config & ); |
56 | 56 | ||
57 | private: | 57 | private: |
58 | QListBox *m_list; | 58 | QListBox *m_list; |
59 | //QString currentTab; | 59 | //QString currentTab; |
60 | QStringList m_ids; | 60 | QStringList m_ids; |
61 | QMap <QString, TabConfig> m_tabs; | 61 | QMap <QString, TabConfig> m_tabs; |
62 | QCheckBox *m_busyblink, *m_bigbusy; | 62 | QCheckBox *m_busyani, *m_bigbusy; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | #endif | 68 | #endif |
diff --git a/core/settings/light-and-power/light-and-power.pro b/core/settings/light-and-power/light-and-power.pro index 9304fa8..4972701 100644 --- a/core/settings/light-and-power/light-and-power.pro +++ b/core/settings/light-and-power/light-and-power.pro | |||
@@ -1,33 +1,32 @@ | |||
1 | TEMPLATE= app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on debug | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = light.h sensor.h calibration.h | 2 | HEADERS = light.h sensor.h calibration.h |
5 | SOURCES = light.cpp main.cpp sensor.cpp calibration.cpp | 3 | SOURCES = light.cpp main.cpp sensor.cpp calibration.cpp |
6 | INTERFACES= lightsettingsbase.ui sensorbase.ui | 4 | INTERFACES= lightsettingsbase.ui sensorbase.ui |
7 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH+= ../$(OPIEDIR)/include | 6 | DEPENDPATH+= ../$(OPIEDIR)/include |
9 | LIBS += -lqpe -lopie | 7 | LIBS += -lqpe -lopie |
8 | |||
10 | TARGET = light-and-power | 9 | TARGET = light-and-power |
11 | 10 | ||
12 | TRANSLATIONS = ../../../i18n/de/light-and-power.ts \ | 11 | TRANSLATIONS = ../../../i18n/de/light-and-power.ts \ |
13 | ../../../i18n/nl/light-and-power.ts \ | 12 | ../../../i18n/nl/light-and-power.ts \ |
14 | ../../../i18n/xx/light-and-power.ts \ | 13 | ../../../i18n/xx/light-and-power.ts \ |
15 | ../../../i18n/en/light-and-power.ts \ | 14 | ../../../i18n/en/light-and-power.ts \ |
16 | ../../../i18n/es/light-and-power.ts \ | 15 | ../../../i18n/es/light-and-power.ts \ |
17 | ../../../i18n/fr/light-and-power.ts \ | 16 | ../../../i18n/fr/light-and-power.ts \ |
18 | ../../../i18n/hu/light-and-power.ts \ | 17 | ../../../i18n/hu/light-and-power.ts \ |
19 | ../../../i18n/ja/light-and-power.ts \ | 18 | ../../../i18n/ja/light-and-power.ts \ |
20 | ../../../i18n/ko/light-and-power.ts \ | 19 | ../../../i18n/ko/light-and-power.ts \ |
21 | ../../../i18n/no/light-and-power.ts \ | 20 | ../../../i18n/no/light-and-power.ts \ |
22 | ../../../i18n/pl/light-and-power.ts \ | 21 | ../../../i18n/pl/light-and-power.ts \ |
23 | ../../../i18n/pt/light-and-power.ts \ | 22 | ../../../i18n/pt/light-and-power.ts \ |
24 | ../../../i18n/pt_BR/light-and-power.ts \ | 23 | ../../../i18n/pt_BR/light-and-power.ts \ |
25 | ../../../i18n/sl/light-and-power.ts \ | 24 | ../../../i18n/sl/light-and-power.ts \ |
26 | ../../../i18n/zh_CN/light-and-power.ts \ | 25 | ../../../i18n/zh_CN/light-and-power.ts \ |
27 | ../../../i18n/zh_TW/light-and-power.ts \ | 26 | ../../../i18n/zh_TW/light-and-power.ts \ |
28 | ../../../i18n/it/light-and-power.ts \ | 27 | ../../../i18n/it/light-and-power.ts \ |
29 | ../../../i18n/da/light-and-power.ts | 28 | ../../../i18n/da/light-and-power.ts |
30 | 29 | ||
31 | 30 | ||
32 | 31 | ||
33 | include ( $(OPIEDIR)/include.pro ) | 32 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/settings/light-and-power/light.h b/core/settings/light-and-power/light.h index c48e5f6..83d5520 100644 --- a/core/settings/light-and-power/light.h +++ b/core/settings/light-and-power/light.h | |||
@@ -21,48 +21,49 @@ | |||
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | #ifndef __LIGHT_H__ | 28 | #ifndef __LIGHT_H__ |
29 | #define __LIGHT_H__ | 29 | #define __LIGHT_H__ |
30 | 30 | ||
31 | 31 | ||
32 | #include <qstringlist.h> | 32 | #include <qstringlist.h> |
33 | #include <qlistbox.h> | 33 | #include <qlistbox.h> |
34 | #include "lightsettingsbase.h" | 34 | #include "lightsettingsbase.h" |
35 | 35 | ||
36 | class QTimer; | 36 | class QTimer; |
37 | 37 | ||
38 | class LightSettings : public LightSettingsBase | 38 | class LightSettings : public LightSettingsBase |
39 | { | 39 | { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | 41 | ||
42 | public: | 42 | public: |
43 | LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 43 | LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
44 | ~LightSettings(); | 44 | ~LightSettings(); |
45 | static QString appName() { return QString::fromLatin1("light-and-power"); } | ||
45 | 46 | ||
46 | protected: | 47 | protected: |
47 | virtual void accept(); | 48 | virtual void accept(); |
48 | virtual void done ( int r ); | 49 | virtual void done ( int r ); |
49 | 50 | ||
50 | protected slots: | 51 | protected slots: |
51 | virtual void calibrateSensor ( ); | 52 | virtual void calibrateSensor ( ); |
52 | virtual void calibrateSensorAC ( ); | 53 | virtual void calibrateSensorAC ( ); |
53 | void setBacklight ( int ); | 54 | void setBacklight ( int ); |
54 | void setContrast ( int ); | 55 | void setContrast ( int ); |
55 | void setFrequency ( int ); | 56 | void setFrequency ( int ); |
56 | void resetBacklight ( ); | 57 | void resetBacklight ( ); |
57 | 58 | ||
58 | private: | 59 | private: |
59 | int m_bres; | 60 | int m_bres; |
60 | int m_cres; | 61 | int m_cres; |
61 | int m_oldcontrast; | 62 | int m_oldcontrast; |
62 | int m_oldfreq; | 63 | int m_oldfreq; |
63 | QTimer *m_resettimer; | 64 | QTimer *m_resettimer; |
64 | QStringList m_sensordata; | 65 | QStringList m_sensordata; |
65 | QStringList m_sensordata_ac; | 66 | QStringList m_sensordata_ac; |
66 | }; | 67 | }; |
67 | 68 | ||
68 | 69 | ||
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index 1f5d594..e4d5f0e 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui | |||
@@ -1242,68 +1242,68 @@ | |||
1242 | <property stdset="1"> | 1242 | <property stdset="1"> |
1243 | <name>orientation</name> | 1243 | <name>orientation</name> |
1244 | <enum>Vertical</enum> | 1244 | <enum>Vertical</enum> |
1245 | </property> | 1245 | </property> |
1246 | <property stdset="1"> | 1246 | <property stdset="1"> |
1247 | <name>sizeType</name> | 1247 | <name>sizeType</name> |
1248 | <enum>Expanding</enum> | 1248 | <enum>Expanding</enum> |
1249 | </property> | 1249 | </property> |
1250 | <property> | 1250 | <property> |
1251 | <name>sizeHint</name> | 1251 | <name>sizeHint</name> |
1252 | <size> | 1252 | <size> |
1253 | <width>20</width> | 1253 | <width>20</width> |
1254 | <height>20</height> | 1254 | <height>20</height> |
1255 | </size> | 1255 | </size> |
1256 | </property> | 1256 | </property> |
1257 | </spacer> | 1257 | </spacer> |
1258 | </vbox> | 1258 | </vbox> |
1259 | </widget> | 1259 | </widget> |
1260 | </widget> | 1260 | </widget> |
1261 | </vbox> | 1261 | </vbox> |
1262 | </widget> | 1262 | </widget> |
1263 | <images> | 1263 | <images> |
1264 | <image> | 1264 | <image> |
1265 | <name>image0</name> | 1265 | <name>image0</name> |
1266 | <data format="XPM.GZ" length="680">789c5dd04d6ac3301005e0bd4f21ec5d280931b1c0941ca1a5cb42e962a4194956e2d8f9e9a294debd9e9168ec3cbcd0f72ca1b1372bf5fef6a2569be27a835b67950d70512bfceafbef8fcffd4f516eb59a9e7aabb6e55351ae9555afc389787d9ed6556bdbb6b5cc2b1376d0c08e79115a0090b74326258e4cb333b591cd27a66d6c6d1b669fa9134988162c328f99945831b1c11a65f32153271a2121a0cc1c3329b16392a69a3413327562101201c9669f4989c874dad54e36bb4c9d6885ce8173f2df24158049abff0eec14a479371de1f859573944873e00dd3b8353ba18e3e1de1dbcf7d04d31b3b39033eb8e1052aad9bdc64be262bec0b784e5cc81c78387efe0ae5b767decba785a76c3380cc379d9ad2fe3787df82fb394bfcfc51f5517a686</data> | 1266 | <data format="XPM.GZ" length="1025">789c5dd2cd4ec2401846e13d57d1c08e18a58a20312e44f913419626c6c5cc500a42f92b60c178eff6bc2642fd0e8b79be0d43e945d17b1df4bce2452ede98cdc4796e6cd65e71b88da2fddbfbdd572eef57bcf4532e7b7efe2c973ff79cd75fcc03cefdf45ca859820368aa045f440d7c1287047b6240f0591c11ec425b22d881ce27d8122b0417a22138122dc17b51030f70582258107d821fe225c18d784d702b56092ec51b824eac11dc8b96e0a3e808c6a206b6c580e0270c4a0413d127b8162f09866299a011af095ab142b02e56093e8837049b628d6043d49f04e7a22518898ee04ed46f8013510303382a115c893ec1997845702a96098ec52ac1a168492fa4a660acfb3dfded2c0f37189deec2b16672b2fb98ce66d35934378be36eb94a671dc7f1e6b8dbee263bf39924c9feb83b84260cd3d73b5c1e77f7f587df399c7caf8b348f99fb357836cdec9d1bd374ead99d2e9d6477ad7692b43bd9dd53f7b9d7eb6777e72fddeee0df733999fcf76dee0748aaf77c</data> |
1267 | </image> | 1267 | </image> |
1268 | <image> | 1268 | <image> |
1269 | <name>image1</name> | 1269 | <name>image1</name> |
1270 | <data format="XPM.GZ" length="1220">789c5dd35f53e2301000f0773e4507de981ba4a5443a37f7a028fe41101514bcb987344d0515a8b4a0e0dc77bfee6e36d0dbe121bf4d48361b38aa3ae341cfa91e95d24c6633e5a8a95c39d5683d9f6f7ffff9f55d2abbc2c93fcd63c72dff28956b8e72facb8586f1733eae042a080205f480d2974de903eb4825a5c4d927434d9c30435c3c26861ed105863ef31118692584043e18cae306700ad43af27c9cbd00c622120d2cf8c350d65bc02b66230056984d0f786ea83d9c7d67fab89562d2b92ba2f6e8bb4343d10a81236680579086927a1532a957d7c898b7fa32146e1db865d28d7acc26def7de50b6b0aa3b4b2ce3cc507bb8d58c498b0796b8386252cd1b62ec51199f96d8c95326f5aacfa49d6f99b455db50d0e235935ea1c3a43e279678c14ba6c0e62c99f40a5d4bbcc21b931afbc20c23e0c250d2e21b26d5bcb3c4d913265d21b5c417cc9874d09c49bfd857c358e1b931530ba0b6c4ff510da3224345239b8b74bee6657a989bbd62bc1de4dee7108b65f2b1cfadd22ccdd69bcde7d73eb7dd9dec92d376bb7db6cf9d77924e02b1dde72e2e4d5c1d9c7bddbdc9a3db2bd4d74ff3e8176bbe856206c5dc1d947c5fcc3d0c47a3e16331f7349e4c26cfc55cadeebade7f7d3988f2df9fa57f7da120b4</data> | 1270 | <data format="XPM.GZ" length="1885">789c75d4576fdb301000e077ff0ac17c0b8a8bad49a2e843f61ece4e8a3e481cde198eb3d1ff5eeaeecca675ecb3047cd68922ef282f2f4557c707d1d272e3715a4efb3ad2bd72122d99a7f1f8ede7af1f1f8d663b8ffcb75051dcfcd66876a6918e0eef6e6d0d31f010aaf2a1d1e3da6551077a88c60fdaa14d694b87eea36d692b1c5cf4d88edd45bbaa5525e8516d2f1f685bdb289de7065da28dae8aac36e0f8d69a38add067b55d6cb224470bb6cc52f4153a316582f9c2906d2a255ed7e8d4b882d65791fd7585d79fd199512dac071cb0758cf383db99539a3f8d97d95ca1e1059ddb386ba3713daeb04a61bda0629725adef1a2d6d92517d045b4a346ca295cd12ca3f65e7ec36bbc8b03f60d85a513d24dab74752fd36d0952ddad81f18b0353faf605b89fb037a649756b4fe0cad5dace8f9fb6863754c4ec92e96e4989d48ead7989df2facfd1d66539d5ef929de734bf55b473719bee5f0bc6fec17a30f577979d70bff6d8694ceb599939a1fc437696d2f8c7c1347e2798f28f8269bf3c05d37ed909a67e9fb073beff62e69cfa336517bcdf6f8269be8f6c59d07a5a334baad756308dbf3db3a2fa256c45ef37bcb34b45e3bd06d37cdf662e69fc8799e97d86fb609aff2498ea77174cf5cbd9155d17c0d69aeaa78269ff8e8269bf0e83a91e8e6d2c3dafcbb66c1b2ce9cfee6f8080122ad09f7ffb37070c58703ebad083fe57393080218cfc41e7f17c0edcc21ddcc3034cfcf911a6f004cf73392ff00a6ff0ee8f1558853558878db99c4dd8826d7fecc02eec61eccfe51cc0211cc13174e004a303a7733967700e179fe212aebe58d735dc408be306da0bea1343c2912eac6106b95ffbc49f8b85391294afdf4880108b7244292aa17d186117e638d1153dd1f7315894e3b38662e463fcf9b7ff73be8ae6efef8d3f188ce126</data> |
1271 | </image> | 1271 | </image> |
1272 | </images> | 1272 | </images> |
1273 | <connections> | 1273 | <connections> |
1274 | <connection> | 1274 | <connection> |
1275 | <sender>CalibrateLightSensor</sender> | 1275 | <sender>CalibrateLightSensor</sender> |
1276 | <signal>clicked()</signal> | 1276 | <signal>clicked()</signal> |
1277 | <receiver>LightSettingsBase</receiver> | 1277 | <receiver>LightSettingsBase</receiver> |
1278 | <slot>calibrateSensor()</slot> | 1278 | <slot>calibrateSensor()</slot> |
1279 | </connection> | 1279 | </connection> |
1280 | <connection> | 1280 | <connection> |
1281 | <sender>CalibrateLightSensor_ac</sender> | 1281 | <sender>CalibrateLightSensor_ac</sender> |
1282 | <signal>clicked()</signal> | 1282 | <signal>clicked()</signal> |
1283 | <receiver>LightSettingsBase</receiver> | 1283 | <receiver>LightSettingsBase</receiver> |
1284 | <slot>calibrateSensorAC()</slot> | 1284 | <slot>calibrateSensorAC()</slot> |
1285 | </connection> | 1285 | </connection> |
1286 | <slot access="public">calibrateSensor()</slot> | 1286 | <slot access="public">calibrateSensor()</slot> |
1287 | <slot access="public">calibrateSensorAC()</slot> | 1287 | <slot access="public">calibrateSensorAC()</slot> |
1288 | </connections> | 1288 | </connections> |
1289 | <tabstops> | 1289 | <tabstops> |
1290 | <tabstop>brightness</tabstop> | ||
1290 | <tabstop>interval_dim</tabstop> | 1291 | <tabstop>interval_dim</tabstop> |
1291 | <tabstop>interval_lightoff</tabstop> | 1292 | <tabstop>interval_lightoff</tabstop> |
1292 | <tabstop>interval_suspend</tabstop> | 1293 | <tabstop>interval_suspend</tabstop> |
1293 | <tabstop>LcdOffOnly</tabstop> | 1294 | <tabstop>LcdOffOnly</tabstop> |
1294 | <tabstop>brightness</tabstop> | ||
1295 | <tabstop>auto_brightness</tabstop> | 1295 | <tabstop>auto_brightness</tabstop> |
1296 | <tabstop>CalibrateLightSensor</tabstop> | 1296 | <tabstop>CalibrateLightSensor</tabstop> |
1297 | <tabstop>brightness</tabstop> | ||
1297 | <tabstop>tabs</tabstop> | 1298 | <tabstop>tabs</tabstop> |
1298 | <tabstop>interval_lightoff_ac</tabstop> | 1299 | <tabstop>interval_lightoff</tabstop> |
1299 | <tabstop>interval_suspend_ac</tabstop> | 1300 | <tabstop>interval_suspend</tabstop> |
1300 | <tabstop>interval_dim_ac</tabstop> | 1301 | <tabstop>interval_dim</tabstop> |
1301 | <tabstop>LcdOffOnly_ac</tabstop> | 1302 | <tabstop>LcdOffOnly_ac</tabstop> |
1302 | <tabstop>brightness_ac</tabstop> | 1303 | <tabstop>auto_brightness</tabstop> |
1303 | <tabstop>auto_brightness_ac</tabstop> | ||
1304 | <tabstop>CalibrateLightSensor_ac</tabstop> | 1304 | <tabstop>CalibrateLightSensor_ac</tabstop> |
1305 | <tabstop>lowSpinBox</tabstop> | 1305 | <tabstop>lowSpinBox</tabstop> |
1306 | <tabstop>warnintervalBox</tabstop> | 1306 | <tabstop>warnintervalBox</tabstop> |
1307 | <tabstop>criticalSpinBox</tabstop> | 1307 | <tabstop>criticalSpinBox</tabstop> |
1308 | </tabstops> | 1308 | </tabstops> |
1309 | </UI> | 1309 | </UI> |
diff --git a/core/settings/light-and-power/main.cpp b/core/settings/light-and-power/main.cpp index ecacf69..68d433b 100644 --- a/core/settings/light-and-power/main.cpp +++ b/core/settings/light-and-power/main.cpp | |||
@@ -2,37 +2,28 @@ | |||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "light.h" | 21 | #include "light.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/global.h> | 25 | #include <qpe/global.h> |
26 | #include <opie/oapplicationfactory.h> | ||
26 | 27 | ||
27 | 28 | ||
28 | int main(int argc, char** argv) | 29 | OPIE_EXPORT_APP( OApplicationFactory<LightSettings> ) |
29 | { | ||
30 | QPEApplication a(argc,argv); | ||
31 | |||
32 | LightSettings dlg; | ||
33 | |||
34 | a.showMainWidget(&dlg); | ||
35 | |||
36 | return a.exec(); | ||
37 | } | ||
38 | |||
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index c15bb31..3141fb8 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp | |||
@@ -3,36 +3,30 @@ | |||
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | 24 | ||
25 | #include "security.h" | 25 | #include "security.h" |
26 | 26 | ||
27 | #include <opie/oapplicationfactory.h> | ||
27 | 28 | ||
28 | int main(int argc, char** argv) | 29 | OPIE_EXPORT_APP( OApplicationFactory<Security> ) |
29 | { | ||
30 | QPEApplication a(argc,argv); | ||
31 | 30 | ||
32 | Security dlg; | ||
33 | 31 | ||
34 | a.showMainWidget(&dlg); | ||
35 | |||
36 | return a.exec(); | ||
37 | } | ||
38 | 32 | ||
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp index 42a39c2..81363d2 100644 --- a/core/settings/security/security.cpp +++ b/core/settings/security/security.cpp | |||
@@ -99,49 +99,48 @@ void Security::updateGUI() | |||
99 | bool empty = passcode.isEmpty(); | 99 | bool empty = passcode.isEmpty(); |
100 | 100 | ||
101 | changepasscode->setText( empty ? tr("Set passcode" ) | 101 | changepasscode->setText( empty ? tr("Set passcode" ) |
102 | : tr("Change passcode" ) ); | 102 | : tr("Change passcode" ) ); |
103 | passcode_poweron->setEnabled( !empty ); | 103 | passcode_poweron->setEnabled( !empty ); |
104 | clearpasscode->setEnabled( !empty ); | 104 | clearpasscode->setEnabled( !empty ); |
105 | 105 | ||
106 | autologinToggle->setChecked(autoLogin); | 106 | autologinToggle->setChecked(autoLogin); |
107 | userlist->setEnabled(autoLogin); | 107 | userlist->setEnabled(autoLogin); |
108 | 108 | ||
109 | } | 109 | } |
110 | 110 | ||
111 | 111 | ||
112 | void Security::show() | 112 | void Security::show() |
113 | { | 113 | { |
114 | //valid=FALSE; | 114 | //valid=FALSE; |
115 | setEnabled(FALSE); | 115 | setEnabled(FALSE); |
116 | SecurityBase::show(); | 116 | SecurityBase::show(); |
117 | if ( passcode.isEmpty() ) { | 117 | if ( passcode.isEmpty() ) { |
118 | // could insist... | 118 | // could insist... |
119 | //changePassCode(); | 119 | //changePassCode(); |
120 | //if ( passcode.isEmpty() ) | 120 | //if ( passcode.isEmpty() ) |
121 | //reject(); | 121 | //reject(); |
122 | } else { | 122 | } else { |
123 | |||
124 | if (!valid) // security passcode was not asked yet, so ask now | 123 | if (!valid) // security passcode was not asked yet, so ask now |
125 | { | 124 | { |
126 | QString pc = enterPassCode(tr("Enter passcode")); | 125 | QString pc = enterPassCode(tr("Enter passcode")); |
127 | if ( pc != passcode ) { | 126 | if ( pc != passcode ) { |
128 | QMessageBox::critical(this, tr("Passcode incorrect"), | 127 | QMessageBox::critical(this, tr("Passcode incorrect"), |
129 | tr("The passcode entered is incorrect.\nAccess denied")); | 128 | tr("The passcode entered is incorrect.\nAccess denied")); |
130 | reject(); | 129 | reject(); |
131 | return; | 130 | return; |
132 | } | 131 | } |
133 | } | 132 | } |
134 | } | 133 | } |
135 | setEnabled(TRUE); | 134 | setEnabled(TRUE); |
136 | valid=TRUE; | 135 | valid=TRUE; |
137 | } | 136 | } |
138 | 137 | ||
139 | void Security::accept() | 138 | void Security::accept() |
140 | { | 139 | { |
141 | applySecurity(); | 140 | applySecurity(); |
142 | QDialog::accept(); | 141 | QDialog::accept(); |
143 | QCopEnvelope env("QPE/System", "securityChanged()" ); | 142 | QCopEnvelope env("QPE/System", "securityChanged()" ); |
144 | } | 143 | } |
145 | 144 | ||
146 | void Security::done(int r) | 145 | void Security::done(int r) |
147 | { | 146 | { |
@@ -218,82 +217,78 @@ void Security::loadUsers ( void ) | |||
218 | 217 | ||
219 | } | 218 | } |
220 | 219 | ||
221 | void Security::toggleAutoLogin(bool val) | 220 | void Security::toggleAutoLogin(bool val) |
222 | { | 221 | { |
223 | autoLogin=val; | 222 | autoLogin=val; |
224 | userlist->setEnabled(val); | 223 | userlist->setEnabled(val); |
225 | if (!autoLogin) | 224 | if (!autoLogin) |
226 | autoLoginName=userlist->currentText(); | 225 | autoLoginName=userlist->currentText(); |
227 | } | 226 | } |
228 | 227 | ||
229 | 228 | ||
230 | 229 | ||
231 | 230 | ||
232 | void Security::setSyncNet(const QString& sn) | 231 | void Security::setSyncNet(const QString& sn) |
233 | { | 232 | { |
234 | int auth_peer,auth_peer_bits; | 233 | int auth_peer,auth_peer_bits; |
235 | parseNet(sn,auth_peer,auth_peer_bits); | 234 | parseNet(sn,auth_peer,auth_peer_bits); |
236 | selectNet(auth_peer,auth_peer_bits); | 235 | selectNet(auth_peer,auth_peer_bits); |
237 | } | 236 | } |
238 | 237 | ||
239 | void Security::applySecurity() | 238 | void Security::applySecurity() |
240 | { | 239 | { |
241 | if ( valid ) { | 240 | if ( valid ) { |
242 | |||
243 | Config cfg("Security"); | 241 | Config cfg("Security"); |
244 | cfg.setGroup("Passcode"); | 242 | cfg.setGroup("Passcode"); |
245 | cfg.writeEntry("passcode",passcode); | 243 | cfg.writeEntry("passcode",passcode); |
246 | cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); | 244 | cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); |
247 | cfg.setGroup("Sync"); | 245 | cfg.setGroup("Sync"); |
248 | int auth_peer=0; | 246 | int auth_peer=0; |
249 | int auth_peer_bits; | 247 | int auth_peer_bits; |
250 | QString sn = syncnet->currentText(); | 248 | QString sn = syncnet->currentText(); |
251 | parseNet(sn,auth_peer,auth_peer_bits); | 249 | parseNet(sn,auth_peer,auth_peer_bits); |
252 | cfg.writeEntry("auth_peer",auth_peer); | 250 | cfg.writeEntry("auth_peer",auth_peer); |
253 | cfg.writeEntry("auth_peer_bits",auth_peer_bits); | 251 | cfg.writeEntry("auth_peer_bits",auth_peer_bits); |
254 | /* | 252 | /* |
255 | cfg.setGroup("Remote"); | 253 | cfg.setGroup("Remote"); |
256 | if ( telnetAvailable() ) | 254 | if ( telnetAvailable() ) |
257 | cfg.writeEntry("allow_telnet",telnet->isChecked()); | 255 | cfg.writeEntry("allow_telnet",telnet->isChecked()); |
258 | if ( sshAvailable() ) | 256 | if ( sshAvailable() ) |
259 | cfg.writeEntry("allow_ssh",ssh->isChecked()); | 257 | cfg.writeEntry("allow_ssh",ssh->isChecked()); |
260 | // ### write ssh/telnet sys config files | 258 | // ### write ssh/telnet sys config files |
261 | */ | 259 | */ |
262 | 260 | ||
263 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; | 261 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; |
264 | Config loginCfg(configFile,Config::File); | 262 | Config loginCfg(configFile,Config::File); |
265 | loginCfg.setGroup("General"); | 263 | loginCfg.setGroup("General"); |
266 | 264 | ||
267 | if (autoLogin) { | 265 | if (autoLogin) { |
268 | loginCfg.writeEntry("AutoLogin",autoLoginName); | 266 | loginCfg.writeEntry("AutoLogin",autoLoginName); |
269 | } else { | 267 | } else { |
270 | loginCfg.removeEntry("AutoLogin"); | 268 | loginCfg.removeEntry("AutoLogin"); |
271 | } | 269 | } |
272 | 270 | ||
273 | cfg.setGroup("SyncMode"); | ||
274 | cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 ); | ||
275 | |||
276 | } | 271 | } |
277 | } | 272 | } |
278 | 273 | ||
279 | void Security::changeLoginName( int idx ) | 274 | void Security::changeLoginName( int idx ) |
280 | { | 275 | { |
281 | autoLoginName = userlist->text(idx);; | 276 | autoLoginName = userlist->text(idx);; |
282 | updateGUI(); | 277 | updateGUI(); |
283 | } | 278 | } |
284 | 279 | ||
285 | void Security::changePassCode() | 280 | void Security::changePassCode() |
286 | { | 281 | { |
287 | QString new1; | 282 | QString new1; |
288 | QString new2; | 283 | QString new2; |
289 | 284 | ||
290 | do { | 285 | do { |
291 | new1 = enterPassCode(tr("Enter new passcode")); | 286 | new1 = enterPassCode(tr("Enter new passcode")); |
292 | if ( new1.isNull() ) | 287 | if ( new1.isNull() ) |
293 | return; | 288 | return; |
294 | new2 = enterPassCode(tr("Re-enter new passcode")); | 289 | new2 = enterPassCode(tr("Re-enter new passcode")); |
295 | if ( new2.isNull() ) | 290 | if ( new2.isNull() ) |
296 | return; | 291 | return; |
297 | } while (new1 != new2); | 292 | } while (new1 != new2); |
298 | 293 | ||
299 | passcode = new1; | 294 | passcode = new1; |
diff --git a/core/settings/security/security.h b/core/settings/security/security.h index 2f18f91..52d56de 100644 --- a/core/settings/security/security.h +++ b/core/settings/security/security.h | |||
@@ -8,48 +8,49 @@ | |||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef SECURITY_H | 20 | #ifndef SECURITY_H |
21 | #define SECURITY_H | 21 | #define SECURITY_H |
22 | 22 | ||
23 | #include "securitybase.h" | 23 | #include "securitybase.h" |
24 | 24 | ||
25 | class QPEDialogListener; | 25 | class QPEDialogListener; |
26 | 26 | ||
27 | class Security : public SecurityBase | 27 | class Security : public SecurityBase |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | 30 | ||
31 | public: | 31 | public: |
32 | static QString appName() { return QString::fromLatin1("security"); } | ||
32 | Security( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 33 | Security( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
33 | ~Security(); | 34 | ~Security(); |
34 | 35 | ||
35 | void show(); | 36 | void show(); |
36 | 37 | ||
37 | protected: | 38 | protected: |
38 | void accept(); | 39 | void accept(); |
39 | void applySecurity(); | 40 | void applySecurity(); |
40 | void done(int); | 41 | void done(int); |
41 | 42 | ||
42 | private slots: | 43 | private slots: |
43 | void changePassCode(); | 44 | void changePassCode(); |
44 | void clearPassCode(); | 45 | void clearPassCode(); |
45 | void setSyncNet(const QString&); | 46 | void setSyncNet(const QString&); |
46 | void changeLoginName(int); | 47 | void changeLoginName(int); |
47 | void toggleAutoLogin(bool); | 48 | void toggleAutoLogin(bool); |
48 | 49 | ||
49 | 50 | ||
50 | private: | 51 | private: |
51 | void loadUsers(void); | 52 | void loadUsers(void); |
52 | bool telnetAvailable() const; | 53 | bool telnetAvailable() const; |
53 | bool sshAvailable() const; | 54 | bool sshAvailable() const; |
54 | void updateGUI(); | 55 | void updateGUI(); |
55 | 56 | ||
diff --git a/core/settings/security/security.pro b/core/settings/security/security.pro index c359537..67995d4 100644 --- a/core/settings/security/security.pro +++ b/core/settings/security/security.pro | |||
@@ -1,27 +1,25 @@ | |||
1 | TEMPLATE= app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = security.h | 2 | HEADERS = security.h |
5 | SOURCES = security.cpp main.cpp | 3 | SOURCES = security.cpp main.cpp |
6 | INTERFACES= securitybase.ui | 4 | INTERFACES= securitybase.ui |
7 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH+= ../$(OPIEDIR)/include | 6 | DEPENDPATH+= ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 7 | LIBS += -lqpe |
10 | TARGET = security | 8 | TARGET = security |
11 | 9 | ||
12 | TRANSLATIONS = ../../../i18n/de/security.ts \ | 10 | TRANSLATIONS = ../../../i18n/de/security.ts \ |
13 | ../../../i18n/nl/security.ts \ | 11 | ../../../i18n/nl/security.ts \ |
14 | ../../../i18n/xx/security.ts \ | 12 | ../../../i18n/xx/security.ts \ |
15 | ../../../i18n/en/security.ts \ | 13 | ../../../i18n/en/security.ts \ |
16 | ../../../i18n/es/security.ts \ | 14 | ../../../i18n/es/security.ts \ |
17 | ../../../i18n/fr/security.ts \ | 15 | ../../../i18n/fr/security.ts \ |
18 | ../../../i18n/hu/security.ts \ | 16 | ../../../i18n/hu/security.ts \ |
19 | ../../../i18n/ja/security.ts \ | 17 | ../../../i18n/ja/security.ts \ |
20 | ../../../i18n/ko/security.ts \ | 18 | ../../../i18n/ko/security.ts \ |
21 | ../../../i18n/no/security.ts \ | 19 | ../../../i18n/no/security.ts \ |
22 | ../../../i18n/pl/security.ts \ | 20 | ../../../i18n/pl/security.ts \ |
23 | ../../../i18n/pt/security.ts \ | 21 | ../../../i18n/pt/security.ts \ |
24 | ../../../i18n/pt_BR/security.ts \ | 22 | ../../../i18n/pt_BR/security.ts \ |
25 | ../../../i18n/sl/security.ts \ | 23 | ../../../i18n/sl/security.ts \ |
26 | ../../../i18n/zh_CN/security.ts \ | 24 | ../../../i18n/zh_CN/security.ts \ |
27 | ../../../i18n/zh_TW/security.ts \ | 25 | ../../../i18n/zh_TW/security.ts \ |
diff --git a/core/settings/security/securitybase.ui b/core/settings/security/securitybase.ui index 73290e5..9fb63a8 100644 --- a/core/settings/security/securitybase.ui +++ b/core/settings/security/securitybase.ui | |||
@@ -1,38 +1,38 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>SecurityBase</class> | 2 | <class>SecurityBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>SecurityBase</cstring> | 7 | <cstring>SecurityBase</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>339</width> | 14 | <width>329</width> |
15 | <height>483</height> | 15 | <height>483</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Security Settings</string> | 20 | <string>Security Settings</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>0</number> | 31 | <number>0</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>0</number> | 35 | <number>0</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |