summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_jornada.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_jornada.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp59
1 files changed, 56 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index 75c9fc5..526f9cb 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -78,6 +78,35 @@ typedef struct {
78#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) 78#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN )
79 79
80using namespace Opie::Core;
80using namespace Opie::Core::Internal; 81using namespace Opie::Core::Internal;
81 82
83struct j_button jornada56x_buttons [] = {
84 { Model_Jornada_56x,
85 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
86 "devicebuttons/jornada56x_calendar",
87 "datebook", "nextView()",
88 "today", "raise()" },
89 { Model_Jornada_56x,
90 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
91 "devicebuttons/jornada56x_contact",
92 "addressbook", "raise()",
93 "addressbook", "beamBusinessCard()" },
94 { Model_Jornada_56x,
95 Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Todo Button"),
96 "devicebuttons/jornada56x_todo",
97 "todolist", "raise()",
98 "todolist", "create()" },
99 { Model_Jornada_56x,
100 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Home Button"),
101 "devicebuttons/jornada56x_home",
102 "QPE/Launcher", "home()",
103 "buttonsettings", "raise()" },
104 { Model_Jornada_56x,
105 Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Record Button"),
106 "devicebuttons/jornada56x_record",
107 "QPE/VMemo", "toggleRecord()",
108 "sound", "raise()" },
109};
110
82void Jornada::init(const QString&) 111void Jornada::init(const QString&)
83{ 112{
@@ -101,4 +130,30 @@ void Jornada::init(const QString&)
101} 130}
102 131
132void Jornada::initButtons()
133{
134 if ( d->m_buttons )
135 return;
136
137 d->m_buttons = new QValueList <ODeviceButton>;
138
139 for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) {
140 j_button *ib = jornada56x_buttons + i;
141 ODeviceButton b;
142
143 if (( ib->model & d->m_model ) == d->m_model ) {
144 b. setKeycode ( ib->code );
145 b. setUserText ( QObject::tr ( "Button", ib->utext ));
146 b. setPixmap ( Resource::loadPixmap ( ib->pix ));
147 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction ));
148 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction ));
149
150 d->m_buttons->append ( b );
151 }
152 }
153 reloadButtonMapping();
154
155 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
156 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
157}
103 158
104int Jornada::displayBrightnessResolution() const 159int Jornada::displayBrightnessResolution() const
@@ -111,5 +166,4 @@ bool Jornada::setDisplayBrightness( int bright )
111{ 166{
112 bool res = false; 167 bool res = false;
113 int fd;
114 168
115 if ( bright > 255 ) 169 if ( bright > 255 )
@@ -144,5 +198,5 @@ bool Jornada::suspend( )
144 ODevice::sendSuspendmsg(); 198 ODevice::sendSuspendmsg();
145 199
146 struct timeval tvs, tvn; 200 struct timeval tvs;
147 ::gettimeofday ( &tvs, 0 ); 201 ::gettimeofday ( &tvs, 0 );
148 202
@@ -156,5 +210,4 @@ bool Jornada::setDisplayStatus ( bool on )
156{ 210{
157 bool res = false; 211 bool res = false;
158 int fd;
159 212
160 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 ? "1" : "0",on ? "1" : "0" );