summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-10-20 04:30:34 (UTC)
committer llornkcor <llornkcor>2002-10-20 04:30:34 (UTC)
commite2694c5aedb3697a373e363cebe72cddb3114a8f (patch) (side-by-side diff)
tree5ba5910a40cfc151e01a956c609f1bdd0243668e
parentf6a0af65b96edf63135d2b88c17b8510eebbbd51 (diff)
downloadopie-e2694c5aedb3697a373e363cebe72cddb3114a8f.zip
opie-e2694c5aedb3697a373e363cebe72cddb3114a8f.tar.gz
opie-e2694c5aedb3697a373e363cebe72cddb3114a8f.tar.bz2
fix menu button on zaurus F11 raising opie menu
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp10
-rw-r--r--core/launcher/desktop.h131
-rw-r--r--core/launcher/main.cpp1
3 files changed, 72 insertions, 70 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 3546e28..9863187 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -405,27 +405,27 @@ void DesktopApplication::systemMessage( const QCString & msg, const QByteArray &
}
else if ( msg == "setBacklight(int)" ) {
int bright;
stream >> bright;
m_screensaver-> setBacklight( bright );
}
else if ( msg == "setScreenSaverMode(int)" ) {
int mode;
stream >> mode;
m_screensaver-> setMode ( mode );
}
else if ( msg == "setDisplayState(int)" ) {
- int state;
- stream >> state;
- m_screensaver-> setDisplayState ( state != 0 );
+ int state;
+ stream >> state;
+ m_screensaver-> setDisplayState ( state != 0 );
}
else if ( msg == "suspend()" ) {
emit power();
}
}
enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown;
#ifdef Q_WS_QWS
bool DesktopApplication::qwsEventFilter( QWSEvent *e )
{
qpedesktop->checkMemory();
@@ -466,30 +466,30 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
if ( ke->simpleData.keycode == Key_F10 ) {
if ( !press && cardSendTimer ) {
emit contacts();
delete cardSendTimer;
}
else if ( press ) {
cardSendTimer = new QTimer();
cardSendTimer->start( 2000, TRUE );
connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) );
}
return TRUE;
}
- /* menu key now opens application menu/toolbar
+// menu key now opens application menu/toolbar
if ( ke->simpleData.keycode == Key_F11 ) {
if ( press ) emit menu();
return TRUE;
}
- */
+
if ( ke->simpleData.keycode == Key_F12 ) {
while ( activePopupWidget() )
activePopupWidget() ->close();
if ( press )
emit launch();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F13 ) {
if ( press )
emit email();
return TRUE;
}
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h
index 09ffe1c..5de85f4 100644
--- a/core/launcher/desktop.h
+++ b/core/launcher/desktop.h
@@ -32,115 +32,116 @@
class Background;
class Launcher;
class TaskBar;
class PowerStatus;
class QCopBridge;
class TransferServer;
class DesktopPowerAlerter;
class PackageSlave;
class QPEScreenSaver;
class DesktopApplication : public QPEApplication
{
- Q_OBJECT
+ Q_OBJECT
public:
- DesktopApplication( int& argc, char **argv, Type t );
- ~DesktopApplication();
+ DesktopApplication( int& argc, char **argv, Type t );
+ ~DesktopApplication();
- static void switchLCD ( bool on ); // only for togglePower in Desktop
+ static void switchLCD ( bool on ); // only for togglePower in Desktop
signals:
- void home();
- void datebook();
- void contacts();
- void launch();
- void email();
- void backlight();
- void power();
- void symbol();
- void numLockStateToggle();
- void capsLockStateToggle();
- void prepareForRestart();
+ void menu();
+ void home();
+ void datebook();
+ void contacts();
+ void launch();
+ void email();
+ void backlight();
+ void power();
+ void symbol();
+ void numLockStateToggle();
+ void capsLockStateToggle();
+ void prepareForRestart();
protected:
#ifdef Q_WS_QWS
- bool qwsEventFilter( QWSEvent * );
+ bool qwsEventFilter( QWSEvent * );
#endif
- void shutdown();
- void restart();
+ void shutdown();
+ void restart();
public slots:
- virtual void desktopMessage ( const QCString &msg, const QByteArray &data );
- virtual void systemMessage ( const QCString &msg, const QByteArray &data );
+ virtual void desktopMessage ( const QCString &msg, const QByteArray &data );
+ virtual void systemMessage ( const QCString &msg, const QByteArray &data );
protected slots:
- void shutdown( ShutdownImpl::Type );
- void psTimeout();
- void sendCard();
+ void shutdown( ShutdownImpl::Type );
+ void psTimeout();
+ void sendCard();
private:
- DesktopPowerAlerter *pa;
- PowerStatus *ps;
- QTimer *cardSendTimer;
- QCopChannel *channel;
- QPEScreenSaver *m_screensaver;
+ DesktopPowerAlerter *pa;
+ PowerStatus *ps;
+ QTimer *cardSendTimer;
+ QCopChannel *channel;
+ QPEScreenSaver *m_screensaver;
};
class Desktop : public QWidget
{
- Q_OBJECT
+ Q_OBJECT
public:
- Desktop();
- ~Desktop();
+ Desktop();
+ ~Desktop();
- static bool screenLocked();
+ static bool screenLocked();
- void show();
- void checkMemory();
+ void show();
+ void checkMemory();
- void keyClick();
- void screenClick();
- static void soundAlarm();
+ void keyClick();
+ void screenClick();
+ static void soundAlarm();
public slots:
- void raiseDatebook();
- void raiseContacts();
- void raiseMenu();
- void raiseLauncher();
- void raiseEmail();
- void execAutoStart();
- void togglePower();
- void toggleLight();
- void toggleNumLockState();
- void toggleCapsLockState();
- void toggleSymbolInput();
- void terminateServers();
- void rereadVolumes();
-
- void home ( );
+ void raiseDatebook();
+ void raiseContacts();
+ void raiseMenu();
+ void raiseLauncher();
+ void raiseEmail();
+ void execAutoStart();
+ void togglePower();
+ void toggleLight();
+ void toggleNumLockState();
+ void toggleCapsLockState();
+ void toggleSymbolInput();
+ void terminateServers();
+ void rereadVolumes();
+
+ void home ( );
protected:
- void executeOrModify( const QString& appLnkFile );
- void styleChange( QStyle & );
- void timerEvent( QTimerEvent *e );
+ void executeOrModify( const QString& appLnkFile );
+ void styleChange( QStyle & );
+ void timerEvent( QTimerEvent *e );
- QWidget *bg;
- Launcher *launcher;
- TaskBar *tb;
+ QWidget *bg;
+ Launcher *launcher;
+ TaskBar *tb;
private:
- void startTransferServer();
- bool recoverMemory();
+ void startTransferServer();
+ bool recoverMemory();
- QCopBridge *qcopBridge;
- TransferServer *transferServer;
- PackageSlave *packageSlave;
+ QCopBridge *qcopBridge;
+ TransferServer *transferServer;
+ PackageSlave *packageSlave;
- QDateTime suspendTime;
- bool keyclick, touchclick, alarmsound;
+ QDateTime suspendTime;
+ bool keyclick, touchclick, alarmsound;
};
#endif // __DESKTOP_H__
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 762a596..8974ced 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -82,24 +82,25 @@ int initApplication( int argc, char ** argv )
ODevice::inst ( )-> setSoftSuspend ( true );
{ // init backlight
QCopEnvelope e("QPE/System", "setBacklight(int)" );
e << -3; // Forced on
}
AlarmServer::initialize();
Desktop *d = new Desktop();
+ QObject::connect( &a, SIGNAL(menu()), d, SLOT(raiseMenu()) );
QObject::connect( &a, SIGNAL(datebook()), d, SLOT(raiseDatebook()) );
QObject::connect( &a, SIGNAL(contacts()), d, SLOT(raiseContacts()) );
QObject::connect( &a, SIGNAL(launch()), d, SLOT(raiseLauncher()) );
QObject::connect( &a, SIGNAL(email()), d, SLOT(raiseEmail()) );
QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) );
QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) );
QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) );
QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) );
QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) );
QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) );
(void)new SysFileMonitor(d);