summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-19 16:35:56 (UTC)
committer llornkcor <llornkcor>2002-05-19 16:35:56 (UTC)
commit602ff2a6f588584bf47afa6faae08ce60b49047f (patch) (unidiff)
treec319da92b22a1a81be1e52f5bf2fe855d646cae3
parent7b05e648c1f7c29dee80d5731aacaab1a1b01b05 (diff)
downloadopie-602ff2a6f588584bf47afa6faae08ce60b49047f.zip
opie-602ff2a6f588584bf47afa6faae08ce60b49047f.tar.gz
opie-602ff2a6f588584bf47afa6faae08ce60b49047f.tar.bz2
don't send keyRegister QCop message if autoRepeated, and fixed spelling error
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index d5c16b3..85ba160 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -130,135 +130,135 @@ void DesktopPowerAlerter::alert( const QString &text, int priority )
130void DesktopPowerAlerter::hideEvent( QHideEvent *e ) 130void DesktopPowerAlerter::hideEvent( QHideEvent *e )
131{ 131{
132 QMessageBox::hideEvent( e ); 132 QMessageBox::hideEvent( e );
133 alertCount = 0; 133 alertCount = 0;
134 currentPriority = INT_MAX; 134 currentPriority = INT_MAX;
135} 135}
136 136
137 137
138 138
139DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) 139DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType )
140 : QPEApplication( argc, argv, appType ) 140 : QPEApplication( argc, argv, appType )
141{ 141{
142 142
143 QTimer *t = new QTimer( this ); 143 QTimer *t = new QTimer( this );
144 connect( t, SIGNAL(timeout()), this, SLOT(psTimeout()) ); 144 connect( t, SIGNAL(timeout()), this, SLOT(psTimeout()) );
145 t->start( 10000 ); 145 t->start( 10000 );
146 ps = new PowerStatus; 146 ps = new PowerStatus;
147 pa = new DesktopPowerAlerter( 0 ); 147 pa = new DesktopPowerAlerter( 0 );
148 148
149 channel = new QCopChannel( "QPE/Desktop", this ); 149 channel = new QCopChannel( "QPE/Desktop", this );
150 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 150 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
151 this, SLOT(receive(const QCString&, const QByteArray&)) ); 151 this, SLOT(receive(const QCString&, const QByteArray&)) );
152} 152}
153 153
154 154
155DesktopApplication::~DesktopApplication() 155DesktopApplication::~DesktopApplication()
156{ 156{
157 delete ps; 157 delete ps;
158 delete pa; 158 delete pa;
159} 159}
160 160
161void DesktopApplication::receive( const QCString &msg, const QByteArray &data ) 161void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
162{ 162{
163 QDataStream stream( data, IO_ReadOnly ); 163 QDataStream stream( data, IO_ReadOnly );
164 if (msg == "keyRegister(int key, QString channel, QString message)") 164 if (msg == "keyRegister(int key, QString channel, QString message)")
165 { 165 {
166 int k; 166 int k;
167 QString c, m; 167 QString c, m;
168 168
169 stream >> k; 169 stream >> k;
170 stream >> c; 170 stream >> c;
171 stream >> m; 171 stream >> m;
172 172
173 qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m); 173 qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m);
174 keyRegisterList.append(QCopKeyRegister(k,c,m)); 174 keyRegisterList.append(QCopKeyRegister(k,c,m));
175 } 175 }
176 else if (msg == "suspend()"){ 176 else if (msg == "suspend()"){
177 emit power(); 177 emit power();
178 } 178 }
179 179
180} 180}
181 181
182enum MemState { Unknown, VeryLow, Low, Normal } memstate=Unknown; 182enum MemState { Unknown, VeryLow, Low, Normal } memstate=Unknown;
183 183
184#ifdef Q_WS_QWS 184#ifdef Q_WS_QWS
185bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 185bool DesktopApplication::qwsEventFilter( QWSEvent *e )
186{ 186{
187 qpedesktop->checkMemory(); 187 qpedesktop->checkMemory();
188 188
189 if ( e->type == QWSEvent::Key ) { 189 if ( e->type == QWSEvent::Key ) {
190 QWSKeyEvent *ke = (QWSKeyEvent *)e; 190 QWSKeyEvent *ke = (QWSKeyEvent *)e;
191 if ( !loggedin && ke->simpleData.keycode != Key_F34 ) 191 if ( !loggedin && ke->simpleData.keycode != Key_F34 )
192 return TRUE; 192 return TRUE;
193 bool press = ke->simpleData.is_press; 193 bool press = ke->simpleData.is_press;
194 194 bool autoRepeat = ke ->simpleData.is_auto_repeat;
195 if (!keyRegisterList.isEmpty()) 195 if (!keyRegisterList.isEmpty())
196 { 196 {
197 KeyRegisterList::Iterator it; 197 KeyRegisterList::Iterator it;
198 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) 198 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it )
199 { 199 {
200 if ((*it).getKeyCode() == ke->simpleData.keycode) 200 if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat)
201 QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8()); 201 QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
202 } 202 }
203 } 203 }
204 204
205 if ( !keyboardGrabbed() ) { 205 if ( !keyboardGrabbed() ) {
206 if ( ke->simpleData.keycode == Key_F9 ) { 206 if ( ke->simpleData.keycode == Key_F9 ) {
207 if ( press ) emit datebook(); 207 if ( press ) emit datebook();
208 return TRUE; 208 return TRUE;
209 } 209 }
210 if ( ke->simpleData.keycode == Key_F10 ) { 210 if ( ke->simpleData.keycode == Key_F10 ) {
211 if ( !press && cardSendTimer ) { 211 if ( !press && cardSendTimer ) {
212 emit contacts(); 212 emit contacts();
213 delete cardSendTimer; 213 delete cardSendTimer;
214 } else if ( press ) { 214 } else if ( press ) {
215 cardSendTimer = new QTimer(); 215 cardSendTimer = new QTimer();
216 cardSendTimer->start( 2000, TRUE ); 216 cardSendTimer->start( 2000, TRUE );
217 connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) ); 217 connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) );
218 } 218 }
219 return TRUE; 219 return TRUE;
220 } 220 }
221 /* menu key now opens application menu/toolbar 221 /* menu key now opens application menu/toolbar
222 if ( ke->simpleData.keycode == Key_F11 ) { 222 if ( ke->simpleData.keycode == Key_F11 ) {
223 if ( press ) emit menu(); 223 if ( press ) emit menu();
224 return TRUE; 224 return TRUE;
225 } 225 }
226 */ 226 */
227 if ( ke->simpleData.keycode == Key_F12 ) { 227 if ( ke->simpleData.keycode == Key_F12 ) {
228 while( activePopupWidget() ) 228 while( activePopupWidget() )
229 activePopupWidget()->close(); 229 activePopupWidget()->close();
230 if ( press ) emit launch(); 230 if ( press ) emit launch();
231 return TRUE; 231 return TRUE;
232 } 232 }
233 if ( ke->simpleData.keycode == Key_F13 ) { 233 if ( ke->simpleData.keycode == Key_F13 ) {
234 if ( press ) emit email(); 234 if ( press ) emit email();
235 return TRUE; 235 return TRUE;
236 } 236 }
237 } 237 }
238 238
239 if ( ke->simpleData.keycode == Key_F34 ) { 239 if ( ke->simpleData.keycode == Key_F34 ) {
240 if ( press ) emit power(); 240 if ( press ) emit power();
241 return TRUE; 241 return TRUE;
242 } 242 }
243 if ( ke->simpleData.keycode == Key_SysReq ) { 243 if ( ke->simpleData.keycode == Key_SysReq ) {
244 if ( press ) emit power(); 244 if ( press ) emit power();
245 return TRUE; 245 return TRUE;
246 } 246 }
247 if ( ke->simpleData.keycode == Key_F35 ) { 247 if ( ke->simpleData.keycode == Key_F35 ) {
248 if ( press ) emit backlight(); 248 if ( press ) emit backlight();
249 return TRUE; 249 return TRUE;
250 } 250 }
251 if ( ke->simpleData.keycode == Key_F32 ) { 251 if ( ke->simpleData.keycode == Key_F32 ) {
252 if ( press ) QCopEnvelope e( "QPE/Desktop", "startSync()" ); 252 if ( press ) QCopEnvelope e( "QPE/Desktop", "startSync()" );
253 return TRUE; 253 return TRUE;
254 } 254 }
255 if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) { 255 if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) {
256 if ( press ) emit symbol(); 256 if ( press ) emit symbol();
257 return TRUE; 257 return TRUE;
258 } 258 }
259 if ( ke->simpleData.keycode == Key_NumLock ) { 259 if ( ke->simpleData.keycode == Key_NumLock ) {
260 if ( press ) emit numLockStateToggle(); 260 if ( press ) emit numLockStateToggle();
261 } 261 }
262 if ( ke->simpleData.keycode == Key_CapsLock ) { 262 if ( ke->simpleData.keycode == Key_CapsLock ) {
263 if ( press ) emit capsLockStateToggle(); 263 if ( press ) emit capsLockStateToggle();
264 } 264 }