-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 | |||
@@ -1,233 +1,238 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "server.h" | 21 | #include "server.h" |
22 | #include "serverapp.h" | 22 | #include "serverapp.h" |
23 | #include "startmenu.h" | 23 | #include "startmenu.h" |
24 | #include "launcher.h" | 24 | #include "launcher.h" |
25 | #include "transferserver.h" | 25 | #include "transferserver.h" |
26 | #include "qcopbridge.h" | 26 | #include "qcopbridge.h" |
27 | #include "irserver.h" | 27 | #include "irserver.h" |
28 | #include "packageslave.h" | 28 | #include "packageslave.h" |
29 | #include "calibrate.h" | 29 | #include "calibrate.h" |
30 | #include "qrsync.h" | 30 | #include "qrsync.h" |
31 | #include "syncdialog.h" | 31 | #include "syncdialog.h" |
32 | #include "shutdownimpl.h" | 32 | #include "shutdownimpl.h" |
33 | #include "applauncher.h" | 33 | #include "applauncher.h" |
34 | #if 0 | 34 | #if 0 |
35 | #include "suspendmonitor.h" | 35 | #include "suspendmonitor.h" |
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> |
52 | #include <qtopia/global.h> | 54 | #include <qtopia/global.h> |
53 | using namespace Opie::Core; | 55 | using namespace Opie::Core; |
54 | 56 | ||
55 | /* QT */ | 57 | /* QT */ |
56 | #include <qmainwindow.h> | 58 | #include <qmainwindow.h> |
57 | #include <qmessagebox.h> | 59 | #include <qmessagebox.h> |
58 | #include <qtimer.h> | 60 | #include <qtimer.h> |
59 | #include <qtextstream.h> | 61 | #include <qtextstream.h> |
60 | #include <qwindowsystem_qws.h> | 62 | #include <qwindowsystem_qws.h> |
61 | #include <qgfx_qws.h> | 63 | #include <qgfx_qws.h> |
62 | 64 | ||
63 | /* STD */ | 65 | /* STD */ |
64 | #include <unistd.h> | 66 | #include <unistd.h> |
65 | #include <stdlib.h> | 67 | #include <stdlib.h> |
66 | 68 | ||
67 | extern QRect qt_maxWindowRect; | 69 | extern QRect qt_maxWindowRect; |
68 | 70 | ||
69 | static QWidget *calibrate(bool) | 71 | static QWidget *calibrate(bool) |
70 | { | 72 | { |
71 | #ifdef Q_WS_QWS | 73 | #ifdef Q_WS_QWS |
72 | Calibrate *c = new Calibrate; | 74 | Calibrate *c = new Calibrate; |
73 | c->show(); | 75 | c->show(); |
74 | return c; | 76 | return c; |
75 | #else | 77 | #else |
76 | return 0; | 78 | return 0; |
77 | #endif | 79 | #endif |
78 | } | 80 | } |
79 | 81 | ||
80 | #define FACTORY(T) \ | 82 | #define FACTORY(T) \ |
81 | static QWidget *new##T( bool maximized ) { \ | 83 | static QWidget *new##T( bool maximized ) { \ |
82 | QWidget *w = new T( 0, 0, QWidget::WDestructiveClose | QWidget::WGroupLeader ); \ | 84 | QWidget *w = new T( 0, 0, QWidget::WDestructiveClose | QWidget::WGroupLeader ); \ |
83 | if ( maximized ) { \ | 85 | if ( maximized ) { \ |
84 | if ( qApp->desktop()->width() <= 350 ) { \ | 86 | if ( qApp->desktop()->width() <= 350 ) { \ |
85 | w->showMaximized(); \ | 87 | w->showMaximized(); \ |
86 | } else { \ | 88 | } else { \ |
87 | w->resize( QSize( 300, 300 ) ); \ | 89 | w->resize( QSize( 300, 300 ) ); \ |
88 | } \ | 90 | } \ |
89 | } \ | 91 | } \ |
90 | w->show(); \ | 92 | w->show(); \ |
91 | return w; \ | 93 | return w; \ |
92 | } | 94 | } |
93 | 95 | ||
94 | 96 | ||
95 | #ifdef SINGLE_APP | 97 | #ifdef SINGLE_APP |
96 | #define APP(a,b,c,d) FACTORY(b) | 98 | #define APP(a,b,c,d) FACTORY(b) |
97 | #include "apps.h" | 99 | #include "apps.h" |
98 | #undef APP | 100 | #undef APP |
99 | #endif // SINGLE_APP | 101 | #endif // SINGLE_APP |
100 | 102 | ||
101 | static Global::Command builtins[] = { | 103 | static Global::Command builtins[] = { |
102 | 104 | ||
103 | #ifdef SINGLE_APP | 105 | #ifdef SINGLE_APP |
104 | #define APP(a,b,c,d) { a, new##b, c, d }, | 106 | #define APP(a,b,c,d) { a, new##b, c, d }, |
105 | #include "apps.h" | 107 | #include "apps.h" |
106 | #undef APP | 108 | #undef APP |
107 | #endif | 109 | #endif |
108 | 110 | ||
109 | /* FIXME defines need to be defined*/ | 111 | /* FIXME defines need to be defined*/ |
110 | #if !defined(OPIE_NO_BUILTIN_CALIBRATE) | 112 | #if !defined(OPIE_NO_BUILTIN_CALIBRATE) |
111 | { "calibrate", calibrate, 1, 0 }, // No tr | 113 | { "calibrate", calibrate, 1, 0 }, // No tr |
112 | #endif | 114 | #endif |
113 | #if !defined(OPIE_NO_BUILTIN_SHUTDOWN) | 115 | #if !defined(OPIE_NO_BUILTIN_SHUTDOWN) |
114 | { "shutdown", Global::shutdown, 1, 0 }, // No tr | 116 | { "shutdown", Global::shutdown, 1, 0 }, // No tr |
115 | // { "run", run, 1, 0 }, // No tr | 117 | // { "run", run, 1, 0 }, // No tr |
116 | #endif | 118 | #endif |
117 | 119 | ||
118 | { 0, calibrate, 0, 0 }, | 120 | { 0, calibrate, 0, 0 }, |
119 | }; | 121 | }; |
120 | 122 | ||
121 | #ifdef QPE_HAVE_DIRECT_ACCESS | 123 | #ifdef QPE_HAVE_DIRECT_ACCESS |
122 | extern void readyDirectAccess(QString cardInfo, QString installLocations); | 124 | extern void readyDirectAccess(QString cardInfo, QString installLocations); |
123 | extern const char *directAccessQueueFile(); | 125 | extern const char *directAccessQueueFile(); |
124 | #endif | 126 | #endif |
125 | 127 | ||
126 | //--------------------------------------------------------------------------- | 128 | //--------------------------------------------------------------------------- |
127 | 129 | ||
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 | ||
145 | #warning FIXME support TempScreenSaverMode | 148 | #warning FIXME support TempScreenSaverMode |
146 | #if 0 | 149 | #if 0 |
147 | tsmMonitor = new TempScreenSaverMode(); | 150 | tsmMonitor = new TempScreenSaverMode(); |
148 | connect( tsmMonitor, SIGNAL(forceSuspend()), qApp, SIGNAL(power()) ); | 151 | connect( tsmMonitor, SIGNAL(forceSuspend()), qApp, SIGNAL(power()) ); |
149 | #endif | 152 | #endif |
150 | 153 | ||
151 | serverGui = new Launcher; | 154 | serverGui = new Launcher; |
152 | serverGui->createGUI(); | 155 | serverGui->createGUI(); |
153 | 156 | ||
154 | docList = new DocumentList( serverGui ); | 157 | docList = new DocumentList( serverGui ); |
155 | appLauncher = new AppLauncher(this); | 158 | appLauncher = new AppLauncher(this); |
156 | connect(appLauncher, SIGNAL(launched(int,const QString&)), this, SLOT(applicationLaunched(int,const QString&)) ); | 159 | connect(appLauncher, SIGNAL(launched(int,const QString&)), this, SLOT(applicationLaunched(int,const QString&)) ); |
157 | connect(appLauncher, SIGNAL(terminated(int,const QString&)), this, SLOT(applicationTerminated(int,const QString&)) ); | 160 | connect(appLauncher, SIGNAL(terminated(int,const QString&)), this, SLOT(applicationTerminated(int,const QString&)) ); |
158 | connect(appLauncher, SIGNAL(connected(const QString&)), this, SLOT(applicationConnected(const QString&)) ); | 161 | connect(appLauncher, SIGNAL(connected(const QString&)), this, SLOT(applicationConnected(const QString&)) ); |
159 | 162 | ||
160 | storage = new StorageInfo( this ); | 163 | storage = new StorageInfo( this ); |
161 | connect( storage, SIGNAL(disksChanged()), this, SLOT(storageChanged()) ); | 164 | connect( storage, SIGNAL(disksChanged()), this, SLOT(storageChanged()) ); |
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 | ||
178 | setGeometry( -10, -10, 9, 9 ); | 183 | setGeometry( -10, -10, 9, 9 ); |
179 | 184 | ||
180 | QCopChannel *channel = new QCopChannel("QPE/System", this); | 185 | QCopChannel *channel = new QCopChannel("QPE/System", this); |
181 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&)), | 186 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&)), |
182 | this, SLOT(systemMsg(const QCString&,const QByteArray&)) ); | 187 | this, SLOT(systemMsg(const QCString&,const QByteArray&)) ); |
183 | 188 | ||
184 | QCopChannel *tbChannel = new QCopChannel( "QPE/TaskBar", this ); | 189 | QCopChannel *tbChannel = new QCopChannel( "QPE/TaskBar", this ); |
185 | connect( tbChannel, SIGNAL(received(const QCString&,const QByteArray&)), | 190 | connect( tbChannel, SIGNAL(received(const QCString&,const QByteArray&)), |
186 | this, SLOT(receiveTaskBar(const QCString&,const QByteArray&)) ); | 191 | this, SLOT(receiveTaskBar(const QCString&,const QByteArray&)) ); |
187 | 192 | ||
188 | connect( qApp, SIGNAL(prepareForRestart()), this, SLOT(terminateServers()) ); | 193 | connect( qApp, SIGNAL(prepareForRestart()), this, SLOT(terminateServers()) ); |
189 | connect( qApp, SIGNAL(timeChanged()), this, SLOT(pokeTimeMonitors()) ); | 194 | connect( qApp, SIGNAL(timeChanged()), this, SLOT(pokeTimeMonitors()) ); |
190 | 195 | ||
191 | preloadApps(); | 196 | preloadApps(); |
192 | } | 197 | } |
193 | 198 | ||
194 | void Server::show() | 199 | void Server::show() |
195 | { | 200 | { |
196 | ServerApplication::login(TRUE); | 201 | ServerApplication::login(TRUE); |
197 | QWidget::show(); | 202 | QWidget::show(); |
198 | } | 203 | } |
199 | 204 | ||
200 | Server::~Server() | 205 | Server::~Server() |
201 | { | 206 | { |
202 | serverGui->destroyGUI(); | 207 | serverGui->destroyGUI(); |
203 | delete docList; | 208 | delete docList; |
204 | delete qcopBridge; | 209 | delete qcopBridge; |
205 | delete transferServer; | 210 | delete transferServer; |
206 | delete serverGui; | 211 | delete serverGui; |
207 | #if 0 | 212 | #if 0 |
208 | delete tsmMonitor; | 213 | delete tsmMonitor; |
209 | #endif | 214 | #endif |
210 | } | 215 | } |
211 | 216 | ||
212 | 217 | ||
213 | static bool hasVisibleWindow(const QString& clientname, bool partial) | 218 | static bool hasVisibleWindow(const QString& clientname, bool partial) |
214 | { | 219 | { |
215 | #ifdef QWS | 220 | #ifdef QWS |
216 | const QList<QWSWindow> &list = qwsServer->clientWindows(); | 221 | const QList<QWSWindow> &list = qwsServer->clientWindows(); |
217 | QWSWindow* w; | 222 | QWSWindow* w; |
218 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { | 223 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { |
219 | if ( w->client()->identity() == clientname ) { | 224 | if ( w->client()->identity() == clientname ) { |
220 | if ( partial && !w->isFullyObscured() ) | 225 | if ( partial && !w->isFullyObscured() ) |
221 | return TRUE; | 226 | return TRUE; |
222 | if ( !partial && !w->isFullyObscured() && !w->isPartiallyObscured() ) { | 227 | if ( !partial && !w->isFullyObscured() && !w->isPartiallyObscured() ) { |
223 | # if QT_VERSION < 0x030000 | 228 | # if QT_VERSION < 0x030000 |
224 | QRect mwr = qt_screen->mapToDevice(qt_maxWindowRect, | 229 | QRect mwr = qt_screen->mapToDevice(qt_maxWindowRect, |
225 | QSize(qt_screen->width(),qt_screen->height()) ); | 230 | QSize(qt_screen->width(),qt_screen->height()) ); |
226 | # else | 231 | # else |
227 | QRect mwr = qt_maxWindowRect; | 232 | QRect mwr = qt_maxWindowRect; |
228 | # endif | 233 | # endif |
229 | if ( mwr.contains(w->requested().boundingRect()) ) | 234 | if ( mwr.contains(w->requested().boundingRect()) ) |
230 | return TRUE; | 235 | return TRUE; |
231 | } | 236 | } |
232 | } | 237 | } |
233 | } | 238 | } |
@@ -923,64 +928,79 @@ void Server::postDirectAccess() | |||
923 | { | 928 | { |
924 | #ifdef QPE_HAVE_DIRECT_ACCESS | 929 | #ifdef QPE_HAVE_DIRECT_ACCESS |
925 | qDebug( "Server::postDirectAccess()" ); | 930 | qDebug( "Server::postDirectAccess()" ); |
926 | 931 | ||
927 | // Categories may have changed | 932 | // Categories may have changed |
928 | QCopEnvelope e1( "QPE/System", "categoriesChanged()" ); | 933 | QCopEnvelope e1( "QPE/System", "categoriesChanged()" ); |
929 | // Apps need to reload their data | 934 | // Apps need to reload their data |
930 | QCopEnvelope e2( "QPE/System", "reload()" ); | 935 | QCopEnvelope e2( "QPE/System", "reload()" ); |
931 | // Reload DocLinks | 936 | // Reload DocLinks |
932 | docList->storageChanged(); | 937 | docList->storageChanged(); |
933 | // Restart the PDA server stuff | 938 | // Restart the PDA server stuff |
934 | startTransferServer(); | 939 | startTransferServer(); |
935 | 940 | ||
936 | // restart the mtab monitor | 941 | // restart the mtab monitor |
937 | #ifndef QT_NO_COP | 942 | #ifndef QT_NO_COP |
938 | { | 943 | { |
939 | QCopEnvelope e( "QPE/Stabmon", "restartMonitor()" ); | 944 | QCopEnvelope e( "QPE/Stabmon", "restartMonitor()" ); |
940 | } | 945 | } |
941 | #endif | 946 | #endif |
942 | 947 | ||
943 | // Process queued requests | 948 | // Process queued requests |
944 | const char *queueFile = ::directAccessQueueFile(); | 949 | const char *queueFile = ::directAccessQueueFile(); |
945 | QFile *file = new QFile( queueFile ); | 950 | QFile *file = new QFile( queueFile ); |
946 | if ( !file->exists() ) { | 951 | if ( !file->exists() ) { |
947 | delete file; | 952 | delete file; |
948 | // Get rid of the dialog | 953 | // Get rid of the dialog |
949 | if ( syncDialog ) { | 954 | if ( syncDialog ) { |
950 | delete syncDialog; | 955 | delete syncDialog; |
951 | syncDialog = 0; | 956 | syncDialog = 0; |
952 | } | 957 | } |
953 | #warning FIXME support TempScreenSaverMode | 958 | #warning FIXME support TempScreenSaverMode |
954 | #if 0 | 959 | #if 0 |
955 | QPEApplication::setTempScreenSaverMode(QPEApplication::Enable); | 960 | QPEApplication::setTempScreenSaverMode(QPEApplication::Enable); |
956 | #endif | 961 | #endif |
957 | } else { | 962 | } else { |
958 | qrr = new QueuedRequestRunner( file, syncDialog ); | 963 | qrr = new QueuedRequestRunner( file, syncDialog ); |
959 | connect( qrr, SIGNAL(finished()), | 964 | connect( qrr, SIGNAL(finished()), |
960 | this, SLOT(finishedQueuedRequests()) ); | 965 | this, SLOT(finishedQueuedRequests()) ); |
961 | QTimer::singleShot( 100, qrr, SLOT(process()) ); | 966 | QTimer::singleShot( 100, qrr, SLOT(process()) ); |
962 | // qrr will remove the sync dialog later | 967 | // qrr will remove the sync dialog later |
963 | } | 968 | } |
964 | #endif | 969 | #endif |
965 | } | 970 | } |
966 | 971 | ||
967 | void Server::finishedQueuedRequests() | 972 | void Server::finishedQueuedRequests() |
968 | { | 973 | { |
969 | if ( qrr->readyToDelete ) { | 974 | if ( qrr->readyToDelete ) { |
970 | delete qrr; | 975 | delete qrr; |
971 | qrr = 0; | 976 | qrr = 0; |
972 | // Get rid of the dialog | 977 | // Get rid of the dialog |
973 | if ( syncDialog ) { | 978 | if ( syncDialog ) { |
974 | delete syncDialog; | 979 | delete syncDialog; |
975 | syncDialog = 0; | 980 | syncDialog = 0; |
976 | } | 981 | } |
977 | #warning FIXME support TempScreenSaverMode | 982 | #warning FIXME support TempScreenSaverMode |
978 | #if 0 | 983 | #if 0 |
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 | |||
@@ -1,111 +1,118 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef DESKTOP_H | 20 | #ifndef DESKTOP_H |
21 | #define DESKTOP_H | 21 | #define DESKTOP_H |
22 | 22 | ||
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | #include <qdatetime.h> | 24 | #include <qdatetime.h> |
25 | 25 | ||
26 | //#include "qcopbridge.h" | 26 | //#include "qcopbridge.h" |
27 | 27 | ||
28 | class QCopBridge; | 28 | class QCopBridge; |
29 | class QHostAddress; | 29 | class QHostAddress; |
30 | class TransferServer; | 30 | class TransferServer; |
31 | class PackageHandler; | 31 | class PackageHandler; |
32 | class ServiceRequest; | 32 | class ServiceRequest; |
33 | class TempScreenSaverMonitor; | 33 | class TempScreenSaverMonitor; |
34 | class AppLauncher; | 34 | class AppLauncher; |
35 | class AppLnkSet; | 35 | 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(); |
52 | 53 | ||
53 | static bool mkdir(const QString &path); | 54 | static bool mkdir(const QString &path); |
54 | 55 | ||
55 | void show(); | 56 | void show(); |
56 | 57 | ||
57 | static bool setKeyboardLayout( const QString &kb ); | 58 | static bool setKeyboardLayout( const QString &kb ); |
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 & ); |
74 | void runDirectAccess(); | 79 | void runDirectAccess(); |
75 | void finishedQueuedRequests(); | 80 | void finishedQueuedRequests(); |
76 | 81 | ||
77 | protected: | 82 | protected: |
78 | void styleChange( QStyle & ); | 83 | void styleChange( QStyle & ); |
79 | void timerEvent( QTimerEvent *e ); | 84 | void timerEvent( QTimerEvent *e ); |
80 | 85 | ||
81 | private: | 86 | private: |
82 | void layout(); | 87 | void layout(); |
83 | void startTransferServer(); | 88 | void startTransferServer(); |
84 | void preloadApps(); | 89 | void preloadApps(); |
85 | void prepareDirectAccess(); | 90 | void prepareDirectAccess(); |
86 | void postDirectAccess(); | 91 | void postDirectAccess(); |
87 | QString cardInfoString(); | 92 | QString cardInfoString(); |
88 | QString installLocationsString(); | 93 | QString installLocationsString(); |
89 | 94 | ||
90 | QCopBridge *qcopBridge; | 95 | QCopBridge *qcopBridge; |
91 | TransferServer *transferServer; | 96 | TransferServer *transferServer; |
92 | PackageHandler *packageHandler; | 97 | PackageHandler *packageHandler; |
93 | QDate last_today_show; | 98 | QDate last_today_show; |
94 | int tid_xfer; | 99 | int tid_xfer; |
95 | /* ### FIXME two below### */ | 100 | /* ### FIXME two below### */ |
96 | // int tid_today; | 101 | // int tid_today; |
97 | // TempScreenSaverMonitor *tsmMonitor; | 102 | // TempScreenSaverMonitor *tsmMonitor; |
98 | StorageInfo *storage; | 103 | StorageInfo *storage; |
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 | ||