author | sandman <sandman> | 2002-12-23 03:24:31 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-23 03:24:31 (UTC) |
commit | e91351d2c22ab041b85f49e243e1f510edf7984e (patch) (unidiff) | |
tree | c068e1a8ad21db9995f2a3c5a2d97bb983fa04a9 | |
parent | 8bd190d162b538e4226e830f442450f5a95f4434 (diff) | |
download | opie-e91351d2c22ab041b85f49e243e1f510edf7984e.zip opie-e91351d2c22ab041b85f49e243e1f510edf7984e.tar.gz opie-e91351d2c22ab041b85f49e243e1f510edf7984e.tar.bz2 |
small bugfixes and speedup
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 8 | ||||
-rw-r--r-- | core/settings/button/buttonsettings.h | 1 | ||||
-rw-r--r-- | core/settings/button/buttonutils.cpp | 22 | ||||
-rw-r--r-- | core/settings/button/remapdlg.cpp | 27 | ||||
-rw-r--r-- | core/settings/button/remapdlg.h | 4 |
5 files changed, 48 insertions, 14 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index c71514c..8b0b0a8 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -47,32 +47,33 @@ struct buttoninfo { | |||
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 ( ) |
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 | 64 | ||
64 | setCaption ( tr( "Button Settings" )); | 65 | setCaption ( tr( "Button Settings" )); |
65 | 66 | ||
66 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); | 67 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); |
67 | 68 | ||
68 | 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 ); |
69 | toplay-> addWidget ( l ); | 70 | toplay-> addWidget ( l ); |
70 | 71 | ||
71 | QGridLayout *lay = new QGridLayout ( toplay ); | 72 | QGridLayout *lay = new QGridLayout ( toplay ); |
72 | lay-> setMargin ( 0 ); | 73 | lay-> setMargin ( 0 ); |
73 | lay-> setColStretch ( 0, 0 ); | 74 | lay-> setColStretch ( 0, 0 ); |
74 | lay-> setColStretch ( 1, 0 ); | 75 | lay-> setColStretch ( 1, 0 ); |
75 | lay-> setColStretch ( 2, 0 ); | 76 | lay-> setColStretch ( 2, 0 ); |
76 | lay-> setColStretch ( 3, 10 ); | 77 | lay-> setColStretch ( 3, 10 ); |
77 | 78 | ||
78 | m_infos. setAutoDelete ( true ); | 79 | m_infos. setAutoDelete ( true ); |
@@ -120,32 +121,33 @@ ButtonSettings::ButtonSettings ( ) | |||
120 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); | 121 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); |
121 | bi-> m_hicon = l; | 122 | bi-> m_hicon = l; |
122 | 123 | ||
123 | l = new QLabel ( this ); | 124 | l = new QLabel ( this ); |
124 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); | 125 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); |
125 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); | 126 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); |
126 | bi-> m_hlabel = l; | 127 | bi-> m_hlabel = l; |
127 | 128 | ||
128 | i += 2; | 129 | i += 2; |
129 | 130 | ||
130 | m_infos. append ( bi ); | 131 | m_infos. append ( bi ); |
131 | } | 132 | } |
132 | 133 | ||
133 | toplay-> addStretch ( 10 ); | 134 | toplay-> addStretch ( 10 ); |
134 | 135 | ||
135 | m_last_button = 0; | 136 | m_last_button = 0; |
137 | m_lock = false; | ||
136 | 138 | ||
137 | m_timer = new QTimer ( this ); | 139 | m_timer = new QTimer ( this ); |
138 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( ))); | 140 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( ))); |
139 | 141 | ||
140 | updateLabels ( ); | 142 | updateLabels ( ); |
141 | 143 | ||
142 | QPEApplication::grabKeyboard ( ); | 144 | QPEApplication::grabKeyboard ( ); |
143 | } | 145 | } |
144 | 146 | ||
145 | ButtonSettings::~ButtonSettings ( ) | 147 | ButtonSettings::~ButtonSettings ( ) |
146 | { | 148 | { |
147 | QPEApplication::ungrabKeyboard ( ); | 149 | QPEApplication::ungrabKeyboard ( ); |
148 | } | 150 | } |
149 | 151 | ||
150 | void ButtonSettings::updateLabels ( ) | 152 | void ButtonSettings::updateLabels ( ) |
151 | { | 153 | { |
@@ -195,51 +197,57 @@ void ButtonSettings::keyReleaseEvent ( QKeyEvent *e ) | |||
195 | else | 197 | else |
196 | QDialog::keyReleaseEvent ( e ); | 198 | QDialog::keyReleaseEvent ( e ); |
197 | } | 199 | } |
198 | 200 | ||
199 | void ButtonSettings::keyTimeout ( ) | 201 | void ButtonSettings::keyTimeout ( ) |
200 | { | 202 | { |
201 | if ( m_last_button ) { | 203 | if ( m_last_button ) { |
202 | edit ( m_last_button, true ); | 204 | edit ( m_last_button, true ); |
203 | m_last_button = false; | 205 | m_last_button = false; |
204 | } | 206 | } |
205 | } | 207 | } |
206 | 208 | ||
207 | void ButtonSettings::edit ( buttoninfo *bi, bool hold ) | 209 | void ButtonSettings::edit ( buttoninfo *bi, bool hold ) |
208 | { | 210 | { |
209 | qDebug ( "remap %s for %s", hold ? "hold" : "press", bi-> m_button-> userText ( ). latin1 ( )); | 211 | qDebug ( "remap %s for %s", hold ? "hold" : "press", bi-> m_button-> userText ( ). latin1 ( )); |
210 | 212 | ||
213 | if ( m_lock ) | ||
214 | return; | ||
215 | m_lock = true; | ||
216 | |||
211 | RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); | 217 | RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); |
212 | 218 | ||
213 | d-> showMaximized ( ); | 219 | d-> showMaximized ( ); |
214 | if ( d-> exec ( ) == QDialog::Accepted ) { | 220 | if ( d-> exec ( ) == QDialog::Accepted ) { |
215 | qDebug ( " -> %s %s", d-> message ( ). channel ( ). data ( ), d-> message ( ). message ( ). data ( )); | 221 | qDebug ( " -> %s %s", d-> message ( ). channel ( ). data ( ), d-> message ( ). message ( ). data ( )); |
216 | 222 | ||
217 | if ( hold ) { | 223 | if ( hold ) { |
218 | bi-> m_hmsg = d-> message ( ); | 224 | bi-> m_hmsg = d-> message ( ); |
219 | bi-> m_hdirty = true; | 225 | bi-> m_hdirty = true; |
220 | } | 226 | } |
221 | else { | 227 | else { |
222 | bi-> m_pmsg = d-> message ( ); | 228 | bi-> m_pmsg = d-> message ( ); |
223 | bi-> m_pdirty = true; | 229 | bi-> m_pdirty = true; |
224 | } | 230 | } |
225 | 231 | ||
226 | updateLabels ( ); | 232 | updateLabels ( ); |
227 | } | 233 | } |
228 | 234 | ||
229 | delete d; | 235 | delete d; |
236 | |||
237 | m_lock = false; | ||
230 | } | 238 | } |
231 | 239 | ||
232 | void ButtonSettings::accept ( ) | 240 | void ButtonSettings::accept ( ) |
233 | { | 241 | { |
234 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 242 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
235 | buttoninfo *bi = *it; | 243 | buttoninfo *bi = *it; |
236 | 244 | ||
237 | if ( bi-> m_pdirty ) | 245 | if ( bi-> m_pdirty ) |
238 | ODevice::inst ( )-> remapPressedAction ( bi-> m_index, bi-> m_pmsg ); | 246 | ODevice::inst ( )-> remapPressedAction ( bi-> m_index, bi-> m_pmsg ); |
239 | if ( bi-> m_hdirty ) | 247 | if ( bi-> m_hdirty ) |
240 | ODevice::inst ( )-> remapHeldAction ( bi-> m_index, bi-> m_hmsg ); | 248 | ODevice::inst ( )-> remapHeldAction ( bi-> m_index, bi-> m_hmsg ); |
241 | } | 249 | } |
242 | QDialog::accept ( ); | 250 | QDialog::accept ( ); |
243 | } | 251 | } |
244 | 252 | ||
245 | void ButtonSettings::done ( int r ) | 253 | void ButtonSettings::done ( int r ) |
diff --git a/core/settings/button/buttonsettings.h b/core/settings/button/buttonsettings.h index f571825..d41a209 100644 --- a/core/settings/button/buttonsettings.h +++ b/core/settings/button/buttonsettings.h | |||
@@ -54,21 +54,22 @@ private slots: | |||
54 | 54 | ||
55 | protected: | 55 | protected: |
56 | virtual void keyPressEvent ( QKeyEvent *e ); | 56 | virtual void keyPressEvent ( QKeyEvent *e ); |
57 | virtual void keyReleaseEvent ( QKeyEvent *e ); | 57 | virtual void keyReleaseEvent ( QKeyEvent *e ); |
58 | 58 | ||
59 | private: | 59 | private: |
60 | buttoninfo *buttonInfoForKeycode ( ushort key ); | 60 | buttoninfo *buttonInfoForKeycode ( ushort key ); |
61 | 61 | ||
62 | void edit ( buttoninfo *bi, bool hold ); | 62 | void edit ( buttoninfo *bi, bool hold ); |
63 | QString qcopToString ( const OQCopMessage &c ); | 63 | QString qcopToString ( const OQCopMessage &c ); |
64 | 64 | ||
65 | private: | 65 | private: |
66 | QTimer *m_timer; | 66 | QTimer *m_timer; |
67 | buttoninfo *m_last_button; | 67 | buttoninfo *m_last_button; |
68 | 68 | ||
69 | QList <buttoninfo> m_infos; | 69 | QList <buttoninfo> m_infos; |
70 | bool m_lock; | ||
70 | }; | 71 | }; |
71 | 72 | ||
72 | #endif | 73 | #endif |
73 | 74 | ||
74 | 75 | ||
diff --git a/core/settings/button/buttonutils.cpp b/core/settings/button/buttonutils.cpp index bb70047..91d2af3 100644 --- a/core/settings/button/buttonutils.cpp +++ b/core/settings/button/buttonutils.cpp | |||
@@ -88,32 +88,40 @@ qCopInfo ButtonUtils::messageToInfo ( const OQCopMessage &c ) | |||
88 | return qCopInfo ( qApp-> translate ( "ButtonSettings", "<nobr>Call <b>%1</b> <i>%2</i></nobr>" ). arg (( ch. left ( 4 ) == "QPE/" ) ? ch. mid ( 4 ) : ch ). arg ( f )); | 88 | return qCopInfo ( qApp-> translate ( "ButtonSettings", "<nobr>Call <b>%1</b> <i>%2</i></nobr>" ). arg (( ch. left ( 4 ) == "QPE/" ) ? ch. mid ( 4 ) : ch ). arg ( f )); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | void ButtonUtils::insertActions ( QListViewItem *here ) | 93 | void ButtonUtils::insertActions ( QListViewItem *here ) |
94 | { | 94 | { |
95 | for ( const predef_qcop *p = predef; p-> m_text; p++ ) { | 95 | for ( const predef_qcop *p = predef; p-> m_text; p++ ) { |
96 | QListViewItem *item = new QListViewItem ( here, qApp-> translate ( "ButtonSettings", p-> m_text ), p-> m_channel, p-> m_function ); | 96 | QListViewItem *item = new QListViewItem ( here, qApp-> translate ( "ButtonSettings", p-> m_text ), p-> m_channel, p-> m_function ); |
97 | item-> setPixmap ( 0, Resource::loadPixmap ( p-> m_pixmap )); | 97 | item-> setPixmap ( 0, Resource::loadPixmap ( p-> m_pixmap )); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | void ButtonUtils::insertAppLnks ( QListViewItem *here ) | 102 | void ButtonUtils::insertAppLnks ( QListViewItem *here ) |
103 | { | 103 | { |
104 | QStringList types = m_apps-> types ( ); | 104 | QStringList types = m_apps-> types ( ); |
105 | QListViewItem *typeitem [types. count ( )]; | ||
105 | 106 | ||
107 | int i = 0; | ||
106 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 108 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
107 | QListViewItem *item = new QListViewItem ( here, m_apps-> typeName ( *it )); | 109 | QListViewItem *item = new QListViewItem ( here, m_apps-> typeName ( *it )); |
108 | item-> setPixmap ( 0, m_apps-> typePixmap ( *it )); | 110 | item-> setPixmap ( 0, m_apps-> typePixmap ( *it )); |
109 | 111 | ||
110 | for ( QListIterator <AppLnk> appit ( m_apps-> children ( )); *appit; ++appit ) { | 112 | typeitem [i++] = item; |
111 | AppLnk *l = *appit; | 113 | } |
112 | 114 | ||
115 | for ( QListIterator <AppLnk> appit ( m_apps-> children ( )); *appit; ++appit ) { | ||
116 | AppLnk *l = *appit; | ||
117 | |||
118 | int i = 0; | ||
119 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | ||
113 | if ( l-> type ( ) == *it ) { | 120 | if ( l-> type ( ) == *it ) { |
114 | QListViewItem *sub = new QListViewItem ( item, l-> name ( ), QString ( "QPE/Application/" ) + l-> exec ( ), "raise()" ); | 121 | QListViewItem *sub = new QListViewItem ( typeitem [i], l-> name ( ), QString ( "QPE/Application/" ) + l-> exec ( ), "raise()" ); |
115 | sub-> setPixmap ( 0, l-> pixmap ( )); | 122 | sub-> setPixmap ( 0, l-> pixmap ( )); |
116 | } | 123 | } |
117 | } | 124 | i++; |
125 | } | ||
118 | } | 126 | } |
119 | } | 127 | } |
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp index 511d0e7..a251bd4 100644 --- a/core/settings/button/remapdlg.cpp +++ b/core/settings/button/remapdlg.cpp | |||
@@ -1,19 +1,20 @@ | |||
1 | #include <qlistview.h> | 1 | #include <qlistview.h> |
2 | #include <qlabel.h> | 2 | #include <qlabel.h> |
3 | #include <qcombobox.h> | 3 | #include <qcombobox.h> |
4 | #include <qtimer.h> | ||
4 | 5 | ||
5 | #include "remapdlg.h" | 6 | #include "remapdlg.h" |
6 | #include "buttonutils.h" | 7 | #include "buttonutils.h" |
7 | 8 | ||
8 | using namespace Opie; | 9 | using namespace Opie; |
9 | 10 | ||
10 | class NoSortItem : public QListViewItem { | 11 | class NoSortItem : public QListViewItem { |
11 | public: | 12 | public: |
12 | NoSortItem ( QListView *lv, uint pos, const QString &str, const QCString &s1 = 0, const QCString &s2 = 0 ) | 13 | NoSortItem ( QListView *lv, uint pos, const QString &str, const QCString &s1 = 0, const QCString &s2 = 0 ) |
13 | : QListViewItem ( lv, str, s1, s2 ) | 14 | : QListViewItem ( lv, str, s1, s2 ) |
14 | { | 15 | { |
15 | m_key = QString ( QChar ( 'a' + pos )); | 16 | m_key = QString ( QChar ( 'a' + pos )); |
16 | m_def = false; | 17 | m_def = false; |
17 | } | 18 | } |
18 | 19 | ||
19 | void setDefault ( bool b ) | 20 | void setDefault ( bool b ) |
@@ -33,62 +34,74 @@ public: | |||
33 | f. setBold ( true ); | 34 | f. setBold ( true ); |
34 | p-> setFont ( f ); | 35 | p-> setFont ( f ); |
35 | } | 36 | } |
36 | QListViewItem::paintCell ( p, cg, column, width, align ); | 37 | QListViewItem::paintCell ( p, cg, column, width, align ); |
37 | } | 38 | } |
38 | 39 | ||
39 | private: | 40 | private: |
40 | QString m_key; | 41 | QString m_key; |
41 | bool m_def; | 42 | bool m_def; |
42 | }; | 43 | }; |
43 | 44 | ||
44 | 45 | ||
45 | RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) | 46 | RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) |
46 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) | 47 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) |
47 | { | 48 | { |
48 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); | 49 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); |
50 | |||
51 | m_current = 0; | ||
52 | |||
53 | static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 }; | ||
54 | w_channel-> insertStrList ((const char **) def_channels ); | ||
49 | 55 | ||
50 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); | 56 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); |
51 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); | 57 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); |
52 | 58 | ||
53 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); | 59 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); |
54 | m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); | 60 | m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); |
55 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); | 61 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); |
56 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); | 62 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); |
57 | 63 | ||
58 | QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); | 64 | QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); |
59 | ButtonUtils::inst ( )-> insertActions ( it ); | 65 | ButtonUtils::inst ( )-> insertActions ( it ); |
60 | it-> setOpen ( true ); | 66 | it-> setOpen ( true ); |
61 | 67 | ||
62 | it = new NoSortItem ( w_list, 4, tr( "Show" )); | 68 | m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); |
63 | ButtonUtils::inst ( )-> insertAppLnks ( it ); | ||
64 | 69 | ||
65 | m_current = m_map_custom; | 70 | m_current = m_map_custom; |
66 | w_list-> setCurrentItem ( m_current ); | 71 | w_list-> setCurrentItem ( m_current ); |
67 | 72 | ||
68 | static const char * const def_channels [] = { | 73 | QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); |
69 | "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 | ||
70 | }; | ||
71 | |||
72 | w_channel-> insertStrList ((const char **) def_channels ); | ||
73 | } | 74 | } |
74 | 75 | ||
75 | RemapDlg::~RemapDlg ( ) | 76 | RemapDlg::~RemapDlg ( ) |
76 | { | 77 | { |
77 | } | 78 | } |
78 | 79 | ||
80 | void RemapDlg::delayedInit ( ) | ||
81 | { | ||
82 | bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); | ||
83 | w_list-> viewport ( )-> setUpdatesEnabled ( false ); | ||
84 | |||
85 | ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); | ||
86 | |||
87 | w_list-> viewport ( )-> setUpdatesEnabled ( b ); | ||
88 | |||
89 | m_map_show-> repaint ( ); | ||
90 | } | ||
91 | |||
79 | void RemapDlg::itemChanged ( QListViewItem *it ) | 92 | void RemapDlg::itemChanged ( QListViewItem *it ) |
80 | { | 93 | { |
81 | bool enabled = false; | 94 | bool enabled = false; |
82 | OQCopMessage m; | 95 | OQCopMessage m; |
83 | 96 | ||
84 | m_current = it; | 97 | m_current = it; |
85 | 98 | ||
86 | if ( it == m_map_none ) | 99 | if ( it == m_map_none ) |
87 | m_msg = m = OQCopMessage ( 0, 0 ); | 100 | m_msg = m = OQCopMessage ( 0, 0 ); |
88 | else if ( it == m_map_preset ) | 101 | else if ( it == m_map_preset ) |
89 | m_msg = m = m_msg_preset; | 102 | m_msg = m = m_msg_preset; |
90 | else if ( it && !it-> childCount ( )) { | 103 | else if ( it && !it-> childCount ( )) { |
91 | enabled = ( it == m_map_custom ); | 104 | enabled = ( it == m_map_custom ); |
92 | m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); | 105 | m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); |
93 | } | 106 | } |
94 | 107 | ||
diff --git a/core/settings/button/remapdlg.h b/core/settings/button/remapdlg.h index 8c9cc02..046a22f 100644 --- a/core/settings/button/remapdlg.h +++ b/core/settings/button/remapdlg.h | |||
@@ -7,29 +7,33 @@ | |||
7 | 7 | ||
8 | class QListViewItem; | 8 | class QListViewItem; |
9 | 9 | ||
10 | 10 | ||
11 | class RemapDlg : public RemapDlgBase { | 11 | class RemapDlg : public RemapDlgBase { |
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | 13 | ||
14 | public: | 14 | public: |
15 | RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget* parent = 0, const char* name = 0 ); | 15 | RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget* parent = 0, const char* name = 0 ); |
16 | ~RemapDlg ( ); | 16 | ~RemapDlg ( ); |
17 | 17 | ||
18 | Opie::OQCopMessage message ( ); | 18 | Opie::OQCopMessage message ( ); |
19 | 19 | ||
20 | public slots: | 20 | public slots: |
21 | virtual void itemChanged ( QListViewItem * ); | 21 | virtual void itemChanged ( QListViewItem * ); |
22 | virtual void textChanged ( const QString & ); | 22 | virtual void textChanged ( const QString & ); |
23 | |||
24 | private slots: | ||
25 | void delayedInit ( ); | ||
23 | 26 | ||
24 | private: | 27 | private: |
25 | Opie::OQCopMessage m_msg; | 28 | Opie::OQCopMessage m_msg; |
26 | Opie::OQCopMessage m_msg_preset; | 29 | Opie::OQCopMessage m_msg_preset; |
27 | 30 | ||
28 | QListViewItem *m_current; | 31 | QListViewItem *m_current; |
29 | 32 | ||
30 | QListViewItem *m_map_none; | 33 | QListViewItem *m_map_none; |
31 | QListViewItem *m_map_preset; | 34 | QListViewItem *m_map_preset; |
32 | QListViewItem *m_map_custom; | 35 | QListViewItem *m_map_custom; |
36 | QListViewItem *m_map_show; | ||
33 | }; | 37 | }; |
34 | 38 | ||
35 | #endif | 39 | #endif |