summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device
Unidiff
Diffstat (limited to 'libopie2/opiecore/device') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp13
-rw-r--r--libopie2/opiecore/device/odevice.h1
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_yopy.cpp4
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp4
6 files changed, 11 insertions, 17 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 8b64c41..67cae1c 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -156,48 +156,51 @@ ODevice *ODevice::inst()
156 return dev; 156 return dev;
157} 157}
158 158
159ODevice::ODevice() 159ODevice::ODevice()
160{ 160{
161 d = new ODeviceData; 161 d = new ODeviceData;
162 162
163 d->m_modelstr = "Unknown"; 163 d->m_modelstr = "Unknown";
164 d->m_model = Model_Unknown; 164 d->m_model = Model_Unknown;
165 d->m_vendorstr = "Unknown"; 165 d->m_vendorstr = "Unknown";
166 d->m_vendor = Vendor_Unknown; 166 d->m_vendor = Vendor_Unknown;
167 d->m_systemstr = "Unknown"; 167 d->m_systemstr = "Unknown";
168 d->m_system = System_Unknown; 168 d->m_system = System_Unknown;
169 d->m_sysverstr = "0.0"; 169 d->m_sysverstr = "0.0";
170 d->m_rotation = Rot0; 170 d->m_rotation = Rot0;
171 d->m_direction = CW; 171 d->m_direction = CW;
172 172
173 d->m_holdtime = 1000; // 1000ms 173 d->m_holdtime = 1000; // 1000ms
174 d->m_buttons = 0; 174 d->m_buttons = 0;
175 d->m_cpu_frequencies = new QStrList; 175 d->m_cpu_frequencies = new QStrList;
176 176
177 177
178 /* mixer */ 178 /* mixer */
179 d->m_sound = d->m_vol = d->m_mixer = -1; 179 d->m_sound = d->m_vol = d->m_mixer = -1;
180
181 /* System QCopChannel created */
182 d->m_initializedButtonQcop = false;
180 183
181 // New distribution detection code first checks for legacy distributions, 184 // New distribution detection code first checks for legacy distributions,
182 // identified by /etc/familiar-version or /etc/oz_version. 185 // identified by /etc/familiar-version or /etc/oz_version.
183 // Then check for OpenEmbedded and lastly, read /etc/issue 186 // Then check for OpenEmbedded and lastly, read /etc/issue
184 187
185 for ( unsigned int i = 0; i < sizeof distributions; ++i ) 188 for ( unsigned int i = 0; i < sizeof distributions; ++i )
186 { 189 {
187 if ( QFile::exists( distributions[i].sysvfile ) ) 190 if ( QFile::exists( distributions[i].sysvfile ) )
188 { 191 {
189 d->m_systemstr = distributions[i].sysstr; 192 d->m_systemstr = distributions[i].sysstr;
190 d->m_system = distributions[i].system; 193 d->m_system = distributions[i].system;
191 d->m_sysverstr = "<Unknown>"; 194 d->m_sysverstr = "<Unknown>";
192 QFile f( distributions[i].sysvfile ); 195 QFile f( distributions[i].sysvfile );
193 if ( f.open( IO_ReadOnly ) ) 196 if ( f.open( IO_ReadOnly ) )
194 { 197 {
195 QTextStream ts( &f ); 198 QTextStream ts( &f );
196 d->m_sysverstr = ts.readLine().replace( QRegExp( "\\\\." ), "" ); 199 d->m_sysverstr = ts.readLine().replace( QRegExp( "\\\\." ), "" );
197 } 200 }
198 break; 201 break;
199 } 202 }
200 } 203 }
201} 204}
202 205
203void ODevice::systemMessage( const QCString &msg, const QByteArray & ) 206void ODevice::systemMessage( const QCString &msg, const QByteArray & )
@@ -212,51 +215,48 @@ void ODevice::init(const QString&)
212} 215}
213 216
214/** 217/**
215* This method initialises the button mapping 218* This method initialises the button mapping
216*/ 219*/
217void ODevice::initButtons() 220void ODevice::initButtons()
218{ 221{
219 if ( d->m_buttons ) 222 if ( d->m_buttons )
220 return; 223 return;
221 224
222 qDebug ( "init Buttons" ); 225 qDebug ( "init Buttons" );
223 d->m_buttons = new QValueList <ODeviceButton>; 226 d->m_buttons = new QValueList <ODeviceButton>;
224 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { 227 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) {
225 default_button *db = default_buttons + i; 228 default_button *db = default_buttons + i;
226 ODeviceButton b; 229 ODeviceButton b;
227 b. setKeycode ( db->code ); 230 b. setKeycode ( db->code );
228 b. setUserText ( QObject::tr ( "Button", db->utext )); 231 b. setUserText ( QObject::tr ( "Button", db->utext ));
229 b. setPixmap ( Resource::loadPixmap ( db->pix )); 232 b. setPixmap ( Resource::loadPixmap ( db->pix ));
230 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); 233 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction ));
231 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); 234 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction ));
232 d->m_buttons->append ( b ); 235 d->m_buttons->append ( b );
233 } 236 }
234 237
235 reloadButtonMapping(); 238 reloadButtonMapping();
236
237 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
238 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
239} 239}
240 240
241ODevice::~ODevice() 241ODevice::~ODevice()
242{ 242{
243// we leak m_devicebuttons and m_cpu_frequency 243// we leak m_devicebuttons and m_cpu_frequency
244// but it's a singleton and it is not so importantant 244// but it's a singleton and it is not so importantant
245// -zecke 245// -zecke
246 delete d; 246 delete d;
247} 247}
248 248
249bool ODevice::setSoftSuspend ( bool /*soft*/ ) 249bool ODevice::setSoftSuspend ( bool /*soft*/ )
250{ 250{
251 return false; 251 return false;
252} 252}
253 253
254//#include <linux/apm_bios.h> 254//#include <linux/apm_bios.h>
255 255
256#define APM_IOC_SUSPEND OD_IO( 'A', 2 ) 256#define APM_IOC_SUSPEND OD_IO( 'A', 2 )
257 257
258/** 258/**
259* This method will try to suspend the device 259* This method will try to suspend the device
260* It only works if the user is the QWS Server and the apm application 260* It only works if the user is the QWS Server and the apm application
261* is installed. 261* is installed.
262* It tries to suspend and then waits some time cause some distributions 262* It tries to suspend and then waits some time cause some distributions
@@ -624,48 +624,55 @@ uint ODevice::buttonHoldTime() const
624 return d->m_holdtime; 624 return d->m_holdtime;
625} 625}
626 626
627/** 627/**
628* This method return a ODeviceButton for a key code 628* This method return a ODeviceButton for a key code
629* or 0 if no special hardware button is available for the device 629* or 0 if no special hardware button is available for the device
630* 630*
631* @return The devicebutton or 0l 631* @return The devicebutton or 0l
632* @see ODeviceButton 632* @see ODeviceButton
633*/ 633*/
634const ODeviceButton *ODevice::buttonForKeycode ( ushort code ) 634const ODeviceButton *ODevice::buttonForKeycode ( ushort code )
635{ 635{
636 initButtons(); 636 initButtons();
637 637
638 for ( QValueListConstIterator<ODeviceButton> it = d->m_buttons->begin(); it != d->m_buttons->end(); ++it ) { 638 for ( QValueListConstIterator<ODeviceButton> it = d->m_buttons->begin(); it != d->m_buttons->end(); ++it ) {
639 if ( (*it). keycode() == code ) 639 if ( (*it). keycode() == code )
640 return &(*it); 640 return &(*it);
641 } 641 }
642 return 0; 642 return 0;
643} 643}
644 644
645void ODevice::reloadButtonMapping() 645void ODevice::reloadButtonMapping()
646{ 646{
647 initButtons(); 647 initButtons();
648
649 if(!d->m_initializedButtonQcop) {
650 QCopChannel *chan = new QCopChannel("QPE/System", this, "ODevice button channel");
651 connect(chan,SIGNAL(received(const QCString&,const QByteArray&)),
652 this,SLOT(systemMessage(const QCString&,const QByteArray&)));
653 d->m_initializedButtonQcop = true;
654 }
648 655
649 Config cfg ( "ButtonSettings" ); 656 Config cfg ( "ButtonSettings" );
650 657
651 for ( uint i = 0; i < d->m_buttons->count(); i++ ) { 658 for ( uint i = 0; i < d->m_buttons->count(); i++ ) {
652 ODeviceButton &b = ( *d->m_buttons ) [i]; 659 ODeviceButton &b = ( *d->m_buttons ) [i];
653 QString group = "Button" + QString::number ( i ); 660 QString group = "Button" + QString::number ( i );
654 661
655 QCString pch, hch; 662 QCString pch, hch;
656 QCString pm, hm; 663 QCString pm, hm;
657 QByteArray pdata, hdata; 664 QByteArray pdata, hdata;
658 665
659 if ( cfg. hasGroup ( group )) { 666 if ( cfg. hasGroup ( group )) {
660 cfg. setGroup ( group ); 667 cfg. setGroup ( group );
661 pch = cfg. readEntry ( "PressedActionChannel" ). latin1(); 668 pch = cfg. readEntry ( "PressedActionChannel" ). latin1();
662 pm = cfg. readEntry ( "PressedActionMessage" ). latin1(); 669 pm = cfg. readEntry ( "PressedActionMessage" ). latin1();
663 // pdata = decodeBase64 ( buttonFile. readEntry ( "PressedActionArgs" )); 670 // pdata = decodeBase64 ( buttonFile. readEntry ( "PressedActionArgs" ));
664 671
665 hch = cfg. readEntry ( "HeldActionChannel" ). latin1(); 672 hch = cfg. readEntry ( "HeldActionChannel" ). latin1();
666 hm = cfg. readEntry ( "HeldActionMessage" ). latin1(); 673 hm = cfg. readEntry ( "HeldActionMessage" ). latin1();
667 // hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" )); 674 // hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" ));
668 } 675 }
669 676
670 b. setPressedAction ( OQCopMessage ( pch, pm, pdata )); 677 b. setPressedAction ( OQCopMessage ( pch, pm, pdata ));
671 678
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index 6f0d036..21fcc3f 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -336,39 +336,40 @@ protected:
336 /* ugly virtual hook */ 336 /* ugly virtual hook */
337 virtual void virtual_hook( int id, void* data ); 337 virtual void virtual_hook( int id, void* data );
338}; 338};
339 339
340class ODeviceData { 340class ODeviceData {
341 341
342 public: 342 public:
343 QString m_vendorstr; 343 QString m_vendorstr;
344 OVendor m_vendor; 344 OVendor m_vendor;
345 345
346 QString m_modelstr; 346 QString m_modelstr;
347 OModel m_model; 347 OModel m_model;
348 348
349 QString m_systemstr; 349 QString m_systemstr;
350 OSystem m_system; 350 OSystem m_system;
351 351
352 QString m_sysverstr; 352 QString m_sysverstr;
353 353
354 Transformation m_rotation; 354 Transformation m_rotation;
355 ODirection m_direction; 355 ODirection m_direction;
356 356
357 QValueList <ODeviceButton> *m_buttons; 357 QValueList <ODeviceButton> *m_buttons;
358 uint m_holdtime; 358 uint m_holdtime;
359 QStrList *m_cpu_frequencies; 359 QStrList *m_cpu_frequencies;
360 boolm_initializedButtonQcop : 1;
360 361
361 /* values for changeMixerForAlarm */ 362 /* values for changeMixerForAlarm */
362 int m_sound, m_vol, m_mixer; 363 int m_sound, m_vol, m_mixer;
363}; 364};
364 365
365extern bool isQWS(); 366extern bool isQWS();
366extern QCString makeChannel ( const char *str ); 367extern QCString makeChannel ( const char *str );
367} 368}
368} 369}
369 370
370 371
371 372
372 373
373#endif 374#endif
374 375
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 6193ddc..9e01a0c 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -168,51 +168,48 @@ void iPAQ::initButtons()
168 if ( d->m_buttons ) 168 if ( d->m_buttons )
169 return; 169 return;
170 170
171 if ( isQWS( ) ) { 171 if ( isQWS( ) ) {
172 addPreHandler(this); 172 addPreHandler(this);
173 } 173 }
174 174
175 d->m_buttons = new QValueList <ODeviceButton>; 175 d->m_buttons = new QValueList <ODeviceButton>;
176 176
177 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++ ) {
178 i_button *ib = ipaq_buttons + i; 178 i_button *ib = ipaq_buttons + i;
179 ODeviceButton b; 179 ODeviceButton b;
180 180
181 if (( ib->model & d->m_model ) == d->m_model ) { 181 if (( ib->model & d->m_model ) == d->m_model ) {
182 b. setKeycode ( ib->code ); 182 b. setKeycode ( ib->code );
183 b. setUserText ( QObject::tr ( "Button", ib->utext )); 183 b. setUserText ( QObject::tr ( "Button", ib->utext ));
184 b. setPixmap ( Resource::loadPixmap ( ib->pix )); 184 b. setPixmap ( Resource::loadPixmap ( ib->pix ));
185 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); 185 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction ));
186 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); 186 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction ));
187 187
188 d->m_buttons->append ( b ); 188 d->m_buttons->append ( b );
189 } 189 }
190 } 190 }
191 reloadButtonMapping(); 191 reloadButtonMapping();
192
193 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
194 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
195} 192}
196 193
197QValueList <OLed> iPAQ::ledList() const 194QValueList <OLed> iPAQ::ledList() const
198{ 195{
199 QValueList <OLed> vl; 196 QValueList <OLed> vl;
200 vl << Led_Power; 197 vl << Led_Power;
201 198
202 if ( d->m_model == Model_iPAQ_H38xx ) 199 if ( d->m_model == Model_iPAQ_H38xx )
203 vl << Led_BlueTooth; 200 vl << Led_BlueTooth;
204 return vl; 201 return vl;
205} 202}
206 203
207QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const 204QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const
208{ 205{
209 QValueList <OLedState> vl; 206 QValueList <OLedState> vl;
210 207
211 if ( l == Led_Power ) 208 if ( l == Led_Power )
212 vl << Led_Off << Led_On << Led_BlinkSlow << Led_BlinkFast; 209 vl << Led_Off << Led_On << Led_BlinkSlow << Led_BlinkFast;
213 else if ( l == Led_BlueTooth && d->m_model == Model_iPAQ_H38xx ) 210 else if ( l == Led_BlueTooth && d->m_model == Model_iPAQ_H38xx )
214 vl << Led_Off; // << Led_On << ??? 211 vl << Led_Off; // << Led_On << ???
215 212
216 return vl; 213 return vl;
217} 214}
218 215
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index 2cab0c8..8141f1c 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -119,51 +119,48 @@ void Jornada::init(const QString&)
119} 119}
120 120
121void Jornada::initButtons() 121void Jornada::initButtons()
122{ 122{
123 if ( d->m_buttons ) 123 if ( d->m_buttons )
124 return; 124 return;
125 125
126 d->m_buttons = new QValueList <ODeviceButton>; 126 d->m_buttons = new QValueList <ODeviceButton>;
127 127
128 for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) { 128 for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) {
129 j_button *ib = jornada56x_buttons + i; 129 j_button *ib = jornada56x_buttons + i;
130 ODeviceButton b; 130 ODeviceButton b;
131 131
132 if (( ib->model & d->m_model ) == d->m_model ) { 132 if (( ib->model & d->m_model ) == d->m_model ) {
133 b. setKeycode ( ib->code ); 133 b. setKeycode ( ib->code );
134 b. setUserText ( QObject::tr ( "Button", ib->utext )); 134 b. setUserText ( QObject::tr ( "Button", ib->utext ));
135 b. setPixmap ( Resource::loadPixmap ( ib->pix )); 135 b. setPixmap ( Resource::loadPixmap ( ib->pix ));
136 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); 136 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction ));
137 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); 137 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction ));
138 138
139 d->m_buttons->append ( b ); 139 d->m_buttons->append ( b );
140 } 140 }
141 } 141 }
142 reloadButtonMapping(); 142 reloadButtonMapping();
143
144 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
145 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
146} 143}
147 144
148int Jornada::displayBrightnessResolution() const 145int Jornada::displayBrightnessResolution() const
149{ 146{
150 return 255; 147 return 255;
151} 148}
152 149
153 150
154bool Jornada::setDisplayBrightness( int bright ) 151bool Jornada::setDisplayBrightness( int bright )
155{ 152{
156 bool res = false; 153 bool res = false;
157 154
158 if ( bright > 255 ) 155 if ( bright > 255 )
159 bright = 255; 156 bright = 255;
160 if ( bright < 0 ) 157 if ( bright < 0 )
161 bright = 0; 158 bright = 0;
162 159
163 QString cmdline; 160 QString cmdline;
164 161
165 if ( !bright ) 162 if ( !bright )
166 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power"); 163 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power");
167 else 164 else
168 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", bright ); 165 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", bright );
169 166
diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp
index a06d7ec..8f22514 100644
--- a/libopie2/opiecore/device/odevice_yopy.cpp
+++ b/libopie2/opiecore/device/odevice_yopy.cpp
@@ -88,52 +88,48 @@ void Yopy::initButtons()
88{ 88{
89 if ( d->m_buttons ) 89 if ( d->m_buttons )
90 return ; 90 return ;
91 91
92 d->m_buttons = new QValueList <ODeviceButton>; 92 d->m_buttons = new QValueList <ODeviceButton>;
93 93
94 for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ ) 94 for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ )
95 { 95 {
96 96
97 yopy_button *ib = yopy_buttons + i; 97 yopy_button *ib = yopy_buttons + i;
98 98
99 ODeviceButton b; 99 ODeviceButton b;
100 100
101 b. setKeycode ( ib->code ); 101 b. setKeycode ( ib->code );
102 b. setUserText ( QObject::tr ( "Button", ib->utext ) ); 102 b. setUserText ( QObject::tr ( "Button", ib->utext ) );
103 b. setPixmap ( Resource::loadPixmap ( ib->pix ) ); 103 b. setPixmap ( Resource::loadPixmap ( ib->pix ) );
104 b. setFactoryPresetPressedAction 104 b. setFactoryPresetPressedAction
105 ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) ); 105 ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) );
106 b. setFactoryPresetHeldAction 106 b. setFactoryPresetHeldAction
107 ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) ); 107 ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) );
108 108
109 d->m_buttons->append ( b ); 109 d->m_buttons->append ( b );
110 } 110 }
111 reloadButtonMapping(); 111 reloadButtonMapping();
112
113 QCopChannel *sysch = new QCopChannel( "QPE/System", this );
114 connect( sysch, SIGNAL( received(const QCString&,const QByteArray&) ),
115 this, SLOT( systemMessage(const QCString&,const QByteArray&) ) );
116} 112}
117 113
118 114
119bool Yopy::suspend() 115bool Yopy::suspend()
120{ 116{
121 /* Opie for Yopy does not implement its own power management at the 117 /* Opie for Yopy does not implement its own power management at the
122 moment. The public version runs parallel to X, and relies on the 118 moment. The public version runs parallel to X, and relies on the
123 existing power management features. */ 119 existing power management features. */
124 return false; 120 return false;
125} 121}
126 122
127 123
128bool Yopy::setDisplayBrightness( int bright ) 124bool Yopy::setDisplayBrightness( int bright )
129{ 125{
130 /* The code here works, but is disabled as the current version runs 126 /* The code here works, but is disabled as the current version runs
131 parallel to X, and relies on the existing backlight demon. */ 127 parallel to X, and relies on the existing backlight demon. */
132#if 0 128#if 0
133 if ( QFile::exists( "/proc/sys/pm/light" ) ) 129 if ( QFile::exists( "/proc/sys/pm/light" ) )
134 { 130 {
135 int fd = ::open( "/proc/sys/pm/light", O_WRONLY ); 131 int fd = ::open( "/proc/sys/pm/light", O_WRONLY );
136 if ( fd >= 0 ) 132 if ( fd >= 0 )
137 { 133 {
138 if ( bright ) 134 if ( bright )
139 ::write( fd, "1\n", 2 ); 135 ::write( fd, "1\n", 2 );
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 733479e..ebe1949 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -217,52 +217,48 @@ void Zaurus::initButtons()
217 buttoncount = ARRAY_SIZE(z_buttons_c700); 217 buttoncount = ARRAY_SIZE(z_buttons_c700);
218 break; 218 break;
219 default: 219 default:
220 pz_buttons = z_buttons; 220 pz_buttons = z_buttons;
221 buttoncount = ARRAY_SIZE(z_buttons); 221 buttoncount = ARRAY_SIZE(z_buttons);
222 break; 222 break;
223 } 223 }
224 224
225 for ( int i = 0; i < buttoncount; i++ ) { 225 for ( int i = 0; i < buttoncount; i++ ) {
226 struct z_button *zb = pz_buttons + i; 226 struct z_button *zb = pz_buttons + i;
227 ODeviceButton b; 227 ODeviceButton b;
228 228
229 b. setKeycode ( zb->code ); 229 b. setKeycode ( zb->code );
230 b. setUserText ( QObject::tr ( "Button", zb->utext )); 230 b. setUserText ( QObject::tr ( "Button", zb->utext ));
231 b. setPixmap ( Resource::loadPixmap ( zb->pix )); 231 b. setPixmap ( Resource::loadPixmap ( zb->pix ));
232 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ), 232 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ),
233 zb->fpressedaction )); 233 zb->fpressedaction ));
234 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ), 234 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ),
235 zb->fheldaction )); 235 zb->fheldaction ));
236 236
237 d->m_buttons->append ( b ); 237 d->m_buttons->append ( b );
238 } 238 }
239 239
240 reloadButtonMapping(); 240 reloadButtonMapping();
241
242 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
243 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)),
244 this, SLOT( systemMessage(const QCString&,const QByteArray&)));
245} 241}
246 242
247#include <unistd.h> 243#include <unistd.h>
248#include <fcntl.h> 244#include <fcntl.h>
249#include <sys/ioctl.h> 245#include <sys/ioctl.h>
250 246
251//#include <asm/sharp_char.h> // including kernel headers is evil ... 247//#include <asm/sharp_char.h> // including kernel headers is evil ...
252 248
253#define SHARP_DEV_IOCTL_COMMAND_START 0x5680 249#define SHARP_DEV_IOCTL_COMMAND_START 0x5680
254 250
255 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 251 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
256#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) 252#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START)
257 253
258#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ 254#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */
259#define SHARP_BUZ_KEYSOUND 2 /* key sound */ 255#define SHARP_BUZ_KEYSOUND 2 /* key sound */
260#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ 256#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */
261 257
262/* --- for SHARP_BUZZER device --- */ 258/* --- for SHARP_BUZZER device --- */
263 259
264 //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 260 //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
265//#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) 261//#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START)
266 262
267#define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) 263#define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1)
268#define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) 264#define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2)