summaryrefslogtreecommitdiff
authorchicken <chicken>2005-02-19 07:59:08 (UTC)
committer chicken <chicken>2005-02-19 07:59:08 (UTC)
commiteeb0aa0829b8a1eda5ae567f21d063d4fbfa031e (patch) (side-by-side diff)
tree935dc4f3b63ac2d20a2c1b397cf298518d6e198d
parent42ff7b7515ef2220d3400c468f4cea5828f4faea (diff)
downloadopie-eeb0aa0829b8a1eda5ae567f21d063d4fbfa031e.zip
opie-eeb0aa0829b8a1eda5ae567f21d063d4fbfa031e.tar.gz
opie-eeb0aa0829b8a1eda5ae567f21d063d4fbfa031e.tar.bz2
jornada 720 device updates
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index c7ed4bc..272109b 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -80,119 +80,129 @@ typedef struct {
using namespace Opie::Core;
using namespace Opie::Core::Internal;
struct j_button jornada56x_buttons [] = {
{ Model_Jornada_56x,
Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
"devicebuttons/jornada56x_calendar",
"datebook", "nextView()",
"today", "raise()" },
{ Model_Jornada_56x,
Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
"devicebuttons/jornada56x_contact",
"addressbook", "raise()",
"addressbook", "beamBusinessCard()" },
{ Model_Jornada_56x,
Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Todo Button"),
"devicebuttons/jornada56x_todo",
"todolist", "raise()",
"todolist", "create()" },
{ Model_Jornada_56x,
Qt::Key_F8, QT_TRANSLATE_NOOP("Button", "Home Button"),
"devicebuttons/jornada56x_home",
"QPE/Launcher", "home()",
"buttonsettings", "raise()" },
{ Model_Jornada_56x,
Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Record Button"),
"devicebuttons/jornada56x_record",
"QPE/VMemo", "toggleRecord()",
"sound", "raise()" },
};
void Jornada::init(const QString& cpu_info)
{
d->m_vendorstr = "HP";
d->m_vendor = Vendor_HP;
QString model;
int loc = cpu_info.find( ":" );
if ( loc != -1 )
model = cpu_info.mid( loc+2 ).simplifyWhiteSpace();
else
model = cpu_info;
if ( model == "HP Jornada 56x" ) {
d->m_modelstr = "Jornada 56x";
d->m_model = Model_Jornada_56x;
} else if ( model == "HP Jornada 720" ) {
d->m_modelstr = "Jornada 720";
d->m_model = Model_Jornada_720;
}
d->m_rotation = Rot0; //all Jornadas need this rotation
//Distribution detecting code is now in base class
}
void Jornada::initButtons()
{
if ( d->m_buttons )
return;
d->m_buttons = new QValueList <ODeviceButton>;
for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) {
j_button *ib = jornada56x_buttons + i;
ODeviceButton b;
if (( ib->model & d->m_model ) == d->m_model ) {
b. setKeycode ( ib->code );
b. setUserText ( QObject::tr ( "Button", ib->utext ));
b. setPixmap ( Resource::loadPixmap ( ib->pix ));
b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction ));
b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction ));
d->m_buttons->append ( b );
}
}
reloadButtonMapping();
}
int Jornada::displayBrightnessResolution() const
{
return 255;
}
bool Jornada::setDisplayBrightness( int bright )
{
bool res = false;
if ( bright > 255 )
bright = 255;
if ( bright < 0 )
bright = 0;
QString cmdline;
- if ( !bright )
- cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/*/power");
- else
- cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/*/power; echo %1 > /sys/class/backlight/*/brightness" ).arg( bright );
+ if ( d->m_model == Model_Jornada_56x ) {
+ if ( !bright )
+ cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/sa1100fb/power");
+ else
+ cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/sa1100/power; echo %1 > /sys/class/backlight/sa1100/brightness" ).arg( bright );
+ } else if ( d->m_model == Model_Jornada_720 ) {
+ cmdline = QString::fromLatin1( "echo %1 > /sys/class/backlight/e1356fb/brightness" ).arg( bright );
+ }
// No Global::shellQuote as we gurantee it to be sane
res = ( ::system( QFile::encodeName(cmdline) ) == 0 );
return res;
}
bool Jornada::setDisplayStatus ( bool on )
{
bool res = false;
-
- QString cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/*/power; echo %2 > /sys/class/backlight/*/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" );
+
+ QString cmdline;
+
+ if ( d->m_model == Model_Jornada_56x ) {
+ QString cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/*/power; echo %2 > /sys/class/backlight/*/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" );
+ } else if ( d->m_model == Model_Jornada_720 ) {
+ QString cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/e1356fb/power").arg( on ? "0" : "4" );
+ }
res = ( ::system( QFile::encodeName(cmdline) ) == 0 );
return res;
}