summaryrefslogtreecommitdiff
path: root/core/settings/button/buttonsettings.cpp
Unidiff
Diffstat (limited to 'core/settings/button/buttonsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/button/buttonsettings.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp
index 141e0f6..d80e496 100644
--- a/core/settings/button/buttonsettings.cpp
+++ b/core/settings/button/buttonsettings.cpp
@@ -91,97 +91,97 @@ ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal
91 bi-> m_button = &(*it); 91 bi-> m_button = &(*it);
92 bi-> m_index = index++; 92 bi-> m_index = index++;
93 bi-> m_pmsg = (*it). pressedAction ( ); 93 bi-> m_pmsg = (*it). pressedAction ( );
94 bi-> m_hmsg = (*it). heldAction ( ); 94 bi-> m_hmsg = (*it). heldAction ( );
95 bi-> m_pdirty = false; 95 bi-> m_pdirty = false;
96 bi-> m_hdirty = false; 96 bi-> m_hdirty = false;
97 97
98 l = new QLabel ( this ); 98 l = new QLabel ( this );
99 l-> setPixmap (( *it ). pixmap ( )); 99 l-> setPixmap (( *it ). pixmap ( ));
100 100
101 lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); 101 lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 );
102 102
103 l = new QLabel ( tr( "Press:" ), this ); 103 l = new QLabel ( tr( "Press:" ), this );
104 lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom ); 104 lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom );
105 l = new QLabel ( tr( "Hold:" ), this ); 105 l = new QLabel ( tr( "Hold:" ), this );
106 lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); 106 lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop );
107 107
108 l = new QLabel ( this ); 108 l = new QLabel ( this );
109 l-> setFixedSize ( 16, 16 ); 109 l-> setFixedSize ( 16, 16 );
110 lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom ); 110 lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom );
111 bi-> m_picon = l; 111 bi-> m_picon = l;
112 112
113 l = new QLabel ( this ); 113 l = new QLabel ( this );
114 l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); 114 l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine );
115 lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom ); 115 lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom );
116 bi-> m_plabel = l; 116 bi-> m_plabel = l;
117 117
118 l = new QLabel ( this ); 118 l = new QLabel ( this );
119 l-> setFixedSize ( 16, 16 ); 119 l-> setFixedSize ( 16, 16 );
120 lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); 120 lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop );
121 bi-> m_hicon = l; 121 bi-> m_hicon = l;
122 122
123 l = new QLabel ( this ); 123 l = new QLabel ( this );
124 l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); 124 l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine );
125 lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); 125 lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop );
126 bi-> m_hlabel = l; 126 bi-> m_hlabel = l;
127 127
128 i += 2; 128 i += 2;
129 129
130 m_infos. append ( bi ); 130 m_infos. append ( bi );
131 } 131 }
132 132
133 toplay-> addStretch ( 10 ); 133 toplay-> addStretch ( 10 );
134 134
135 m_last_button = 0; 135 m_last_button = 0;
136 m_lock = false; 136 m_lock = false;
137 137
138 m_timer = new QTimer ( this ); 138 m_timer = new QTimer ( this );
139 connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( ))); 139 connect ( m_timer, SIGNAL( timeout()), this, SLOT( keyTimeout()));
140 140
141 updateLabels ( ); 141 updateLabels ( );
142 142
143 QPEApplication::grabKeyboard ( ); 143 QPEApplication::grabKeyboard ( );
144} 144}
145 145
146ButtonSettings::~ButtonSettings ( ) 146ButtonSettings::~ButtonSettings ( )
147{ 147{
148 QPEApplication::ungrabKeyboard ( ); 148 QPEApplication::ungrabKeyboard ( );
149} 149}
150 150
151void ButtonSettings::updateLabels ( ) 151void ButtonSettings::updateLabels ( )
152{ 152{
153 for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { 153 for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) {
154 qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); 154 qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg );
155 155
156 (*it)-> m_picon-> setPixmap ( cip. m_icon ); 156 (*it)-> m_picon-> setPixmap ( cip. m_icon );
157 (*it)-> m_plabel-> setText ( cip. m_name ); 157 (*it)-> m_plabel-> setText ( cip. m_name );
158 158
159 qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); 159 qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg );
160 160
161 (*it)-> m_hicon-> setPixmap ( cih. m_icon ); 161 (*it)-> m_hicon-> setPixmap ( cih. m_icon );
162 (*it)-> m_hlabel-> setText ( cih. m_name ); 162 (*it)-> m_hlabel-> setText ( cih. m_name );
163 } 163 }
164} 164}
165 165
166buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) 166buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key )
167{ 167{
168 for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { 168 for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) {
169 if ((*it)-> m_button-> keycode ( ) == key ) 169 if ((*it)-> m_button-> keycode ( ) == key )
170 return *it; 170 return *it;
171 } 171 }
172 return 0; 172 return 0;
173} 173}
174 174
175void ButtonSettings::keyPressEvent ( QKeyEvent *e ) 175void ButtonSettings::keyPressEvent ( QKeyEvent *e )
176{ 176{
177 buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); 177 buttoninfo *bi = buttonInfoForKeycode ( e-> key ( ));
178 178
179 if ( bi && !e-> isAutoRepeat ( )) { 179 if ( bi && !e-> isAutoRepeat ( )) {
180 m_timer-> stop ( ); 180 m_timer-> stop ( );
181 m_last_button = bi; 181 m_last_button = bi;
182 m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); 182 m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true );
183 } 183 }
184 else 184 else
185 QDialog::keyPressEvent ( e ); 185 QDialog::keyPressEvent ( e );
186} 186}
187 187