-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 33 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 15 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 4 |
5 files changed, 54 insertions, 6 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 @@ -63,4 +63,27 @@ const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; using namespace Opie::Core; +struct default_button default_buttons [] = { + { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), + "devicebuttons/z_calendar", + "datebook", "nextView()", + "today", "raise()" }, + { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), + "devicebuttons/z_contact", + "addressbook", "raise()", + "addressbook", "beamBusinessCard()" }, + { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), + "devicebuttons/z_home", + "QPE/Launcher", "home()", + "buttonsettings", "raise()" }, + { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), + "devicebuttons/z_menu", + "QPE/TaskBar", "toggleMenu()", + "QPE/TaskBar", "toggleStartMenu()" }, + { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), + "devicebuttons/z_mail", + "opiemail", "raise()", + "opiemail", "newMail()" }, +}; + ODevice *ODevice::inst() { @@ -142,4 +165,14 @@ void ODevice::initButtons() qDebug ( "init Buttons" ); d->m_buttons = new QValueList <ODeviceButton>; + for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { + default_button *db = default_buttons + i; + ODeviceButton b; + b. setKeycode ( db->code ); + b. setUserText ( QObject::tr ( "Button", db->utext )); + b. setPixmap ( Resource::loadPixmap ( db->pix )); + b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); + b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); + d->m_buttons->append ( b ); + } reloadButtonMapping(); diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 5ee9cca..0ba58f0 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h @@ -161,4 +161,19 @@ enum OHingeStatus { }; +/* default button for qvfb or such + * see odevice.cpp for details. + * hint: manage a user defined button for qvfb? + * alwin + */ +struct default_button { + Qt::Key code; + char *utext; + char *pix; + char *fpressedservice; + char *fpressedaction; + char *fheldservice; + char *fheldaction; +}; + /** * A singleton which gives informations about device specefic option diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 2efcd3a..98e2ffa 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp @@ -101,6 +101,6 @@ struct i_button ipaq_buttons [] = { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), "devicebuttons/ipaq_mail", - "mail", "raise()", - "mail", "newMail()" }, + "opiemail", "raise()", + "opiemail", "newMail()" }, { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 7d79ef5..e9481bb 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp @@ -76,6 +76,6 @@ struct s_button simpad_buttons [] = { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), "devicebuttons/simpad_lower_left", - "mail", "raise()", - "mail", "newMail()" }, + "opiemail", "raise()", + "opiemail", "newMail()" }, { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 000d29c..1434e69 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp @@ -76,6 +76,6 @@ struct z_button z_buttons [] = { { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), "devicebuttons/z_mail", - "mail", "raise()", - "mail", "newMail()" }, + "opiemail", "raise()", + "opiemail", "newMail()" }, }; |