summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index 759d6a3..1f69326 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -130,90 +130,90 @@ void Jornada::init(const QString&)
130} 130}
131 131
132void Jornada::initButtons() 132void Jornada::initButtons()
133{ 133{
134 if ( d->m_buttons ) 134 if ( d->m_buttons )
135 return; 135 return;
136 136
137 d->m_buttons = new QValueList <ODeviceButton>; 137 d->m_buttons = new QValueList <ODeviceButton>;
138 138
139 for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) { 139 for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) {
140 j_button *ib = jornada56x_buttons + i; 140 j_button *ib = jornada56x_buttons + i;
141 ODeviceButton b; 141 ODeviceButton b;
142 142
143 if (( ib->model & d->m_model ) == d->m_model ) { 143 if (( ib->model & d->m_model ) == d->m_model ) {
144 b. setKeycode ( ib->code ); 144 b. setKeycode ( ib->code );
145 b. setUserText ( QObject::tr ( "Button", ib->utext )); 145 b. setUserText ( QObject::tr ( "Button", ib->utext ));
146 b. setPixmap ( Resource::loadPixmap ( ib->pix )); 146 b. setPixmap ( Resource::loadPixmap ( ib->pix ));
147 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); 147 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction ));
148 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); 148 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction ));
149 149
150 d->m_buttons->append ( b ); 150 d->m_buttons->append ( b );
151 } 151 }
152 } 152 }
153 reloadButtonMapping(); 153 reloadButtonMapping();
154 154
155 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 155 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
156 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); 156 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
157} 157}
158 158
159int Jornada::displayBrightnessResolution() const 159int Jornada::displayBrightnessResolution() const
160{ 160{
161 return 255; 161 return 255;
162} 162}
163 163
164 164
165bool Jornada::setDisplayBrightness( int bright ) 165bool Jornada::setDisplayBrightness( int bright )
166{ 166{
167 bool res = false; 167 bool res = false;
168 168
169 if ( bright > 255 ) 169 if ( bright > 255 )
170 bright = 255; 170 bright = 255;
171 if ( bright < 0 ) 171 if ( bright < 0 )
172 bright = 0; 172 bright = 0;
173 173
174 QString cmdline; 174 QString cmdline;
175 175
176 int value = 255 - bright; 176 int value = 255 - bright;
177 if ( !bright ) 177 if ( !bright )
178 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power"); 178 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power");
179 else 179 else
180 cmdline = QString().sprintf( "echo 1 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", value ); 180 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", value );
181 181
182 res = ( ::system( (const char*) cmdline ) == 0 ); 182 res = ( ::system( (const char*) cmdline ) == 0 );
183 183
184 return res; 184 return res;
185} 185}
186 186
187 187
188bool Jornada::suspend( ) 188bool Jornada::suspend( )
189{ 189{
190 qDebug("ODevice::suspend"); 190 qDebug("ODevice::suspend");
191 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 191 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
192 return false; 192 return false;
193 193
194 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices 194 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
195 return false; 195 return false;
196 196
197 bool res = false; 197 bool res = false;
198 ODevice::sendSuspendmsg(); 198 ODevice::sendSuspendmsg();
199 199
200 struct timeval tvs; 200 struct timeval tvs;
201 ::gettimeofday ( &tvs, 0 ); 201 ::gettimeofday ( &tvs, 0 );
202 202
203 ::sync(); // flush fs caches 203 ::sync(); // flush fs caches
204 res = ( ::system ( "apm --suspend" ) == 0 ); 204 res = ( ::system ( "apm --suspend" ) == 0 );
205 205
206 return res; 206 return res;
207} 207}
208 208
209bool Jornada::setDisplayStatus ( bool on ) 209bool Jornada::setDisplayStatus ( bool on )
210{ 210{
211 bool res = false; 211 bool res = false;
212 212
213 QString cmdline = QString().sprintf( "echo %d > /sys/class/lcd/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/power", on ? "1" : "0", on ? "1" : "0" ); 213 QString cmdline = QString().sprintf( "echo %d > /sys/class/lcd/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/power", on ? "0" : "4", on? "0" : "4" );
214 214
215 res = ( ::system( (const char*) cmdline ) == 0 ); 215 res = ( ::system( (const char*) cmdline ) == 0 );
216 216
217 return res; 217 return res;
218} 218}
219 219