-rw-r--r-- | core/launcher/desktop.cpp | 24 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 |
2 files changed, 15 insertions, 11 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 649862b..6771a66 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -38,15 +38,12 @@ | |||
38 | #include <qpe/timeconversion.h> | 38 | #include <qpe/timeconversion.h> |
39 | #include <qpe/qcopenvelope_qws.h> | 39 | #include <qpe/qcopenvelope_qws.h> |
40 | #include <qpe/global.h> | 40 | #include <qpe/global.h> |
41 | #ifdef QT_QWS_CUSTOM | 41 | #ifdef QT_QWS_CUSTOM |
42 | #include "qpe/custom.h" | 42 | #include "qpe/custom.h" |
43 | #endif | 43 | #endif |
44 | #if defined(QT_QWS_IPAQ) | ||
45 | #include "qpe/custom-ipaq.h" | ||
46 | #endif | ||
47 | 44 | ||
48 | #include <qgfx_qws.h> | 45 | #include <qgfx_qws.h> |
49 | #include <qmainwindow.h> | 46 | #include <qmainwindow.h> |
50 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
51 | #include <qtimer.h> | 48 | #include <qtimer.h> |
52 | #include <qwindowsystem_qws.h> | 49 | #include <qwindowsystem_qws.h> |
@@ -165,18 +162,17 @@ void DesktopApplication::receive( const QCString &msg, const QByteArray &data ) | |||
165 | { | 162 | { |
166 | QDataStream stream( data, IO_ReadOnly ); | 163 | QDataStream stream( data, IO_ReadOnly ); |
167 | if (msg == "keyRegister(int key, QString channel, QString message)") | 164 | if (msg == "keyRegister(int key, QString channel, QString message)") |
168 | { | 165 | { |
169 | int k; | 166 | int k; |
170 | QString c, m; | 167 | QString c, m; |
171 | |||
172 | stream >> k; | 168 | stream >> k; |
173 | stream >> c; | 169 | stream >> c; |
174 | stream >> m; | 170 | stream >> m; |
175 | 171 | ||
176 | qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m); | 172 | qWarning("KeyRegisterReceived: %i, %s, %s", k, (const char*)c, (const char *)m ); |
177 | keyRegisterList.append(QCopKeyRegister(k,c,m)); | 173 | keyRegisterList.append(QCopKeyRegister(k,c,m)); |
178 | } | 174 | } |
179 | else if (msg == "suspend()"){ | 175 | else if (msg == "suspend()"){ |
180 | emit power(); | 176 | emit power(); |
181 | } | 177 | } |
182 | 178 | ||
@@ -197,16 +193,18 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) | |||
197 | bool autoRepeat = ke ->simpleData.is_auto_repeat; | 193 | bool autoRepeat = ke ->simpleData.is_auto_repeat; |
198 | if (!keyRegisterList.isEmpty()) | 194 | if (!keyRegisterList.isEmpty()) |
199 | { | 195 | { |
200 | KeyRegisterList::Iterator it; | 196 | KeyRegisterList::Iterator it; |
201 | for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) | 197 | for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) |
202 | { | 198 | { |
203 | if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat) | 199 | if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat) { |
200 | if(press) qDebug("press"); else qDebug("release"); | ||
204 | QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8()); | 201 | QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8()); |
205 | } | 202 | } |
206 | } | 203 | } |
204 | } | ||
207 | 205 | ||
208 | if ( !keyboardGrabbed() ) { | 206 | if ( !keyboardGrabbed() ) { |
209 | if ( ke->simpleData.keycode == Key_F9 ) { | 207 | if ( ke->simpleData.keycode == Key_F9 ) { |
210 | if ( press ) emit datebook(); | 208 | if ( press ) emit datebook(); |
211 | return TRUE; | 209 | return TRUE; |
212 | } | 210 | } |
@@ -738,16 +736,21 @@ void Desktop::terminateServers() | |||
738 | transferServer = 0; | 736 | transferServer = 0; |
739 | qcopBridge = 0; | 737 | qcopBridge = 0; |
740 | } | 738 | } |
741 | 739 | ||
742 | void Desktop::rereadVolumes() | 740 | void Desktop::rereadVolumes() |
743 | { | 741 | { |
744 | Config cfg("Sound"); | 742 | Config cfg("qpe"); |
745 | cfg.setGroup("System"); | 743 | cfg.setGroup("Volume"); |
746 | touchclick = cfg.readBoolEntry("Touch"); | 744 | touchclick = cfg.readBoolEntry("TouchSound"); |
747 | keyclick = cfg.readBoolEntry("Key"); | 745 | keyclick = cfg.readBoolEntry("KeySound"); |
746 | alarmsound = cfg.readBoolEntry("AlarmSound"); | ||
747 | // Config cfg("Sound"); | ||
748 | // cfg.setGroup("System"); | ||
749 | // touchclick = cfg.readBoolEntry("Touch"); | ||
750 | // keyclick = cfg.readBoolEntry("Key"); | ||
748 | } | 751 | } |
749 | 752 | ||
750 | void Desktop::keyClick() | 753 | void Desktop::keyClick() |
751 | { | 754 | { |
752 | #ifdef CUSTOM_SOUND_KEYCLICK | 755 | #ifdef CUSTOM_SOUND_KEYCLICK |
753 | if ( keyclick ) | 756 | if ( keyclick ) |
@@ -763,12 +766,13 @@ void Desktop::screenClick() | |||
763 | #endif | 766 | #endif |
764 | } | 767 | } |
765 | 768 | ||
766 | void Desktop::soundAlarm() | 769 | void Desktop::soundAlarm() |
767 | { | 770 | { |
768 | #ifdef CUSTOM_SOUND_ALARM | 771 | #ifdef CUSTOM_SOUND_ALARM |
772 | if (alarmsound) | ||
769 | CUSTOM_SOUND_ALARM; | 773 | CUSTOM_SOUND_ALARM; |
770 | #endif | 774 | #endif |
771 | } | 775 | } |
772 | 776 | ||
773 | bool Desktop::eventFilter( QObject *w, QEvent *ev ) | 777 | bool Desktop::eventFilter( QObject *w, QEvent *ev ) |
774 | { | 778 | { |
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index e094dc0..9bc4be9 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h | |||
@@ -125,12 +125,12 @@ private: | |||
125 | 125 | ||
126 | QCopBridge *qcopBridge; | 126 | QCopBridge *qcopBridge; |
127 | TransferServer *transferServer; | 127 | TransferServer *transferServer; |
128 | PackageSlave *packageSlave; | 128 | PackageSlave *packageSlave; |
129 | 129 | ||
130 | QDateTime suspendTime; | 130 | QDateTime suspendTime; |
131 | bool keyclick,touchclick; | 131 | bool keyclick,touchclick,alarmsound; |
132 | }; | 132 | }; |
133 | 133 | ||
134 | 134 | ||
135 | #endif // __DESKTOP_H__ | 135 | #endif // __DESKTOP_H__ |
136 | 136 | ||