summaryrefslogtreecommitdiff
path: root/noncore
authorkorovkin <korovkin>2006-04-29 16:53:24 (UTC)
committer korovkin <korovkin>2006-04-29 16:53:24 (UTC)
commitb91d3399fbd3178085e9d0fc5faeefbe31c674b7 (patch) (side-by-side diff)
tree979c7b2c1af8bd31230d3c75b0d40e013a1ea75f /noncore
parent17191b7ae7929568b9ed87a427e2eaeb28377a00 (diff)
downloadopie-b91d3399fbd3178085e9d0fc5faeefbe31c674b7.zip
opie-b91d3399fbd3178085e9d0fc5faeefbe31c674b7.tar.gz
opie-b91d3399fbd3178085e9d0fc5faeefbe31c674b7.tar.bz2
Disable screensaver when running BT gateway.
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 13954c5..58f97fa 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -29,12 +29,16 @@
/* OPIE */
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <opie2/odebug.h>
+#ifdef Q_WS_QWS
+#include <qpe/qcopenvelope_qws.h>
+#endif
+
using namespace Opie::Core;
/* QT */
#include <qframe.h>
#include <qlabel.h>
#include <qpushbutton.h>
@@ -685,12 +689,20 @@ void BlueBase::setInfo()
/**
* Decontructor
*/
BlueBase::~BlueBase()
{
writeSavedDevices();
+ if (forwarder) {
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)" )
+ << QPEApplication::Enable;
+#endif
+ delete forwarder;
+ forwarder = NULL;
+ }
delete m_iconLoader;
}
/**
* find searches the ListView for a BTDeviceItem containig
@@ -735,19 +747,27 @@ void BlueBase::doForward()
if (forwarder->start(OProcess::NotifyOnExit) < 0) {
QMessageBox::critical(this, tr("Forwarder Error"),
tr("Forwarder start error:") + tr(strerror(errno)));
return;
}
runButton->setText("stop gateway");
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)")
+ << QPEApplication::DisableSuspend;
+#endif
}
/**
* React on the process end
*/
void BlueBase::forwardExit(Opie::Core::OProcess* proc)
{
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)" )
+ << QPEApplication::Enable;
+#endif
if (proc->exitStatus() != 0)
QMessageBox::critical(this, tr("Forwarder Error"),
tr("Forwarder start error"));
delete proc;
forwarder = NULL;
runButton->setText("start gateway");