-rw-r--r-- | core/launcher/firstuse.cpp | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp index 4316648..e9e2d83 100644 --- a/core/launcher/firstuse.cpp +++ b/core/launcher/firstuse.cpp | |||
@@ -29,16 +29,18 @@ | |||
29 | #include "inputmethods.h" | 29 | #include "inputmethods.h" |
30 | #include "applauncher.h" | 30 | #include "applauncher.h" |
31 | #include "serverapp.h" | 31 | #include "serverapp.h" |
32 | //#include <qtopia/custom.h> | ||
33 | |||
34 | #include "calibrate.h" | 32 | #include "calibrate.h" |
35 | #include "documentlist.h" | 33 | #include "documentlist.h" |
36 | 34 | ||
35 | /* OPIE */ | ||
36 | #include <opie2/odebug.h> | ||
37 | #include <qtopia/resource.h> | 37 | #include <qtopia/resource.h> |
38 | #include <qtopia/qcopenvelope_qws.h> | 38 | #include <qtopia/qcopenvelope_qws.h> |
39 | #include <qtopia/config.h> | 39 | #include <qtopia/config.h> |
40 | #include <qtopia/fontmanager.h> | 40 | #include <qtopia/fontmanager.h> |
41 | using namespace Opie::Core; | ||
41 | 42 | ||
43 | /* QT */ | ||
42 | #include <qfile.h> | 44 | #include <qfile.h> |
43 | #include <qpainter.h> | 45 | #include <qpainter.h> |
44 | #include <qsimplerichtext.h> | 46 | #include <qsimplerichtext.h> |
@@ -51,7 +53,7 @@ | |||
51 | #include <qgfx_qws.h> | 53 | #include <qgfx_qws.h> |
52 | #endif | 54 | #endif |
53 | 55 | ||
54 | 56 | /* STD */ | |
55 | #include <stdlib.h> | 57 | #include <stdlib.h> |
56 | #include <sys/types.h> | 58 | #include <sys/types.h> |
57 | #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) | 59 | #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) |
@@ -155,7 +157,7 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) : | |||
155 | taskBar->hide(); | 157 | taskBar->hide(); |
156 | 158 | ||
157 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 159 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
158 | qDebug("Setting up QCop to QPE/System"); | 160 | odebug << "Setting up QCop to QPE/System" << oendl; |
159 | QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); | 161 | QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); |
160 | connect(sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), | 162 | connect(sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), |
161 | this, SLOT(message(const QCString&,const QByteArray&)) ); | 163 | this, SLOT(message(const QCString&,const QByteArray&)) ); |
@@ -223,18 +225,18 @@ void FirstUse::nextDialog() | |||
223 | int prevApp = currApp; | 225 | int prevApp = currApp; |
224 | do { | 226 | do { |
225 | currApp++; | 227 | currApp++; |
226 | qDebug( "currApp = %d", currApp ); | 228 | odebug << "currApp = " << currApp << "" << oendl; |
227 | if ( settingsTable[currApp].app == 0 ) { | 229 | if ( settingsTable[currApp].app == 0 ) { |
228 | if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { | 230 | if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { |
229 | // The last application is still running. | 231 | // The last application is still running. |
230 | // Tell it to stop, and when its done we'll come back | 232 | // Tell it to stop, and when its done we'll come back |
231 | // to nextDialog and exit. | 233 | // to nextDialog and exit. |
232 | qDebug( "Waiting for %s to exit", settingsTable[prevApp].app ); | 234 | odebug << "Waiting for " << settingsTable[prevApp].app << " to exit" << oendl; |
233 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, | 235 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, |
234 | settingsTable[prevApp].stop ); | 236 | settingsTable[prevApp].stop ); |
235 | currApp = prevApp; | 237 | currApp = prevApp; |
236 | } else { | 238 | } else { |
237 | qDebug( "Done!" ); | 239 | odebug << "Done!" << oendl; |
238 | Config config( "qpe" ); | 240 | Config config( "qpe" ); |
239 | config.setGroup( "Startup" ); | 241 | config.setGroup( "Startup" ); |
240 | config.writeEntry( "FirstUse", FALSE ); | 242 | config.writeEntry( "FirstUse", FALSE ); |
@@ -258,12 +260,12 @@ void FirstUse::nextDialog() | |||
258 | } while ( !settingsTable[currApp].enabled ); | 260 | } while ( !settingsTable[currApp].enabled ); |
259 | 261 | ||
260 | if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { | 262 | if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { |
261 | qDebug( "Shutdown: %s", settingsTable[prevApp].app ); | 263 | odebug << "Shutdown: " << settingsTable[prevApp].app << "" << oendl; |
262 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, | 264 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, |
263 | settingsTable[prevApp].stop ); | 265 | settingsTable[prevApp].stop ); |
264 | waitForExit = prevApp; | 266 | waitForExit = prevApp; |
265 | } else { | 267 | } else { |
266 | qDebug( "Startup: %s", settingsTable[currApp].app ); | 268 | odebug << "Startup: " << settingsTable[currApp].app << "" << oendl; |
267 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app, | 269 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app, |
268 | settingsTable[currApp].start ); | 270 | settingsTable[currApp].start ); |
269 | waitingForLaunch = TRUE; | 271 | waitingForLaunch = TRUE; |
@@ -285,7 +287,7 @@ void FirstUse::previousDialog() | |||
285 | } while ( !settingsTable[currApp].enabled ); | 287 | } while ( !settingsTable[currApp].enabled ); |
286 | 288 | ||
287 | if ( prevApp >= 0 ) { | 289 | if ( prevApp >= 0 ) { |
288 | qDebug( "Shutdown: %s", settingsTable[prevApp].app ); | 290 | odebug << "Shutdown: " << settingsTable[prevApp].app << "" << oendl; |
289 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, | 291 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, |
290 | settingsTable[prevApp].stop ); | 292 | settingsTable[prevApp].stop ); |
291 | /* | 293 | /* |
@@ -294,7 +296,7 @@ void FirstUse::previousDialog() | |||
294 | */ | 296 | */ |
295 | waitForExit = prevApp; | 297 | waitForExit = prevApp; |
296 | } else { | 298 | } else { |
297 | qDebug( "Startup: %s", settingsTable[currApp].app ); | 299 | odebug << "Startup: " << settingsTable[currApp].app << "" << oendl; |
298 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app, | 300 | QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app, |
299 | settingsTable[currApp].start ); | 301 | settingsTable[currApp].start ); |
300 | waitingForLaunch = TRUE; | 302 | waitingForLaunch = TRUE; |
@@ -318,9 +320,9 @@ void FirstUse::message(const QCString &msg, const QByteArray &data) | |||
318 | 320 | ||
319 | void FirstUse::terminated( int, const QString &app ) | 321 | void FirstUse::terminated( int, const QString &app ) |
320 | { | 322 | { |
321 | qDebug( "--- terminated: %s", app.latin1() ); | 323 | odebug << "--- terminated: " << app << "" << oendl; |
322 | if ( waitForExit != -1 && settingsTable[waitForExit].app == app ) { | 324 | if ( waitForExit != -1 && settingsTable[waitForExit].app == app ) { |
323 | qDebug( "Startup: %s", settingsTable[currApp].app ); | 325 | odebug << "Startup: " << settingsTable[currApp].app << "" << oendl; |
324 | if ( settingsTable[waitForExit].app == "language" ) { // No tr | 326 | if ( settingsTable[waitForExit].app == "language" ) { // No tr |
325 | Config config("locale"); | 327 | Config config("locale"); |
326 | config.setGroup( "Language"); | 328 | config.setGroup( "Language"); |
@@ -347,12 +349,12 @@ void FirstUse::terminated( int, const QString &app ) | |||
347 | 349 | ||
348 | void FirstUse::newQcopChannel(const QString& channelName) | 350 | void FirstUse::newQcopChannel(const QString& channelName) |
349 | { | 351 | { |
350 | qDebug("channel %s added", channelName.data() ); | 352 | odebug << "channel " << channelName.data() << " added" << oendl; |
351 | QString prefix("QPE/Application/"); | 353 | QString prefix("QPE/Application/"); |
352 | if (channelName.startsWith(prefix)) { | 354 | if (channelName.startsWith(prefix)) { |
353 | QString appName = channelName.mid(prefix.length()); | 355 | QString appName = channelName.mid(prefix.length()); |
354 | if ( currApp >= 0 && appName == settingsTable[currApp].app ) { | 356 | if ( currApp >= 0 && appName == settingsTable[currApp].app ) { |
355 | qDebug( "Application: %s started", settingsTable[currApp].app ); | 357 | odebug << "Application: " << settingsTable[currApp].app << " started" << oendl; |
356 | waitingForLaunch = FALSE; | 358 | waitingForLaunch = FALSE; |
357 | updateButtons(); | 359 | updateButtons(); |
358 | repaint(); | 360 | repaint(); |
@@ -370,12 +372,12 @@ void FirstUse::reloadLanguages() | |||
370 | config.setGroup( "Language"); | 372 | config.setGroup( "Language"); |
371 | QString l = config.readEntry( "Language", "en"); | 373 | QString l = config.readEntry( "Language", "en"); |
372 | QString cl = getenv("LANG"); | 374 | QString cl = getenv("LANG"); |
373 | qWarning("language message - " + l); | 375 | owarn << "language message - " + l << oendl; |
374 | // setting anyway... | 376 | // setting anyway... |
375 | if (l.isNull() ) | 377 | if (l.isNull() ) |
376 | unsetenv( "LANG" ); | 378 | unsetenv( "LANG" ); |
377 | else { | 379 | else { |
378 | qWarning("and its not null"); | 380 | owarn << "and its not null" << oendl; |
379 | setenv( "LANG", l.latin1(), 1 ); | 381 | setenv( "LANG", l.latin1(), 1 ); |
380 | } | 382 | } |
381 | #ifndef QT_NO_TRANSLATION | 383 | #ifndef QT_NO_TRANSLATION |
@@ -392,9 +394,9 @@ void FirstUse::reloadLanguages() | |||
392 | // load translation tables | 394 | // load translation tables |
393 | transApp = new QTranslator(qApp); | 395 | transApp = new QTranslator(qApp); |
394 | QString tfn = QPEApplication::qpeDir() + "i18n/"+l+"/qpe.qm"; | 396 | QString tfn = QPEApplication::qpeDir() + "i18n/"+l+"/qpe.qm"; |
395 | qWarning("loading " + tfn); | 397 | owarn << "loading " + tfn << oendl; |
396 | if ( transApp->load(tfn) ) { | 398 | if ( transApp->load(tfn) ) { |
397 | qWarning("installing translator"); | 399 | owarn << "installing translator" << oendl; |
398 | qApp->installTranslator( transApp ); | 400 | qApp->installTranslator( transApp ); |
399 | } else { | 401 | } else { |
400 | delete transApp; | 402 | delete transApp; |
@@ -403,9 +405,9 @@ void FirstUse::reloadLanguages() | |||
403 | 405 | ||
404 | transLib = new QTranslator(qApp); | 406 | transLib = new QTranslator(qApp); |
405 | tfn = QPEApplication::qpeDir() + "i18n/"+l+"/libqpe.qm"; | 407 | tfn = QPEApplication::qpeDir() + "i18n/"+l+"/libqpe.qm"; |
406 | qWarning("loading " + tfn); | 408 | owarn << "loading " + tfn << oendl; |
407 | if ( transLib->load(tfn) ) { | 409 | if ( transLib->load(tfn) ) { |
408 | qWarning("installing translator library"); | 410 | owarn << "installing translator library" << oendl; |
409 | qApp->installTranslator( transLib ); | 411 | qApp->installTranslator( transLib ); |
410 | } else { | 412 | } else { |
411 | delete transLib; | 413 | delete transLib; |