summaryrefslogtreecommitdiff
authorsandman <sandman>2002-06-18 12:49:05 (UTC)
committer sandman <sandman>2002-06-18 12:49:05 (UTC)
commitc739f74f910b24884279d34836c1f78a97a7e7ae (patch) (side-by-side diff)
tree432c379c30469e2be9117b4895b345e4947e688a
parent61e2f9e5eb634b17ef480d79bdbcbc3a715990cb (diff)
downloadopie-c739f74f910b24884279d34836c1f78a97a7e7ae.zip
opie-c739f74f910b24884279d34836c1f78a97a7e7ae.tar.gz
opie-c739f74f910b24884279d34836c1f78a97a7e7ae.tar.bz2
Replaced OHwInfo with ODevice and ported from custom-*.h #defines to
ODevice methods
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp58
-rw-r--r--core/launcher/main.cpp13
-rw-r--r--core/launcher/taskbar.cpp47
-rw-r--r--core/launcher/taskbar.h4
4 files changed, 53 insertions, 69 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index ab4f14a..7662e48 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -43,6 +43,8 @@
#include <qpe/custom.h>
#endif
+#include <opie/odevice.h>
+
#include <qgfx_qws.h>
#include <qmainwindow.h>
#include <qmessagebox.h>
@@ -267,7 +269,7 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
if ( ke->simpleData.keycode == Key_CapsLock ) {
if ( press ) emit capsLockStateToggle();
}
- if ( press )
+ if (( press && !autoRepeat ) || ( !press && autoRepeat ))
qpedesktop->keyClick();
} else {
if ( e->type == QWSEvent::Mouse ) {
@@ -327,10 +329,6 @@ void DesktopApplication::sendCard()
QPE_MEMALERTER_IMPL
#endif
-#if defined(CUSTOM_SOUND_IMPL)
-CUSTOM_SOUND_IMPL
-#endif
-
//===========================================================================
Desktop::Desktop() :
@@ -339,10 +337,6 @@ Desktop::Desktop() :
transferServer( 0 ),
packageSlave( 0 )
{
-#ifdef CUSTOM_SOUND_INIT
- CUSTOM_SOUND_INIT;
-#endif
-
qpedesktop = this;
// bg = new Info( this );
@@ -756,41 +750,35 @@ void Desktop::rereadVolumes()
void Desktop::keyClick()
{
-#ifdef CUSTOM_SOUND_KEYCLICK
- if ( keyclick )
- CUSTOM_SOUND_KEYCLICK;
-#endif
+ if ( keyclick )
+ ODevice::inst ( )-> keySound ( );
}
void Desktop::screenClick()
{
-#ifdef CUSTOM_SOUND_TOUCH
- if ( touchclick )
- CUSTOM_SOUND_TOUCH;
-#endif
+ if ( touchclick )
+ ODevice::inst ( )-> touchSound ( );
}
void Desktop::soundAlarm()
{
-#ifdef CUSTOM_SOUND_ALARM
- if (qpedesktop->alarmsound)
- CUSTOM_SOUND_ALARM;
-#endif
+ if ( qpedesktop-> alarmsound )
+ ODevice::inst ( )-> alarmSound ( );
}
-bool Desktop::eventFilter( QObject *w, QEvent *ev )
+bool Desktop::eventFilter( QObject *, 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();
- }
- raiseMenu();
- return TRUE;
- }
- }
- return FALSE;
-}
+ 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();
+ raiseMenu ( );
+ return true;
+ }
+ }
+ return false;
+}
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 347eee9..b3c331b 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -29,13 +29,13 @@
#include <qpe/custom.h>
#endif
+#include <opie/odevice.h>
+
#include <qfile.h>
#include <qwindowsystem_qws.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/alarmserver.h>
-#include <opie/ohwinfo.h>
-
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
@@ -193,7 +193,7 @@ public:
{
bool doinst = false;
- m_model = OHwInfo::inst ( )-> model ( );
+ m_model = ODevice::inst ( )-> model ( );
m_power_timer = 0;
switch ( m_model ) {
@@ -208,7 +208,7 @@ public:
QWSServer::setKeyboardFilter ( this );
}
- virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )
+ virtual bool filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat )
{
bool kill = false;
@@ -267,9 +267,8 @@ public:
}
private:
- OHwModel m_model;
- bool m_power_press;
- int m_power_timer;
+ OModel m_model;
+ int m_power_timer;
};
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 5e95c99..e38b9fe 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -37,6 +37,8 @@
#include <qpe/custom.h>
#endif
+#include <opie/odevice.h>
+
#include <qlabel.h>
#include <qlayout.h>
#include <qtimer.h>
@@ -253,29 +255,28 @@ void TaskBar::calcMaxWindowRect()
void TaskBar::receive( const QCString &msg, const QByteArray &data )
{
- QDataStream stream( data, IO_ReadOnly );
- if ( msg == "message(QString)" ) {
- QString text;
- stream >> text;
- setStatusMessage( text );
- } else if ( msg == "hideInputMethod()" ) {
- inputMethods->hideInputMethod();
- } else if ( msg == "showInputMethod()" ) {
- inputMethods->showInputMethod();
- } else if ( msg == "reloadInputMethods()" ) {
- inputMethods->loadInputMethods();
- } else if ( msg == "reloadApplets()" ) {
- sysTray->loadApplets();
- } else if ( msg == "soundAlarm()" ) {
- Desktop::soundAlarm();
- }
-#ifdef CUSTOM_LEDS
- else if ( msg == "setLed(int,bool)" ) {
- int led, status;
- stream >> led >> status;
- CUSTOM_LEDS( led, status );
- }
-#endif
+ QDataStream stream( data, IO_ReadOnly );
+ if ( msg == "message(QString)" ) {
+ QString text;
+ stream >> text;
+ setStatusMessage( text );
+ } else if ( msg == "hideInputMethod()" ) {
+ inputMethods->hideInputMethod();
+ } else if ( msg == "showInputMethod()" ) {
+ inputMethods->showInputMethod();
+ } else if ( msg == "reloadInputMethods()" ) {
+ inputMethods->loadInputMethods();
+ } else if ( msg == "reloadApplets()" ) {
+ sysTray->loadApplets();
+ } else if ( msg == "soundAlarm()" ) {
+ Desktop::soundAlarm();
+ }
+ else if ( msg == "setLed(int,bool)" ) {
+ int led, status;
+ stream >> led >> status;
+
+ ODevice::inst ( )-> setLed ( led, status ? OLED_BlinkSlow : OLED_Off );
+ }
}
QWidget *TaskBar::calibrate(bool)
diff --git a/core/launcher/taskbar.h b/core/launcher/taskbar.h
index 78c4722..40983af 100644
--- a/core/launcher/taskbar.h
+++ b/core/launcher/taskbar.h
@@ -21,10 +21,6 @@
#ifndef __TASKBAR_H__
#define __TASKBAR_H__
-#if defined( QT_QWS_CUSTOM ) || defined( QT_QWS_IPAQ )
-#include <qpe/custom.h>
-#endif
-
#include <qhbox.h>
class QLabel;