summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp22
-rw-r--r--core/launcher/server.h7
2 files changed, 28 insertions, 1 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 15cd686..921b790 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -32,24 +32,26 @@
#include "shutdownimpl.h"
#include "applauncher.h"
#if 0
#include "suspendmonitor.h"
#endif
#include "documentlist.h"
#include "qrr.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/odevicebutton.h>
#include <opie2/odevice.h>
+#include <opie2/oprocess.h>
+
#include <qtopia/applnk.h>
#include <qtopia/private/categories.h>
#include <qtopia/mimetype.h>
#include <qtopia/config.h>
#include <qtopia/resource.h>
#include <qtopia/version.h>
#include <qtopia/storage.h>
#include <qtopia/qcopenvelope_qws.h>
#include <qtopia/global.h>
using namespace Opie::Core;
/* QT */
@@ -124,25 +126,26 @@ extern const char *directAccessQueueFile();
#endif
//---------------------------------------------------------------------------
//===========================================================================
Server::Server() :
QWidget( 0, 0, WStyle_Tool | WStyle_Customize ),
qcopBridge( 0 ),
transferServer( 0 ),
packageHandler( 0 ),
- syncDialog( 0 )
+ syncDialog( 0 ),
+ process( 0 )
{
Global::setBuiltinCommands(builtins);
tid_xfer = 0;
/* ### FIXME ### */
/* tid_today = startTimer(3600*2*1000);*/
last_today_show = QDate::currentDate();
#warning FIXME support TempScreenSaverMode
#if 0
tsmMonitor = new TempScreenSaverMode();
connect( tsmMonitor, SIGNAL(forceSuspend()), qApp, SIGNAL(power()) );
@@ -158,24 +161,26 @@ Server::Server() :
connect(appLauncher, SIGNAL(connected(const QString&)), this, SLOT(applicationConnected(const QString&)) );
storage = new StorageInfo( this );
connect( storage, SIGNAL(disksChanged()), this, SLOT(storageChanged()) );
#ifdef QPE_HAVE_DIRECT_ACCESS
QCopChannel *desktopChannel = new QCopChannel( "QPE/Desktop", this );
connect( desktopChannel, SIGNAL(received( const QCString &, const QByteArray & )),
this, SLOT(desktopMessage( const QCString &, const QByteArray & )) );
#endif
+ soundServerExited();
+
// start services
startTransferServer();
(void) new IrServer( this );
packageHandler = new PackageHandler( this );
connect(qApp, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)),
this,SLOT(activate(const Opie::Core::ODeviceButton*,bool)));
setGeometry( -10, -10, 9, 9 );
QCopChannel *channel = new QCopChannel("QPE/System", this);
connect(channel, SIGNAL(received(const QCString&,const QByteArray&)),
@@ -975,12 +980,27 @@ void Server::finishedQueuedRequests()
syncDialog = 0;
}
#warning FIXME support TempScreenSaverMode
#if 0
QPEApplication::setTempScreenSaverMode(QPEApplication::Enable);
#endif
} else {
qrr->readyToDelete = TRUE;
QTimer::singleShot( 0, this, SLOT(finishedQueuedRequests()) );
}
}
+void Server::startSoundServer() {
+ if ( !process ) {
+ process = new Opie::Core::OProcess( this );
+ connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
+ SLOT(soundServerExited()));
+ }
+
+ process->clearArguments();
+ *process << QPEApplication::qpeDir() + "bin/qss";
+ process->start();
+}
+
+void Server::soundServerExited() {
+ QTimer::singleShot(5000, this, SLOT(startSoundServer()));
+}
diff --git a/core/launcher/server.h b/core/launcher/server.h
index d71d68a..5b2f995 100644
--- a/core/launcher/server.h
+++ b/core/launcher/server.h
@@ -32,46 +32,51 @@ class PackageHandler;
class ServiceRequest;
class TempScreenSaverMonitor;
class AppLauncher;
class AppLnkSet;
class StorageInfo;
class SyncDialog;
class DocumentList;
class ServerInterface;
class QueuedRequestRunner;
namespace Opie {
namespace Core {
class ODeviceButton;
+ class OProcess;
}
}
class Server : public QWidget {
Q_OBJECT
public:
Server();
~Server();
static bool mkdir(const QString &path);
void show();
static bool setKeyboardLayout( const QString &kb );
public slots:
void systemMsg(const QCString &, const QByteArray &);
void receiveTaskBar(const QCString &msg, const QByteArray &data);
void terminateServers();
void pokeTimeMonitors();
private slots:
+ //@{
+ void startSoundServer();
+ void soundServerExited();
+ //@}
void activate(const Opie::Core::ODeviceButton*,bool);
void syncConnectionClosed( const QHostAddress & );
void applicationLaunched(int pid, const QString &app);
void applicationTerminated(int pid, const QString &app);
void applicationConnected(const QString &app);
void storageChanged();
void cancelSync();
void desktopMessage( const QCString &, const QByteArray & );
void runDirectAccess();
void finishedQueuedRequests();
protected:
@@ -95,17 +100,19 @@ private:
/* ### FIXME two below### */
// int tid_today;
// TempScreenSaverMonitor *tsmMonitor;
StorageInfo *storage;
SyncDialog *syncDialog;
AppLauncher *appLauncher;
DocumentList *docList;
ServerInterface *serverGui;
int pendingFlushes;
bool directAccessRun;
QueuedRequestRunner *qrr;
+
+ Opie::Core::OProcess *process;
};
#endif // DESKTOP_H