summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-04 02:55:56 (UTC)
committer llornkcor <llornkcor>2002-04-04 02:55:56 (UTC)
commit431ff3f7fd9996236c6d82a3644b3915bd4c7b38 (patch) (side-by-side diff)
tree693e873c51efc5c43cfa7ebd5dd0755fb254500a
parente18dab7b6b00ad3ba8117666998de6db52257bdb (diff)
downloadopie-431ff3f7fd9996236c6d82a3644b3915bd4c7b38.zip
opie-431ff3f7fd9996236c6d82a3644b3915bd4c7b38.tar.gz
opie-431ff3f7fd9996236c6d82a3644b3915bd4c7b38.tar.bz2
added support for configuring with AppKeys, F9 - F13 (Zaurus' cover buttons)
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp48
1 files changed, 45 insertions, 3 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 64043e7..cf33011 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -454,20 +454,29 @@ static bool hasVisibleWindow(const QString& clientname)
if ( w->client()->identity() == clientname && !w->isFullyObscured() )
return TRUE;
}
return FALSE;
}
void Desktop::raiseLauncher()
{
+ Config cfg("qpe"); //F12 'Home'
+ cfg.setGroup("AppsKey");
+ QString tempItem;
+ tempItem = cfg.readEntry("Middle","Home");
+ if(tempItem == "Home" || tempItem.isEmpty()) {
if ( isVisibleWindow(launcher->winId()) )
launcher->nextView();
else
launcher->raise();
+ } else {
+ QCopEnvelope e("QPE/System","execute(QString)");
+ e << tempItem;
+ }
}
void Desktop::executeOrModify(const QString& appLnkFile)
{
AppLnk lnk(MimeType::appsFolderName() + "/" + appLnkFile);
if ( lnk.isValid() ) {
QCString app = lnk.exec().utf8();
Global::terminateBuiltin("calibrate");
@@ -480,33 +489,66 @@ void Desktop::executeOrModify(const QString& appLnkFile)
} else {
lnk.execute();
}
}
}
void Desktop::raiseDatebook()
{
- executeOrModify("Applications/datebook.desktop");
+ Config cfg("qpe"); //F9 'Activity'
+ cfg.setGroup("AppsKey");
+ QString tempItem;
+ tempItem = cfg.readEntry("LeftEnd","Calender");
+ if(tempItem == "Calender" || tempItem.isEmpty()) executeOrModify("Applications/datebook.desktop");
+ else {
+ QCopEnvelope e("QPE/System","execute(QString)");
+ e << tempItem;
+ }
}
void Desktop::raiseContacts()
{
- executeOrModify("Applications/addressbook.desktop");
+ Config cfg("qpe"); //F10, 'Contacts'
+ cfg.setGroup("AppsKey");
+ QString tempItem;
+ tempItem = cfg.readEntry("Left2nd","Address Book");
+ if(tempItem == "Address Book" || tempItem.isEmpty()) executeOrModify("Applications/addressbook.desktop");
+ else {
+ QCopEnvelope e("QPE/System","execute(QString)");
+ e << tempItem;
+ }
}
void Desktop::raiseMenu()
{
+ Config cfg("qpe"); //F11, 'Menu'
+ cfg.setGroup("AppsKey");
+ QString tempItem;
+ tempItem = cfg.readEntry("Right2nd","Popup Menu");
+ if(tempItem == "Popup Menu" || tempItem.isEmpty()) {
Global::terminateBuiltin("calibrate");
tb->startMenu()->launch();
+ } else {
+ QCopEnvelope e("QPE/System","execute(QString)");
+ e << tempItem;
+ }
}
void Desktop::raiseEmail()
{
- executeOrModify("Applications/qtmail.desktop");
+ Config cfg("qpe"); //F13, 'Mail'
+ cfg.setGroup("AppsKey");
+ QString tempItem;
+ tempItem = cfg.readEntry("RightEnd","Mail");
+ if(tempItem == "Mail" || tempItem == "qtmail" || tempItem.isEmpty()) executeOrModify("Applications/qtmail.desktop");
+ else {
+ QCopEnvelope e("QPE/System","execute(QString)");
+ e << tempItem;
+ }
}
// autoStarts apps on resume and start
void Desktop::execAutoStart()
{
QString appName;
Config cfg( "autostart" );
cfg.setGroup( "AutoStart" );