author | llornkcor <llornkcor> | 2002-05-23 02:01:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-23 02:01:23 (UTC) |
commit | 7cec3bc3d3b8945e80c9171b9173d3d2dbdd2eaf (patch) (side-by-side diff) | |
tree | 6c196a83ee8688a692e843279dae918960418163 | |
parent | ae177d167999f204a968ea21ae4a4a804d939e6d (diff) | |
download | opie-7cec3bc3d3b8945e80c9171b9173d3d2dbdd2eaf.zip opie-7cec3bc3d3b8945e80c9171b9173d3d2dbdd2eaf.tar.gz opie-7cec3bc3d3b8945e80c9171b9173d3d2dbdd2eaf.tar.bz2 |
make sound conform to sharps sense of conf
-rw-r--r-- | core/launcher/desktop.cpp | 24 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 |
2 files changed, 15 insertions, 11 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 649862b..6771a66 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -32,27 +32,24 @@ #include <qpe/applnk.h> #include <qpe/mimetype.h> #include <qpe/password.h> #include <qpe/config.h> #include <qpe/power.h> #include <qpe/timeconversion.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/global.h> #ifdef QT_QWS_CUSTOM #include "qpe/custom.h" #endif -#if defined(QT_QWS_IPAQ) -#include "qpe/custom-ipaq.h" -#endif #include <qgfx_qws.h> #include <qmainwindow.h> #include <qmessagebox.h> #include <qtimer.h> #include <qwindowsystem_qws.h> #include <qvaluelist.h> #include <stdlib.h> #include <unistd.h> @@ -159,30 +156,29 @@ DesktopApplication::~DesktopApplication() { delete ps; delete pa; } void DesktopApplication::receive( const QCString &msg, const QByteArray &data ) { QDataStream stream( data, IO_ReadOnly ); if (msg == "keyRegister(int key, QString channel, QString message)") { int k; QString c, m; - stream >> k; stream >> c; stream >> m; - qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m); + qWarning("KeyRegisterReceived: %i, %s, %s", k, (const char*)c, (const char *)m ); keyRegisterList.append(QCopKeyRegister(k,c,m)); } else if (msg == "suspend()"){ emit power(); } } enum MemState { Unknown, VeryLow, Low, Normal } memstate=Unknown; #ifdef Q_WS_QWS bool DesktopApplication::qwsEventFilter( QWSEvent *e ) @@ -191,28 +187,30 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 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; if (!keyRegisterList.isEmpty()) { KeyRegisterList::Iterator it; for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { - if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat) + if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat) { + 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(); @@ -732,49 +730,55 @@ void Desktop::timerEvent( QTimerEvent *e ) } void Desktop::terminateServers() { delete transferServer; delete qcopBridge; transferServer = 0; qcopBridge = 0; } void Desktop::rereadVolumes() { - Config cfg("Sound"); - cfg.setGroup("System"); - touchclick = cfg.readBoolEntry("Touch"); - keyclick = cfg.readBoolEntry("Key"); + Config cfg("qpe"); + cfg.setGroup("Volume"); + touchclick = cfg.readBoolEntry("TouchSound"); + keyclick = cfg.readBoolEntry("KeySound"); + alarmsound = cfg.readBoolEntry("AlarmSound"); +// Config cfg("Sound"); +// cfg.setGroup("System"); +// touchclick = cfg.readBoolEntry("Touch"); +// keyclick = cfg.readBoolEntry("Key"); } void Desktop::keyClick() { #ifdef CUSTOM_SOUND_KEYCLICK if ( keyclick ) CUSTOM_SOUND_KEYCLICK; #endif } void Desktop::screenClick() { #ifdef CUSTOM_SOUND_TOUCH if ( touchclick ) CUSTOM_SOUND_TOUCH; #endif } void Desktop::soundAlarm() { #ifdef CUSTOM_SOUND_ALARM + if (alarmsound) CUSTOM_SOUND_ALARM; #endif } bool Desktop::eventFilter( QObject *w, QEvent *ev ) { if ( ev->type() == QEvent::KeyPress ) { QKeyEvent *ke = (QKeyEvent *)ev; if ( ke->key() == Qt::Key_F11 ) { // menu key QWidget *active = qApp->activeWindow(); if ( active && active->isPopup() ) { active->close(); diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index e094dc0..9bc4be9 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h @@ -119,18 +119,18 @@ protected: Launcher *launcher; TaskBar *tb; private: void startTransferServer(); bool recoverMemory(); QCopBridge *qcopBridge; TransferServer *transferServer; PackageSlave *packageSlave; QDateTime suspendTime; - bool keyclick,touchclick; + bool keyclick,touchclick,alarmsound; }; #endif // __DESKTOP_H__ |