author | alwin <alwin> | 2004-04-22 11:47:08 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-22 11:47:08 (UTC) |
commit | a95b0c46820c2e9e76598cf430ce279eeba7edb8 (patch) (unidiff) | |
tree | da8073f4a2b4041db0f7ef1cb3ae5e6eb8cb9019 /libopie2/opiecore/device/odevice.cpp | |
parent | 2a950511ee173c2cbce5da4d14de9cea6fcd5034 (diff) | |
download | opie-a95b0c46820c2e9e76598cf430ce279eeba7edb8.zip opie-a95b0c46820c2e9e76598cf430ce279eeba7edb8.tar.gz opie-a95b0c46820c2e9e76598cf430ce279eeba7edb8.tar.bz2 |
-added default buttons for emulation in qvfb or for unknown devices
-default email app is now opiemail instead of mail
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index ee66d95..62a2e03 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -59,12 +59,35 @@ _;:, .> :=|. This program is free software; you can | |||
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; | 61 | const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; |
62 | 62 | ||
63 | using namespace Opie::Core; | 63 | using namespace Opie::Core; |
64 | 64 | ||
65 | struct default_button default_buttons [] = { | ||
66 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | ||
67 | "devicebuttons/z_calendar", | ||
68 | "datebook", "nextView()", | ||
69 | "today", "raise()" }, | ||
70 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | ||
71 | "devicebuttons/z_contact", | ||
72 | "addressbook", "raise()", | ||
73 | "addressbook", "beamBusinessCard()" }, | ||
74 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | ||
75 | "devicebuttons/z_home", | ||
76 | "QPE/Launcher", "home()", | ||
77 | "buttonsettings", "raise()" }, | ||
78 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | ||
79 | "devicebuttons/z_menu", | ||
80 | "QPE/TaskBar", "toggleMenu()", | ||
81 | "QPE/TaskBar", "toggleStartMenu()" }, | ||
82 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | ||
83 | "devicebuttons/z_mail", | ||
84 | "opiemail", "raise()", | ||
85 | "opiemail", "newMail()" }, | ||
86 | }; | ||
87 | |||
65 | ODevice *ODevice::inst() | 88 | ODevice *ODevice::inst() |
66 | { | 89 | { |
67 | static ODevice *dev = 0; | 90 | static ODevice *dev = 0; |
68 | 91 | ||
69 | // rewrite this to only use /proc/cpuinfo or so | 92 | // rewrite this to only use /proc/cpuinfo or so |
70 | 93 | ||
@@ -138,12 +161,22 @@ void ODevice::initButtons() | |||
138 | { | 161 | { |
139 | if ( d->m_buttons ) | 162 | if ( d->m_buttons ) |
140 | return; | 163 | return; |
141 | 164 | ||
142 | qDebug ( "init Buttons" ); | 165 | qDebug ( "init Buttons" ); |
143 | d->m_buttons = new QValueList <ODeviceButton>; | 166 | d->m_buttons = new QValueList <ODeviceButton>; |
167 | for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { | ||
168 | default_button *db = default_buttons + i; | ||
169 | ODeviceButton b; | ||
170 | b. setKeycode ( db->code ); | ||
171 | b. setUserText ( QObject::tr ( "Button", db->utext )); | ||
172 | b. setPixmap ( Resource::loadPixmap ( db->pix )); | ||
173 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); | ||
174 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); | ||
175 | d->m_buttons->append ( b ); | ||
176 | } | ||
144 | 177 | ||
145 | reloadButtonMapping(); | 178 | reloadButtonMapping(); |
146 | 179 | ||
147 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 180 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
148 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); | 181 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
149 | } | 182 | } |