summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp56
-rw-r--r--core/launcher/desktop.h4
-rw-r--r--core/launcher/opie-taskbar.control2
3 files changed, 61 insertions, 1 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index d39af25..ce99bad 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -49,2 +49,4 @@
49 49
50#include <qvaluelist.h>
51
50#include <stdlib.h> 52#include <stdlib.h>
@@ -52,2 +54,22 @@
52 54
55
56class QCopKeyRegister
57{
58public:
59 QCopKeyRegister() : keyCode(0) { }
60 QCopKeyRegister(int k, const QString &c, const QString &m)
61 : keyCode(k), channel(c), message(m) { }
62
63 int getKeyCode() const { return keyCode; }
64 QString getChannel() const { return channel; }
65 QString getMessage() const { return message; }
66
67private:
68 int keyCode;
69 QString channel, message;
70};
71
72typedef QValueList<QCopKeyRegister> KeyRegisterList;
73KeyRegisterList keyRegisterList;
74
53static Desktop* qpedesktop = 0; 75static Desktop* qpedesktop = 0;
@@ -125,2 +147,6 @@ DesktopApplication::DesktopApplication( int& argc, char **argv, Type t )
125 pa = new DesktopPowerAlerter( 0 ); 147 pa = new DesktopPowerAlerter( 0 );
148
149 channel = new QCopChannel( "QPE/Desktop", this );
150 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
151 this, SLOT(receive(const QCString&, const QByteArray&)) );
126} 152}
@@ -134,2 +160,18 @@ DesktopApplication::~DesktopApplication()
134 160
161void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
162{
163 QDataStream stream( data, IO_ReadOnly );
164 if (msg == "keyRegister(int key, QString channel, QString message)")
165 {
166 int k;
167 QString c, m;
168
169 stream >> k;
170 stream >> c;
171 stream >> m;
172
173 qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m);
174 keyRegisterList.append(QCopKeyRegister(k,c,m));
175 }
176}
135 177
@@ -147,2 +189,10 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
147 bool press = ke->simpleData.is_press; 189 bool press = ke->simpleData.is_press;
190
191 KeyRegisterList::Iterator it;
192 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it )
193 {
194 if ((*it).getKeyCode() == ke->simpleData.keycode)
195 QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
196 }
197
148 if ( !keyboardGrabbed() ) { 198 if ( !keyboardGrabbed() ) {
@@ -180,2 +230,8 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
180 } 230 }
231 /*
232 if ( ke->simpleData.keycode == 4096 ) {
233 QCopEnvelope e("QPE/VMemo", "toggleRecord()");
234 return TRUE;
235 }
236 */
181 if ( ke->simpleData.keycode == Key_F34 ) { 237 if ( ke->simpleData.keycode == Key_F34 ) {
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h
index dfdbeab..f0a7cba 100644
--- a/core/launcher/desktop.h
+++ b/core/launcher/desktop.h
@@ -65,2 +65,5 @@ protected:
65 65
66public slots:
67 void receive( const QCString &msg, const QByteArray &data );
68
66protected slots: 69protected slots:
@@ -73,2 +76,3 @@ private:
73 QTimer *cardSendTimer; 76 QTimer *cardSendTimer;
77 QCopChannel *channel;
74}; 78};
diff --git a/core/launcher/opie-taskbar.control b/core/launcher/opie-taskbar.control
index 53daa82..3db0480 100644
--- a/core/launcher/opie-taskbar.control
+++ b/core/launcher/opie-taskbar.control
@@ -5,3 +5,3 @@ Maintainer: Warwick Allison <warwick@trolltech.com>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION.1
7Depends: qt-embedded (>=$QTE_VERSION) 7Depends: qt-embedded (>=$QTE_VERSION)