-rw-r--r-- | core/launcher/server.cpp | 22 | ||||
-rw-r--r-- | core/launcher/server.h | 7 |
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 | |||
@@ -36,16 +36,18 @@ | |||
36 | #endif | 36 | #endif |
37 | #include "documentlist.h" | 37 | #include "documentlist.h" |
38 | #include "qrr.h" | 38 | #include "qrr.h" |
39 | 39 | ||
40 | /* OPIE */ | 40 | /* OPIE */ |
41 | #include <opie2/odebug.h> | 41 | #include <opie2/odebug.h> |
42 | #include <opie2/odevicebutton.h> | 42 | #include <opie2/odevicebutton.h> |
43 | #include <opie2/odevice.h> | 43 | #include <opie2/odevice.h> |
44 | #include <opie2/oprocess.h> | ||
45 | |||
44 | #include <qtopia/applnk.h> | 46 | #include <qtopia/applnk.h> |
45 | #include <qtopia/private/categories.h> | 47 | #include <qtopia/private/categories.h> |
46 | #include <qtopia/mimetype.h> | 48 | #include <qtopia/mimetype.h> |
47 | #include <qtopia/config.h> | 49 | #include <qtopia/config.h> |
48 | #include <qtopia/resource.h> | 50 | #include <qtopia/resource.h> |
49 | #include <qtopia/version.h> | 51 | #include <qtopia/version.h> |
50 | #include <qtopia/storage.h> | 52 | #include <qtopia/storage.h> |
51 | #include <qtopia/qcopenvelope_qws.h> | 53 | #include <qtopia/qcopenvelope_qws.h> |
@@ -128,17 +130,18 @@ extern const char *directAccessQueueFile(); | |||
128 | 130 | ||
129 | //=========================================================================== | 131 | //=========================================================================== |
130 | 132 | ||
131 | Server::Server() : | 133 | Server::Server() : |
132 | QWidget( 0, 0, WStyle_Tool | WStyle_Customize ), | 134 | QWidget( 0, 0, WStyle_Tool | WStyle_Customize ), |
133 | qcopBridge( 0 ), | 135 | qcopBridge( 0 ), |
134 | transferServer( 0 ), | 136 | transferServer( 0 ), |
135 | packageHandler( 0 ), | 137 | packageHandler( 0 ), |
136 | syncDialog( 0 ) | 138 | syncDialog( 0 ), |
139 | process( 0 ) | ||
137 | { | 140 | { |
138 | Global::setBuiltinCommands(builtins); | 141 | Global::setBuiltinCommands(builtins); |
139 | 142 | ||
140 | tid_xfer = 0; | 143 | tid_xfer = 0; |
141 | /* ### FIXME ### */ | 144 | /* ### FIXME ### */ |
142 | /* tid_today = startTimer(3600*2*1000);*/ | 145 | /* tid_today = startTimer(3600*2*1000);*/ |
143 | last_today_show = QDate::currentDate(); | 146 | last_today_show = QDate::currentDate(); |
144 | 147 | ||
@@ -162,16 +165,18 @@ Server::Server() : | |||
162 | 165 | ||
163 | 166 | ||
164 | #ifdef QPE_HAVE_DIRECT_ACCESS | 167 | #ifdef QPE_HAVE_DIRECT_ACCESS |
165 | QCopChannel *desktopChannel = new QCopChannel( "QPE/Desktop", this ); | 168 | QCopChannel *desktopChannel = new QCopChannel( "QPE/Desktop", this ); |
166 | connect( desktopChannel, SIGNAL(received( const QCString &, const QByteArray & )), | 169 | connect( desktopChannel, SIGNAL(received( const QCString &, const QByteArray & )), |
167 | this, SLOT(desktopMessage( const QCString &, const QByteArray & )) ); | 170 | this, SLOT(desktopMessage( const QCString &, const QByteArray & )) ); |
168 | #endif | 171 | #endif |
169 | 172 | ||
173 | soundServerExited(); | ||
174 | |||
170 | // start services | 175 | // start services |
171 | startTransferServer(); | 176 | startTransferServer(); |
172 | (void) new IrServer( this ); | 177 | (void) new IrServer( this ); |
173 | 178 | ||
174 | packageHandler = new PackageHandler( this ); | 179 | packageHandler = new PackageHandler( this ); |
175 | connect(qApp, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)), | 180 | connect(qApp, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)), |
176 | this,SLOT(activate(const Opie::Core::ODeviceButton*,bool))); | 181 | this,SLOT(activate(const Opie::Core::ODeviceButton*,bool))); |
177 | 182 | ||
@@ -979,8 +984,23 @@ void Server::finishedQueuedRequests() | |||
979 | QPEApplication::setTempScreenSaverMode(QPEApplication::Enable); | 984 | QPEApplication::setTempScreenSaverMode(QPEApplication::Enable); |
980 | #endif | 985 | #endif |
981 | } else { | 986 | } else { |
982 | qrr->readyToDelete = TRUE; | 987 | qrr->readyToDelete = TRUE; |
983 | QTimer::singleShot( 0, this, SLOT(finishedQueuedRequests()) ); | 988 | QTimer::singleShot( 0, this, SLOT(finishedQueuedRequests()) ); |
984 | } | 989 | } |
985 | } | 990 | } |
986 | 991 | ||
992 | void Server::startSoundServer() { | ||
993 | if ( !process ) { | ||
994 | process = new Opie::Core::OProcess( this ); | ||
995 | connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), | ||
996 | SLOT(soundServerExited())); | ||
997 | } | ||
998 | |||
999 | process->clearArguments(); | ||
1000 | *process << QPEApplication::qpeDir() + "bin/qss"; | ||
1001 | process->start(); | ||
1002 | } | ||
1003 | |||
1004 | void Server::soundServerExited() { | ||
1005 | QTimer::singleShot(5000, this, SLOT(startSoundServer())); | ||
1006 | } | ||
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 | |||
@@ -36,16 +36,17 @@ class AppLnkSet; | |||
36 | class StorageInfo; | 36 | class StorageInfo; |
37 | class SyncDialog; | 37 | class SyncDialog; |
38 | class DocumentList; | 38 | class DocumentList; |
39 | class ServerInterface; | 39 | class ServerInterface; |
40 | class QueuedRequestRunner; | 40 | class QueuedRequestRunner; |
41 | namespace Opie { | 41 | namespace Opie { |
42 | namespace Core { | 42 | namespace Core { |
43 | class ODeviceButton; | 43 | class ODeviceButton; |
44 | class OProcess; | ||
44 | } | 45 | } |
45 | } | 46 | } |
46 | 47 | ||
47 | class Server : public QWidget { | 48 | class Server : public QWidget { |
48 | Q_OBJECT | 49 | Q_OBJECT |
49 | public: | 50 | public: |
50 | Server(); | 51 | Server(); |
51 | ~Server(); | 52 | ~Server(); |
@@ -58,16 +59,20 @@ public: | |||
58 | 59 | ||
59 | public slots: | 60 | public slots: |
60 | void systemMsg(const QCString &, const QByteArray &); | 61 | void systemMsg(const QCString &, const QByteArray &); |
61 | void receiveTaskBar(const QCString &msg, const QByteArray &data); | 62 | void receiveTaskBar(const QCString &msg, const QByteArray &data); |
62 | void terminateServers(); | 63 | void terminateServers(); |
63 | void pokeTimeMonitors(); | 64 | void pokeTimeMonitors(); |
64 | 65 | ||
65 | private slots: | 66 | private slots: |
67 | //@{ | ||
68 | void startSoundServer(); | ||
69 | void soundServerExited(); | ||
70 | //@} | ||
66 | void activate(const Opie::Core::ODeviceButton*,bool); | 71 | void activate(const Opie::Core::ODeviceButton*,bool); |
67 | void syncConnectionClosed( const QHostAddress & ); | 72 | void syncConnectionClosed( const QHostAddress & ); |
68 | void applicationLaunched(int pid, const QString &app); | 73 | void applicationLaunched(int pid, const QString &app); |
69 | void applicationTerminated(int pid, const QString &app); | 74 | void applicationTerminated(int pid, const QString &app); |
70 | void applicationConnected(const QString &app); | 75 | void applicationConnected(const QString &app); |
71 | void storageChanged(); | 76 | void storageChanged(); |
72 | void cancelSync(); | 77 | void cancelSync(); |
73 | void desktopMessage( const QCString &, const QByteArray & ); | 78 | void desktopMessage( const QCString &, const QByteArray & ); |
@@ -99,13 +104,15 @@ private: | |||
99 | SyncDialog *syncDialog; | 104 | SyncDialog *syncDialog; |
100 | AppLauncher *appLauncher; | 105 | AppLauncher *appLauncher; |
101 | DocumentList *docList; | 106 | DocumentList *docList; |
102 | ServerInterface *serverGui; | 107 | ServerInterface *serverGui; |
103 | 108 | ||
104 | int pendingFlushes; | 109 | int pendingFlushes; |
105 | bool directAccessRun; | 110 | bool directAccessRun; |
106 | QueuedRequestRunner *qrr; | 111 | QueuedRequestRunner *qrr; |
112 | |||
113 | Opie::Core::OProcess *process; | ||
107 | }; | 114 | }; |
108 | 115 | ||
109 | 116 | ||
110 | #endif // DESKTOP_H | 117 | #endif // DESKTOP_H |
111 | 118 | ||