author | alwin <alwin> | 2004-04-22 11:47:08 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-22 11:47:08 (UTC) |
commit | a95b0c46820c2e9e76598cf430ce279eeba7edb8 (patch) (side-by-side diff) | |
tree | da8073f4a2b4041db0f7ef1cb3ae5e6eb8cb9019 /libopie2/opiecore/device | |
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
-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 @@ -62,6 +62,29 @@ 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() { static ODevice *dev = 0; @@ -141,6 +164,16 @@ 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 @@ -160,6 +160,21 @@ enum OHingeStatus { CASE_UNKNOWN = 1, }; +/* 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 * like the Hardware used, LEDs, the Base Distribution and 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 @@ -100,8 +100,8 @@ struct i_button ipaq_buttons [] = { { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, 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"), "devicebuttons/ipaq_home", 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 @@ -75,8 +75,8 @@ struct s_button simpad_buttons [] = { { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 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, Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), 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 @@ -75,8 +75,8 @@ struct z_button z_buttons [] = { "QPE/TaskBar", "toggleStartMenu()" }, { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), "devicebuttons/z_mail", - "mail", "raise()", - "mail", "newMail()" }, + "opiemail", "raise()", + "opiemail", "newMail()" }, }; struct z_button z_buttons_c700 [] = { |