summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-29 13:18:26 (UTC)
committer harlekin <harlekin>2002-08-29 13:18:26 (UTC)
commit4eb76f825e6dd06252316f4fe682d6ec4c7a1a2f (patch) (side-by-side diff)
tree037a96053aff72cc0e708f80f11570599b28c156
parent178bd471d12a88862fb4ac1a17842ea0fd63c160 (diff)
downloadopie-4eb76f825e6dd06252316f4fe682d6ec4c7a1a2f.zip
opie-4eb76f825e6dd06252316f4fe682d6ec4c7a1a2f.tar.gz
opie-4eb76f825e6dd06252316f4fe682d6ec4c7a1a2f.tar.bz2
fixed hardware start keys to be more flexible
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 1ec477c..5aba8dd 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -483,95 +483,95 @@ void Desktop::raiseLauncher()
void Desktop::executeOrModify(const QString& appLnkFile)
{
AppLnk lnk(MimeType::appsFolderName() + "/" + appLnkFile);
if ( lnk.isValid() ) {
QCString app = lnk.exec().utf8();
Global::terminateBuiltin("calibrate");
if ( QCopChannel::isRegistered("QPE/Application/" + app) ) {
MRUList::addTask(&lnk);
if ( hasVisibleWindow(app) )
QCopChannel::send("QPE/Application/" + app, "nextView()");
else
QCopChannel::send("QPE/Application/" + app, "raise()");
} else {
lnk.execute();
}
}
}
void Desktop::raiseDatebook()
{
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 {
+ if ( tempItem == "Calender" || tempItem.isEmpty() ) {
+ tempItem = "datebook";
+ }
QCopEnvelope e("QPE/System","execute(QString)");
e << tempItem;
}
-}
void Desktop::raiseContacts()
{
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 {
+ if ( tempItem == "Address Book" || tempItem.isEmpty() ) {
+ tempItem = "addressbook";
+ }
QCopEnvelope e("QPE/System","execute(QString)");
e << tempItem;
}
-}
void Desktop::raiseMenu()
{
- Config cfg("qpe"); //F11, 'Menu'
+ 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()
{
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 {
+ if ( tempItem == "Mail" || tempItem == "qtmail" || tempItem.isEmpty() ) {
+ tempItem = "mail";
+ }
QCopEnvelope e("QPE/System","execute(QString)");
e << tempItem;
}
-}
// autoStarts apps on resume and start
void Desktop::execAutoStart() {
QString appName;
int delay;
QDateTime now = QDateTime::currentDateTime();
Config cfg( "autostart" );
cfg.setGroup( "AutoStart" );
appName = cfg.readEntry( "Apps", "" );
delay = ( cfg.readEntry( "Delay", "0" ) ).toInt();
// If the time between suspend and resume was longer then the
// value saved as delay, start the app
if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) {
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << QString( appName );
}
}
#if defined(QPE_HAVE_TOGGLELIGHT)
#include <qpe/config.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <fcntl.h>