-rw-r--r-- | libopie2/opiecore/device/odevice_jornada.cpp | 6 |
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 | |||
@@ -146,74 +146,74 @@ void Jornada::initButtons() | |||
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 | ||
159 | int Jornada::displayBrightnessResolution() const | 159 | int Jornada::displayBrightnessResolution() const |
160 | { | 160 | { |
161 | return 255; | 161 | return 255; |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
165 | bool Jornada::setDisplayBrightness( int bright ) | 165 | bool 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 | ||
188 | bool Jornada::suspend( ) | 188 | bool 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 | ||
209 | bool Jornada::setDisplayStatus ( bool on ) | 209 | bool 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 | ||