summaryrefslogtreecommitdiff
authorzecke <zecke>2004-02-21 23:26:23 (UTC)
committer zecke <zecke>2004-02-21 23:26:23 (UTC)
commit7595c4c5e1004efb0b4a3f6dcbd4d2baf7b9c8ac (patch) (side-by-side diff)
treea3fb948d40018eb43c2541d602607b0db7d1fe47
parented771f43dee91ffd1a260581187c7d50453f70ef (diff)
downloadopie-7595c4c5e1004efb0b4a3f6dcbd4d2baf7b9c8ac.zip
opie-7595c4c5e1004efb0b4a3f6dcbd4d2baf7b9c8ac.tar.gz
opie-7595c4c5e1004efb0b4a3f6dcbd4d2baf7b9c8ac.tar.bz2
Randomly jumping in the vtable is fun :)
use libopie2 odevice
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/serverapp.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index e18bcee..11381e6 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -1,47 +1,47 @@
/**********************************************************************
** Copyright (C) 2000-2003 Trolltech AS. All rights reserved.
**
** This file is part of the 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.
**
**********************************************************************/
#include "serverapp.h"
-#include <opie/odevice.h>
+#include <opie2/odevice.h>
#include <qtopia/password.h>
#include <qtopia/config.h>
#include <qtopia/power.h>
#ifdef Q_WS_QWS
#include <qtopia/qcopenvelope_qws.h>
#endif
#include <qtopia/global.h>
//#include <qtopia/custom.h>
#ifdef Q_WS_QWS
#include <qgfx_qws.h>
#endif
#ifdef Q_OS_WIN32
#include <io.h>
#include <process.h>
#else
#include <unistd.h>
#endif
#include <qmessagebox.h>
#include <qtimer.h>
#include <qpainter.h>
#include <qfile.h>
@@ -348,80 +348,80 @@ ServerApplication::ServerApplication( int& argc, char **argv, Type t )
/* make sure the event filter is installed */
const Opie::ODeviceButton* but = Opie::ODevice::inst()->buttonForKeycode( -1 );
}
ServerApplication::~ServerApplication()
{
ungrabKeyboard();
delete pa;
delete m_ps;
delete m_ps_last;
}
void ServerApplication::apmTimeout() {
serverApp-> checkMemory( ); // in case no events are generated
*m_ps_last = *m_ps;
*m_ps = PowerStatusManager::readStatus();
if ( m_ps->acStatus() != m_ps_last-> acStatus() )
m_screensaver-> powerStatusChanged( *m_ps );
- if ( m_ps->acStatus() == PowerStatus::Online ) {
+ if ( m_ps->acStatus() == PowerStatus::Online ) {
return;
}
-
+
int bat = m_ps-> batteryPercentRemaining();
if ( bat < m_ps_last-> batteryPercentRemaining() ) {
if ( bat <= m_powerCritical ) {
QMessageBox battlow(
tr("WARNING"),
tr("<p>The battery level is critical!"
"<p>Keep power off until AC is restored"),
QMessageBox::Warning,
QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton,
0, QString::null, TRUE, WStyle_StaysOnTop);
battlow.setButtonText(QMessageBox::Cancel, tr("Ok"));
- battlow.exec();
+ battlow.exec();
} else if ( bat <= m_powerVeryLow )
pa->alert( tr( "The battery is running very low. "), 2 );
}
-
+
if ( m_ps-> backupBatteryStatus() == PowerStatus::VeryLow ) {
QMessageBox battlow(
tr("WARNING"),
tr("<p>The Back-up battery is very low"
"<p>Please charge the back-up battery"),
QMessageBox::Warning,
QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton,
0, QString::null, TRUE, WStyle_StaysOnTop);
battlow.setButtonText(QMessageBox::Cancel, tr("Ok"));
- battlow.exec();
- }
+ battlow.exec();
+ }
}
void ServerApplication::systemMessage( const QCString& msg,
const QByteArray& data ) {
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "setScreenSaverInterval(int)" ) {
int time;
stream >> time;
m_screensaver-> setInterval( time );
}
else if ( msg == "setScreenSaverIntervals(int,int,int)" ) {
int t1, t2, t3;
stream >> t1 >> t2 >> t3;
m_screensaver-> setIntervals( t1, t2, t3 );
}
else if ( msg == "setBacklight(int)" ) {
int bright;
stream >> bright;
m_screensaver-> setBacklight( bright );
}
else if ( msg == "setScreenSaverMode(int)" ) {
int mode;
stream >> mode;
@@ -805,46 +805,46 @@ void ServerApplication::checkMemory()
QMessageBox::information ( 0 , tr("Memory Status"),
"Memory OK" );
}
break;
case MemVeryLow:
memstate = MemUnknown;
QMessageBox::critical( 0 , tr("Memory Status"),
tr("Critical Memory Shortage\n"
"Please end this application\n"
"immediately.") );
recoverMemory();
}
existingMessage = FALSE;
#endif
}
bool ServerApplication::recoverMemory()
{
return FALSE;
}
void ServerApplication::keyClick(int , bool press, bool )
{
if ( press && m_keyclick_sound )
- ODevice::inst() -> keySound();
+ ODevice::inst() -> playKeySound();
}
void ServerApplication::screenClick(bool press)
{
if ( press && m_screentap_sound )
- ODevice::inst() -> touchSound();
+ ODevice::inst() -> playTouchSound();
}
void ServerApplication::soundAlarm() {
if ( me ()->m_alarm_sound )
- ODevice::inst()->alarmSound();
+ ODevice::inst()->playAlarmSound();
}
ServerApplication *ServerApplication::me ( )
{
return static_cast<ServerApplication*>( qApp );
}
#include "serverapp.moc"