summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index 60736a1..2cab0c8 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -117,92 +117,91 @@ void Jornada::init(const QString&)
117 d->m_rotation = Rot0; 117 d->m_rotation = Rot0;
118 //Distribution detecting code is now in base class 118 //Distribution detecting code is now in base class
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 143
144 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 144 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
145 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); 145 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
146} 146}
147 147
148int Jornada::displayBrightnessResolution() const 148int Jornada::displayBrightnessResolution() const
149{ 149{
150 return 255; 150 return 255;
151} 151}
152 152
153 153
154bool Jornada::setDisplayBrightness( int bright ) 154bool Jornada::setDisplayBrightness( int bright )
155{ 155{
156 bool res = false; 156 bool res = false;
157 157
158 if ( bright > 255 ) 158 if ( bright > 255 )
159 bright = 255; 159 bright = 255;
160 if ( bright < 0 ) 160 if ( bright < 0 )
161 bright = 0; 161 bright = 0;
162 162
163 QString cmdline; 163 QString cmdline;
164 164
165 int value = 255 - bright;
166 if ( !bright ) 165 if ( !bright )
167 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power"); 166 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power");
168 else 167 else
169 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", value ); 168 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", bright );
170 169
171 res = ( ::system( (const char*) cmdline ) == 0 ); 170 res = ( ::system( (const char*) cmdline ) == 0 );
172 171
173 return res; 172 return res;
174} 173}
175 174
176 175
177bool Jornada::suspend( ) 176bool Jornada::suspend( )
178{ 177{
179 qDebug("ODevice::suspend"); 178 qDebug("ODevice::suspend");
180 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 179 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
181 return false; 180 return false;
182 181
183 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices 182 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
184 return false; 183 return false;
185 184
186 bool res = false; 185 bool res = false;
187 ODevice::sendSuspendmsg(); 186 ODevice::sendSuspendmsg();
188 187
189 struct timeval tvs; 188 struct timeval tvs;
190 ::gettimeofday ( &tvs, 0 ); 189 ::gettimeofday ( &tvs, 0 );
191 190
192 ::sync(); // flush fs caches 191 ::sync(); // flush fs caches
193 res = ( ::system ( "apm --suspend" ) == 0 ); 192 res = ( ::system ( "apm --suspend" ) == 0 );
194 193
195 return res; 194 return res;
196} 195}
197 196
198bool Jornada::setDisplayStatus ( bool on ) 197bool Jornada::setDisplayStatus ( bool on )
199{ 198{
200 bool res = false; 199 bool res = false;
201 200
202 QString cmdline = QString( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); 201 QString cmdline = QString( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" );
203 202
204 res = ( ::system( (const char*) cmdline ) == 0 ); 203 res = ( ::system( (const char*) cmdline ) == 0 );
205 204
206 return res; 205 return res;
207} 206}
208 207