From 7cec3bc3d3b8945e80c9171b9173d3d2dbdd2eaf Mon Sep 17 00:00:00 2001 From: llornkcor Date: Thu, 23 May 2002 02:01:23 +0000 Subject: make sound conform to sharps sense of conf --- 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 @@ -41,9 +41,6 @@ #ifdef QT_QWS_CUSTOM #include "qpe/custom.h" #endif -#if defined(QT_QWS_IPAQ) -#include "qpe/custom-ipaq.h" -#endif #include #include @@ -168,12 +165,11 @@ void DesktopApplication::receive( const QCString &msg, const QByteArray &data ) { 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()"){ @@ -194,14 +190,16 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *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()); + } } } @@ -741,10 +739,15 @@ void Desktop::terminateServers() 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() @@ -766,6 +769,7 @@ void Desktop::screenClick() void Desktop::soundAlarm() { #ifdef CUSTOM_SOUND_ALARM + if (alarmsound) CUSTOM_SOUND_ALARM; #endif } 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 @@ -75,7 +75,7 @@ private: DesktopPowerAlerter *pa; PowerStatus *ps; QTimer *cardSendTimer; - QCopChannel *channel; + QCopChannel *channel; }; @@ -128,7 +128,7 @@ private: PackageSlave *packageSlave; QDateTime suspendTime; - bool keyclick,touchclick; + bool keyclick,touchclick,alarmsound; }; -- cgit v0.9.0.2