summaryrefslogtreecommitdiff
path: root/core
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 /core
parentf6a0af65b96edf63135d2b88c17b8510eebbbd51 (diff)
downloadopie-e2694c5aedb3697a373e363cebe72cddb3114a8f.zip
opie-e2694c5aedb3697a373e363cebe72cddb3114a8f.tar.gz
opie-e2694c5aedb3697a373e363cebe72cddb3114a8f.tar.bz2
fix menu button on zaurus F11 raising opie menu
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp4
-rw-r--r--core/launcher/desktop.h1
-rw-r--r--core/launcher/main.cpp1
3 files changed, 4 insertions, 2 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
@@ -430,102 +430,102 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
{
qpedesktop->checkMemory();
if ( e->type == QWSEvent::Key ) {
QWSKeyEvent * ke = ( QWSKeyEvent * ) e;
if ( !loggedin && ke->simpleData.keycode != Key_F34 )
return TRUE;
bool press = ke->simpleData.is_press;
bool autoRepeat = ke->simpleData.is_auto_repeat;
/*
app that registers key/message to be sent back to the app, when it doesn't have focus,
when user presses key, unless keyboard has been requested from app.
will not send multiple repeats if user holds key
i.e. one shot
*/
if ( !keyRegisterList.isEmpty() && ke->simpleData.keycode !=0 && press) {
// qDebug("<<<<<<<<<<<<<keycode %d", ke->simpleData.keycode);
KeyRegisterList::Iterator it;
for ( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() ) {
if ( press )
qDebug( "press" );
else
qDebug( "release" );
QCopEnvelope( ( *it ).getChannel().utf8(), ( *it ).getMessage().utf8() );
}
}
}
if ( !keyboardGrabbed() ) {
if ( ke->simpleData.keycode == Key_F9 ) {
if ( press )
emit datebook();
return TRUE;
}
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;
}
}
if ( ke->simpleData.keycode == Key_F34 ) {
if ( press )
emit power();
return TRUE;
}
// This was used for the iPAQ PowerButton
// See main.cpp for new KeyboardFilter
//
// if ( ke->simpleData.keycode == Key_SysReq ) {
// if ( press ) emit power();
// return TRUE;
// }
if ( ke->simpleData.keycode == Key_F35 ) {
if ( press )
emit backlight();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F32 ) {
if ( press )
QCopEnvelope e( "QPE/Desktop", "startSync()" );
return TRUE;
}
if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) {
if ( press )
emit symbol();
return TRUE;
}
if ( ke->simpleData.keycode == Key_NumLock ) {
if ( press )
emit numLockStateToggle();
}
if ( ke->simpleData.keycode == Key_CapsLock ) {
if ( press )
emit capsLockStateToggle();
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
@@ -4,96 +4,97 @@
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef __DESKTOP_H__
#define __DESKTOP_H__
#include "shutdownimpl.h"
#include <qpe/qpeapplication.h>
#include <qwidget.h>
#include <qdatetime.h>
class Background;
class Launcher;
class TaskBar;
class PowerStatus;
class QCopBridge;
class TransferServer;
class DesktopPowerAlerter;
class PackageSlave;
class QPEScreenSaver;
class DesktopApplication : public QPEApplication
{
Q_OBJECT
public:
DesktopApplication( int& argc, char **argv, Type t );
~DesktopApplication();
static void switchLCD ( bool on ); // only for togglePower in Desktop
signals:
+ 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 * );
#endif
void shutdown();
void restart();
public slots:
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();
private:
DesktopPowerAlerter *pa;
PowerStatus *ps;
QTimer *cardSendTimer;
QCopChannel *channel;
QPEScreenSaver *m_screensaver;
};
class Desktop : public QWidget
{
Q_OBJECT
public:
Desktop();
~Desktop();
static bool screenLocked();
void show();
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
@@ -46,96 +46,97 @@
#include "../calibrate/calibrate.h"
#endif
using namespace Opie;
void initEnvironment()
{
Config config("locale");
config.setGroup( "Location" );
QString tz = config.readEntry( "Timezone", getenv("TZ") );
// if not timezone set, pick New York
if (tz.isNull())
tz = "America/New_York";
setenv( "TZ", tz, 1 );
config.writeEntry( "Timezone", tz);
config.setGroup( "Language" );
QString lang = config.readEntry( "Language", getenv("LANG") );
if ( !lang.isNull() )
setenv( "LANG", lang, 1 );
}
int initApplication( int argc, char ** argv )
{
initEnvironment();
#if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_EBX)
setenv( "QWS_SIZE", "240x320", 0 );
#endif
//Don't flicker at startup:
QWSServer::setDesktopBackground( QImage() );
DesktopApplication a( argc, argv, QApplication::GuiServer );
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);
Network::createServer(d);
#if defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX)
if ( !QFile::exists( "/etc/pointercal" ) ) {
// Make sure calibration widget starts on top.
Calibrate *cal = new Calibrate;
cal->exec();
delete cal;
}
#endif
d->show();
int rv = a.exec();
delete d;
ODevice::inst ( )-> setSoftSuspend ( false );
return rv;
}
static const char *pidfile_path = "/var/run/opie.pid";
void create_pidfile ( )
{
FILE *f;
if (( f = ::fopen ( pidfile_path, "w" ))) {
::fprintf ( f, "%d", getpid ( ));
::fclose ( f );
}
}
void remove_pidfile ( )
{