summaryrefslogtreecommitdiff
path: root/core/launcher/server.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/server.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp22
1 files changed, 21 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
@@ -20,48 +20,50 @@
#include "server.h"
#include "serverapp.h"
#include "startmenu.h"
#include "launcher.h"
#include "transferserver.h"
#include "qcopbridge.h"
#include "irserver.h"
#include "packageslave.h"
#include "calibrate.h"
#include "qrsync.h"
#include "syncdialog.h"
#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 */
#include <qmainwindow.h>
#include <qmessagebox.h>
#include <qtimer.h>
#include <qtextstream.h>
#include <qwindowsystem_qws.h>
#include <qgfx_qws.h>
/* STD */
#include <unistd.h>
#include <stdlib.h>
extern QRect qt_maxWindowRect;
@@ -112,82 +114,85 @@ static Global::Command builtins[] = {
#endif
#if !defined(OPIE_NO_BUILTIN_SHUTDOWN)
{ "shutdown", Global::shutdown, 1, 0 }, // No tr
// { "run", run, 1, 0 }, // No tr
#endif
{ 0, calibrate, 0, 0 },
};
#ifdef QPE_HAVE_DIRECT_ACCESS
extern void readyDirectAccess(QString cardInfo, QString installLocations);
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()) );
#endif
serverGui = new Launcher;
serverGui->createGUI();
docList = new DocumentList( serverGui );
appLauncher = new AppLauncher(this);
connect(appLauncher, SIGNAL(launched(int,const QString&)), this, SLOT(applicationLaunched(int,const QString&)) );
connect(appLauncher, SIGNAL(terminated(int,const QString&)), this, SLOT(applicationTerminated(int,const QString&)) );
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&)),
this, SLOT(systemMsg(const QCString&,const QByteArray&)) );
QCopChannel *tbChannel = new QCopChannel( "QPE/TaskBar", this );
connect( tbChannel, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(receiveTaskBar(const QCString&,const QByteArray&)) );
connect( qApp, SIGNAL(prepareForRestart()), this, SLOT(terminateServers()) );
connect( qApp, SIGNAL(timeChanged()), this, SLOT(pokeTimeMonitors()) );
preloadApps();
}
@@ -963,24 +968,39 @@ void Server::postDirectAccess()
}
#endif
}
void Server::finishedQueuedRequests()
{
if ( qrr->readyToDelete ) {
delete qrr;
qrr = 0;
// Get rid of the dialog
if ( syncDialog ) {
delete syncDialog;
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()));
+}