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 /core/launcher/desktop.cpp | |
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 | 28 |
1 files changed, 16 insertions, 12 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 @@ -38,15 +38,12 @@ #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> @@ -165,18 +162,17 @@ 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(); } @@ -191,20 +187,22 @@ 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; + 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) - QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8()); + 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(); @@ -738,16 +736,21 @@ void Desktop::terminateServers() 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 ) @@ -763,12 +766,13 @@ void Desktop::screenClick() #endif } void Desktop::soundAlarm() { #ifdef CUSTOM_SOUND_ALARM + if (alarmsound) CUSTOM_SOUND_ALARM; #endif } bool Desktop::eventFilter( QObject *w, QEvent *ev ) { |