author | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
commit | 9084969d2d4fa39d4d2c185695f0c88739a0f95c (patch) (unidiff) | |
tree | 4c76ee5bf61e9f0a883381d2ac68291075cfd541 /libopie2/opiecore/device | |
parent | 3d67a6ef781f59f9db936442a5b44329a0d5c70b (diff) | |
download | opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.zip opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.gz opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.bz2 |
cleanup - odevice is now and for future the one and only friend class
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 53 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 45 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 3 |
4 files changed, 58 insertions, 46 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 0068d88..cd3a84c 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -1,71 +1,72 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "odevice_ipaq.h" | 30 | #include "odevice_ipaq.h" |
31 | #include "odevice_jornada.h" | 31 | #include "odevice_jornada.h" |
32 | #include "odevice_ramses.h" | 32 | #include "odevice_ramses.h" |
33 | #include "odevice_simpad.h" | 33 | #include "odevice_simpad.h" |
34 | #include "odevice_yopy.h" | 34 | #include "odevice_yopy.h" |
35 | #include "odevice_zaurus.h" | 35 | #include "odevice_zaurus.h" |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | #include <qfile.h> | 39 | #include <qfile.h> |
40 | #include <qtextstream.h> | 40 | #include <qtextstream.h> |
41 | #include <qwindowsystem_qws.h> | 41 | #include <qwindowsystem_qws.h> |
42 | 42 | ||
43 | /* OPIE */ | 43 | /* OPIE */ |
44 | #include <qpe/config.h> | 44 | #include <qpe/config.h> |
45 | #include <qpe/resource.h> | 45 | #include <qpe/resource.h> |
46 | #include <qpe/sound.h> | 46 | #include <qpe/sound.h> |
47 | #include <qpe/qcopenvelope_qws.h> | 47 | #include <qpe/qcopenvelope_qws.h> |
48 | #include <opie2/okeyfilter.h> | ||
48 | 49 | ||
49 | /* STD */ | 50 | /* STD */ |
50 | #include <fcntl.h> | 51 | #include <fcntl.h> |
51 | #include <math.h> | 52 | #include <math.h> |
52 | #include <stdlib.h> | 53 | #include <stdlib.h> |
53 | #include <signal.h> | 54 | #include <signal.h> |
54 | #include <sys/ioctl.h> | 55 | #include <sys/ioctl.h> |
55 | #include <sys/time.h> | 56 | #include <sys/time.h> |
56 | #include <unistd.h> | 57 | #include <unistd.h> |
57 | #ifndef QT_NO_SOUND | 58 | #ifndef QT_NO_SOUND |
58 | #include <linux/soundcard.h> | 59 | #include <linux/soundcard.h> |
59 | #endif | 60 | #endif |
60 | 61 | ||
61 | namespace Opie { | 62 | namespace Opie { |
62 | namespace Core { | 63 | namespace Core { |
63 | 64 | ||
64 | static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; | 65 | static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; |
65 | 66 | ||
66 | 67 | ||
67 | /* STATIC and common implementation */ | 68 | /* STATIC and common implementation */ |
68 | /* EXPORT */ ODistribution distributions[] = { | 69 | /* EXPORT */ ODistribution distributions[] = { |
69 | { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, | 70 | { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, |
70 | { System_OpenZaurus, "OpenZaurus", "/etc/oz_version" }, | 71 | { System_OpenZaurus, "OpenZaurus", "/etc/oz_version" }, |
71 | { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, | 72 | { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, |
@@ -691,27 +692,37 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action ) | |||
691 | ODeviceButton &b = ( *d->m_buttons ) [button]; | 692 | ODeviceButton &b = ( *d->m_buttons ) [button]; |
692 | b. setHeldAction ( action ); | 693 | b. setHeldAction ( action ); |
693 | 694 | ||
694 | Config buttonFile ( "ButtonSettings" ); | 695 | Config buttonFile ( "ButtonSettings" ); |
695 | buttonFile. setGroup ( "Button" + QString::number ( button )); | 696 | buttonFile. setGroup ( "Button" + QString::number ( button )); |
696 | buttonFile. writeEntry ( "HeldActionChannel", (const char *) b. heldAction(). channel()); | 697 | buttonFile. writeEntry ( "HeldActionChannel", (const char *) b. heldAction(). channel()); |
697 | buttonFile. writeEntry ( "HeldActionMessage", (const char *) b. heldAction(). message()); | 698 | buttonFile. writeEntry ( "HeldActionMessage", (const char *) b. heldAction(). message()); |
698 | 699 | ||
699 | //buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data())); | 700 | //buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data())); |
700 | 701 | ||
701 | QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" ); | 702 | QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" ); |
702 | } | 703 | } |
703 | void ODevice::virtual_hook(int, void* ){ | 704 | void ODevice::virtual_hook(int, void* ){ |
704 | 705 | ||
705 | } | 706 | } |
706 | 707 | ||
707 | void ODevice::sendSuspendmsg() | 708 | void ODevice::sendSuspendmsg() |
708 | { | 709 | { |
709 | if ( isQWS() ) | 710 | if ( isQWS() ) |
710 | return; | 711 | return; |
711 | 712 | ||
712 | QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); | 713 | QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); |
713 | } | 714 | } |
714 | 715 | ||
716 | void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) | ||
717 | { | ||
718 | Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter); | ||
719 | } | ||
720 | |||
721 | void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) | ||
722 | { | ||
723 | Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); | ||
724 | } | ||
725 | |||
715 | 726 | ||
716 | } | 727 | } |
717 | } | 728 | } |
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 0465d7e..762d3f1 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -1,65 +1,66 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_H_ | 30 | #ifndef ODEVICE_H_ |
31 | #define ODEVICE_H_ | 31 | #define ODEVICE_H_ |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odevicebutton.h> | 34 | #include <opie2/odevicebutton.h> |
35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qnamespace.h> | 38 | #include <qnamespace.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | #include <qwindowsystem_qws.h> | ||
42 | 43 | ||
43 | namespace Opie{ | 44 | namespace Opie{ |
44 | namespace Core{ | 45 | namespace Core{ |
45 | 46 | ||
46 | class ODeviceData; | 47 | class ODeviceData; |
47 | /** | 48 | /** |
48 | * The available devices | 49 | * The available devices |
49 | */ | 50 | */ |
50 | enum OModel { | 51 | enum OModel { |
51 | Model_Unknown, // = 0 | 52 | Model_Unknown, // = 0 |
52 | 53 | ||
53 | Model_Series_Mask = 0xff000000, | 54 | Model_Series_Mask = 0xff000000, |
54 | 55 | ||
55 | Model_iPAQ = ( 1 << 24 ), | 56 | Model_iPAQ = ( 1 << 24 ), |
56 | 57 | ||
57 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 58 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
58 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 59 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
59 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 60 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
60 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 61 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
61 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 62 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
62 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 63 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
63 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 64 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
64 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 65 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
65 | 66 | ||
@@ -298,48 +299,50 @@ public: | |||
298 | /** | 299 | /** |
299 | * Reassigns the pressed action for \a button. To return to the factory | 300 | * Reassigns the pressed action for \a button. To return to the factory |
300 | * default pass an empty string as \a qcopMessage. | 301 | * default pass an empty string as \a qcopMessage. |
301 | */ | 302 | */ |
302 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 303 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
303 | 304 | ||
304 | /** | 305 | /** |
305 | * Reassigns the held action for \a button. To return to the factory | 306 | * Reassigns the held action for \a button. To return to the factory |
306 | * default pass an empty string as \a qcopMessage. | 307 | * default pass an empty string as \a qcopMessage. |
307 | */ | 308 | */ |
308 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 309 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
309 | 310 | ||
310 | /** | 311 | /** |
311 | * How long (in ms) you have to press a button for a "hold" action | 312 | * How long (in ms) you have to press a button for a "hold" action |
312 | */ | 313 | */ |
313 | uint buttonHoldTime() const; | 314 | uint buttonHoldTime() const; |
314 | 315 | ||
315 | signals: | 316 | signals: |
316 | void buttonMappingChanged(); | 317 | void buttonMappingChanged(); |
317 | 318 | ||
318 | private slots: | 319 | private slots: |
319 | void systemMessage ( const QCString &, const QByteArray & ); | 320 | void systemMessage ( const QCString &, const QByteArray & ); |
320 | 321 | ||
321 | protected: | 322 | protected: |
323 | void addPreHandler(QWSServer::KeyboardFilter*aFilter); | ||
324 | void remPreHandler(QWSServer::KeyboardFilter*aFilter); | ||
322 | void reloadButtonMapping(); | 325 | void reloadButtonMapping(); |
323 | /* ugly virtual hook */ | 326 | /* ugly virtual hook */ |
324 | virtual void virtual_hook( int id, void* data ); | 327 | virtual void virtual_hook( int id, void* data ); |
325 | }; | 328 | }; |
326 | 329 | ||
327 | class ODeviceData { | 330 | class ODeviceData { |
328 | 331 | ||
329 | public: | 332 | public: |
330 | QString m_vendorstr; | 333 | QString m_vendorstr; |
331 | OVendor m_vendor; | 334 | OVendor m_vendor; |
332 | 335 | ||
333 | QString m_modelstr; | 336 | QString m_modelstr; |
334 | OModel m_model; | 337 | OModel m_model; |
335 | 338 | ||
336 | QString m_systemstr; | 339 | QString m_systemstr; |
337 | OSystem m_system; | 340 | OSystem m_system; |
338 | 341 | ||
339 | QString m_sysverstr; | 342 | QString m_sysverstr; |
340 | 343 | ||
341 | Transformation m_rotation; | 344 | Transformation m_rotation; |
342 | ODirection m_direction; | 345 | ODirection m_direction; |
343 | 346 | ||
344 | QValueList <ODeviceButton> *m_buttons; | 347 | QValueList <ODeviceButton> *m_buttons; |
345 | uint m_holdtime; | 348 | uint m_holdtime; |
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 791e409..21fed99 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -148,50 +148,49 @@ void iPAQ::init(const QString& model) | |||
148 | case Model_iPAQ_H22xx: | 148 | case Model_iPAQ_H22xx: |
149 | d->m_rotation = Rot0; | 149 | d->m_rotation = Rot0; |
150 | break; | 150 | break; |
151 | case Model_iPAQ_H36xx: | 151 | case Model_iPAQ_H36xx: |
152 | case Model_iPAQ_H37xx: | 152 | case Model_iPAQ_H37xx: |
153 | case Model_iPAQ_H39xx: | 153 | case Model_iPAQ_H39xx: |
154 | default: | 154 | default: |
155 | d->m_rotation = Rot270; | 155 | d->m_rotation = Rot270; |
156 | break; | 156 | break; |
157 | 157 | ||
158 | } | 158 | } |
159 | 159 | ||
160 | m_leds [0] = m_leds [1] = Led_Off; | 160 | m_leds [0] = m_leds [1] = Led_Off; |
161 | 161 | ||
162 | m_power_timer = 0; | 162 | m_power_timer = 0; |
163 | 163 | ||
164 | } | 164 | } |
165 | 165 | ||
166 | void iPAQ::initButtons() | 166 | void iPAQ::initButtons() |
167 | { | 167 | { |
168 | if ( d->m_buttons ) | 168 | if ( d->m_buttons ) |
169 | return; | 169 | return; |
170 | 170 | ||
171 | if ( isQWS( ) ) { | 171 | if ( isQWS( ) ) { |
172 | Opie::Core::OKeyFilter::inst()->addPreHandler(this); | 172 | addPreHandler(this); |
173 | //QWSServer::setKeyboardFilter ( this ); | ||
174 | } | 173 | } |
175 | 174 | ||
176 | d->m_buttons = new QValueList <ODeviceButton>; | 175 | d->m_buttons = new QValueList <ODeviceButton>; |
177 | 176 | ||
178 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { | 177 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { |
179 | i_button *ib = ipaq_buttons + i; | 178 | i_button *ib = ipaq_buttons + i; |
180 | ODeviceButton b; | 179 | ODeviceButton b; |
181 | 180 | ||
182 | if (( ib->model & d->m_model ) == d->m_model ) { | 181 | if (( ib->model & d->m_model ) == d->m_model ) { |
183 | b. setKeycode ( ib->code ); | 182 | b. setKeycode ( ib->code ); |
184 | b. setUserText ( QObject::tr ( "Button", ib->utext )); | 183 | b. setUserText ( QObject::tr ( "Button", ib->utext )); |
185 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); | 184 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); |
186 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); | 185 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); |
187 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); | 186 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); |
188 | 187 | ||
189 | d->m_buttons->append ( b ); | 188 | d->m_buttons->append ( b ); |
190 | } | 189 | } |
191 | } | 190 | } |
192 | reloadButtonMapping(); | 191 | reloadButtonMapping(); |
193 | 192 | ||
194 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 193 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
195 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); | 194 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
196 | } | 195 | } |
197 | 196 | ||
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 6c3253c..bf46e43 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -126,50 +126,49 @@ void SIMpad::init(const QString&) | |||
126 | d->m_model = Model_SIMpad_SL4; | 126 | d->m_model = Model_SIMpad_SL4; |
127 | 127 | ||
128 | switch ( d->m_model ) { | 128 | switch ( d->m_model ) { |
129 | default: | 129 | default: |
130 | d->m_rotation = Rot0; | 130 | d->m_rotation = Rot0; |
131 | d->m_direction = CCW; | 131 | d->m_direction = CCW; |
132 | d->m_holdtime = 1000; // 1000ms | 132 | d->m_holdtime = 1000; // 1000ms |
133 | 133 | ||
134 | break; | 134 | break; |
135 | } | 135 | } |
136 | 136 | ||
137 | //Distribution detecting code is now in base class | 137 | //Distribution detecting code is now in base class |
138 | m_leds [0] = m_leds [1] = Led_Off; | 138 | m_leds [0] = m_leds [1] = Led_Off; |
139 | 139 | ||
140 | m_power_timer = 0; | 140 | m_power_timer = 0; |
141 | 141 | ||
142 | } | 142 | } |
143 | 143 | ||
144 | void SIMpad::initButtons() | 144 | void SIMpad::initButtons() |
145 | { | 145 | { |
146 | if ( d->m_buttons ) | 146 | if ( d->m_buttons ) |
147 | return; | 147 | return; |
148 | 148 | ||
149 | if ( isQWS( ) ) { | 149 | if ( isQWS( ) ) { |
150 | Opie::Core::OKeyFilter::inst()->addPreHandler(this); | 150 | addPreHandler(this); |
151 | // QWSServer::setKeyboardFilter ( this ); | ||
152 | } | 151 | } |
153 | 152 | ||
154 | 153 | ||
155 | d->m_buttons = new QValueList <ODeviceButton>; | 154 | d->m_buttons = new QValueList <ODeviceButton>; |
156 | 155 | ||
157 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { | 156 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { |
158 | s_button *sb = simpad_buttons + i; | 157 | s_button *sb = simpad_buttons + i; |
159 | ODeviceButton b; | 158 | ODeviceButton b; |
160 | 159 | ||
161 | if (( sb->model & d->m_model ) == d->m_model ) { | 160 | if (( sb->model & d->m_model ) == d->m_model ) { |
162 | b. setKeycode ( sb->code ); | 161 | b. setKeycode ( sb->code ); |
163 | b. setUserText ( QObject::tr ( "Button", sb->utext )); | 162 | b. setUserText ( QObject::tr ( "Button", sb->utext )); |
164 | b. setPixmap ( Resource::loadPixmap ( sb->pix )); | 163 | b. setPixmap ( Resource::loadPixmap ( sb->pix )); |
165 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); | 164 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); |
166 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); | 165 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); |
167 | 166 | ||
168 | d->m_buttons->append ( b ); | 167 | d->m_buttons->append ( b ); |
169 | } | 168 | } |
170 | } | 169 | } |
171 | reloadButtonMapping(); | 170 | reloadButtonMapping(); |
172 | 171 | ||
173 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 172 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
174 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); | 173 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
175 | } | 174 | } |