summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_jornada.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_jornada.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp3
1 files changed, 0 insertions, 3 deletions
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
@@ -95,99 +95,96 @@ struct j_button jornada56x_buttons [] = {
95 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Todo Button"), 95 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Todo Button"),
96 "devicebuttons/jornada56x_todo", 96 "devicebuttons/jornada56x_todo",
97 "todolist", "raise()", 97 "todolist", "raise()",
98 "todolist", "create()" }, 98 "todolist", "create()" },
99 { Model_Jornada_56x, 99 { Model_Jornada_56x,
100 Qt::Key_F8, QT_TRANSLATE_NOOP("Button", "Home Button"), 100 Qt::Key_F8, QT_TRANSLATE_NOOP("Button", "Home Button"),
101 "devicebuttons/jornada56x_home", 101 "devicebuttons/jornada56x_home",
102 "QPE/Launcher", "home()", 102 "QPE/Launcher", "home()",
103 "buttonsettings", "raise()" }, 103 "buttonsettings", "raise()" },
104 { Model_Jornada_56x, 104 { Model_Jornada_56x,
105 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Record Button"), 105 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Record Button"),
106 "devicebuttons/jornada56x_record", 106 "devicebuttons/jornada56x_record",
107 "QPE/VMemo", "toggleRecord()", 107 "QPE/VMemo", "toggleRecord()",
108 "sound", "raise()" }, 108 "sound", "raise()" },
109}; 109};
110 110
111void Jornada::init(const QString&) 111void Jornada::init(const QString&)
112{ 112{
113 d->m_vendorstr = "HP"; 113 d->m_vendorstr = "HP";
114 d->m_vendor = Vendor_HP; 114 d->m_vendor = Vendor_HP;
115 d->m_modelstr = "Jornada 56x"; 115 d->m_modelstr = "Jornada 56x";
116 d->m_model = Model_Jornada_56x; 116 d->m_model = Model_Jornada_56x;
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
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
170 res = ( ::system( (const char*) cmdline ) == 0 ); 167 res = ( ::system( (const char*) cmdline ) == 0 );
171 168
172 return res; 169 return res;
173} 170}
174 171
175 172
176bool Jornada::suspend( ) 173bool Jornada::suspend( )
177{ 174{
178 qDebug("ODevice::suspend"); 175 qDebug("ODevice::suspend");
179 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 176 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
180 return false; 177 return false;
181 178
182 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices 179 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
183 return false; 180 return false;
184 181
185 bool res = false; 182 bool res = false;
186 ODevice::sendSuspendmsg(); 183 ODevice::sendSuspendmsg();
187 184
188 struct timeval tvs; 185 struct timeval tvs;
189 ::gettimeofday ( &tvs, 0 ); 186 ::gettimeofday ( &tvs, 0 );
190 187
191 ::sync(); // flush fs caches 188 ::sync(); // flush fs caches
192 res = ( ::system ( "apm --suspend" ) == 0 ); 189 res = ( ::system ( "apm --suspend" ) == 0 );
193 190