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/settings/button | |
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 :(
-rw-r--r-- | core/settings/button/button.pro | 9 | ||||
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 66 | ||||
-rw-r--r-- | core/settings/button/buttonsettings.h | 3 | ||||
-rw-r--r-- | core/settings/button/main.cpp | 16 |
4 files changed, 41 insertions, 53 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,5 +1,4 @@ | |||
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 \ |
@@ -16,5 +15,5 @@ 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 \ |
@@ -36,5 +35,3 @@ TRANSLATIONS = ../../../i18n/de/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 | |||
@@ -16,5 +16,5 @@ | |||
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; |
@@ -51,5 +51,5 @@ struct buttoninfo { | |||
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; |
@@ -57,5 +57,5 @@ struct buttoninfo { | |||
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 | { |
@@ -66,8 +66,8 @@ ButtonSettings::ButtonSettings ( ) | |||
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 ); |
@@ -78,5 +78,5 @@ ButtonSettings::ButtonSettings ( ) | |||
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; |
@@ -96,15 +96,15 @@ ButtonSettings::ButtonSettings ( ) | |||
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 ); |
@@ -116,5 +116,5 @@ ButtonSettings::ButtonSettings ( ) | |||
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 ); |
@@ -126,9 +126,9 @@ ButtonSettings::ButtonSettings ( ) | |||
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 ); |
@@ -136,10 +136,10 @@ ButtonSettings::ButtonSettings ( ) | |||
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 | } |
@@ -154,5 +154,5 @@ void ButtonSettings::updateLabels ( ) | |||
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 ); |
@@ -169,7 +169,7 @@ buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) | |||
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 | ||
@@ -177,6 +177,6 @@ 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; |
@@ -190,8 +190,8 @@ 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 |
@@ -209,15 +209,15 @@ void ButtonSettings::keyTimeout ( ) | |||
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 ( ); |
@@ -228,10 +228,10 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) | |||
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 | } |
@@ -241,5 +241,5 @@ void ButtonSettings::accept ( ) | |||
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 ); |
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 | |||
@@ -43,7 +43,8 @@ class ButtonSettings : public QDialog { | |||
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 ); |
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 | |||
@@ -16,5 +16,5 @@ | |||
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; |
@@ -29,15 +29,5 @@ | |||
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 | |||