author | chicken <chicken> | 2004-03-01 16:12:01 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-01 16:12:01 (UTC) |
commit | 9bc70bb8a0bdd3a7bc0013f2cacce7c039b88b38 (patch) (unidiff) | |
tree | 62527c430eb2f6c62ac01c11cdfea06494101a0e /core/launcher | |
parent | 931c55406a043195712955c732a875e17899df90 (diff) | |
download | opie-9bc70bb8a0bdd3a7bc0013f2cacce7c039b88b38.zip opie-9bc70bb8a0bdd3a7bc0013f2cacce7c039b88b38.tar.gz opie-9bc70bb8a0bdd3a7bc0013f2cacce7c039b88b38.tar.bz2 |
fix includes
-rw-r--r-- | core/launcher/applauncher.cpp | 4 | ||||
-rw-r--r-- | core/launcher/firstuse.cpp | 8 | ||||
-rw-r--r-- | core/launcher/inputmethods.cpp | 6 | ||||
-rw-r--r-- | core/launcher/irserver.cpp | 1 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 2 | ||||
-rw-r--r-- | core/launcher/launcherglobal.cpp | 4 | ||||
-rw-r--r-- | core/launcher/launchertab.cpp | 3 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 14 | ||||
-rw-r--r-- | core/launcher/main.cpp | 5 | ||||
-rw-r--r-- | core/launcher/packageslave.cpp | 2 | ||||
-rw-r--r-- | core/launcher/qcopbridge.cpp | 8 | ||||
-rw-r--r-- | core/launcher/runningappbar.cpp | 7 | ||||
-rw-r--r-- | core/launcher/screensaver.cpp | 1 | ||||
-rw-r--r-- | core/launcher/server.cpp | 3 | ||||
-rw-r--r-- | core/launcher/shutdownimpl.cpp | 1 | ||||
-rw-r--r-- | core/launcher/stabmon.cpp | 1 | ||||
-rw-r--r-- | core/launcher/startmenu.cpp | 4 | ||||
-rw-r--r-- | core/launcher/syncdialog.cpp | 1 | ||||
-rw-r--r-- | core/launcher/systray.cpp | 2 | ||||
-rw-r--r-- | core/launcher/transferserver.cpp | 10 | ||||
-rw-r--r-- | core/launcher/wait.cpp | 4 |
21 files changed, 1 insertions, 90 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp index c3584ad..7d3c032 100644 --- a/core/launcher/applauncher.cpp +++ b/core/launcher/applauncher.cpp | |||
@@ -5,104 +5,100 @@ | |||
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 | #ifndef QTOPIA_INTERNAL_PRELOADACCESS | 21 | #ifndef QTOPIA_INTERNAL_PRELOADACCESS |
22 | #define QTOPIA_INTERNAL_PRELOADACCESS | 22 | #define QTOPIA_INTERNAL_PRELOADACCESS |
23 | #endif | 23 | #endif |
24 | #ifndef QTOPIA_INTERNAL_FILEOPERATIONS | 24 | #ifndef QTOPIA_INTERNAL_FILEOPERATIONS |
25 | #define QTOPIA_INTERNAL_FILEOPERATIONS | 25 | #define QTOPIA_INTERNAL_FILEOPERATIONS |
26 | #endif | 26 | #endif |
27 | #ifndef QTOPIA_PROGRAM_MONITOR | 27 | #ifndef QTOPIA_PROGRAM_MONITOR |
28 | #define QTOPIA_PROGRAM_MONITOR | 28 | #define QTOPIA_PROGRAM_MONITOR |
29 | #endif | 29 | #endif |
30 | #include <opie2/oglobal.h> | 30 | #include <opie2/oglobal.h> |
31 | 31 | ||
32 | #ifndef Q_OS_WIN32 | 32 | #ifndef Q_OS_WIN32 |
33 | #include <sys/stat.h> | 33 | #include <sys/stat.h> |
34 | #include <sys/wait.h> | 34 | #include <sys/wait.h> |
35 | #include <sys/file.h> | 35 | #include <sys/file.h> |
36 | #include <unistd.h> | 36 | #include <unistd.h> |
37 | #include <sys/time.h> | 37 | #include <sys/time.h> |
38 | #include <sys/resource.h> | 38 | #include <sys/resource.h> |
39 | #include <errno.h> | 39 | #include <errno.h> |
40 | #else | 40 | #else |
41 | #include <process.h> | 41 | #include <process.h> |
42 | #include <windows.h> | 42 | #include <windows.h> |
43 | #include <winbase.h> | 43 | #include <winbase.h> |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | #include <signal.h> | 46 | #include <signal.h> |
47 | #include <sys/types.h> | 47 | #include <sys/types.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | 49 | ||
50 | #include <qtimer.h> | 50 | #include <qtimer.h> |
51 | #include <qwindowsystem_qws.h> | 51 | #include <qwindowsystem_qws.h> |
52 | #include <qmessagebox.h> | 52 | #include <qmessagebox.h> |
53 | #include <qfile.h> | ||
54 | #include <qfileinfo.h> | 53 | #include <qfileinfo.h> |
55 | 54 | ||
56 | #include <qtopia/qcopenvelope_qws.h> | 55 | #include <qtopia/qcopenvelope_qws.h> |
57 | #include <qtopia/applnk.h> | ||
58 | #include <qtopia/qpeapplication.h> | 56 | #include <qtopia/qpeapplication.h> |
59 | #include <qtopia/config.h> | ||
60 | #include <qtopia/global.h> | ||
61 | 57 | ||
62 | #include "applauncher.h" | 58 | #include "applauncher.h" |
63 | #include "documentlist.h" | 59 | #include "documentlist.h" |
64 | 60 | ||
65 | const int AppLauncher::RAISE_TIMEOUT_MS = 5000; | 61 | const int AppLauncher::RAISE_TIMEOUT_MS = 5000; |
66 | 62 | ||
67 | //--------------------------------------------------------------------------- | 63 | //--------------------------------------------------------------------------- |
68 | 64 | ||
69 | static AppLauncher* appLauncherPtr; | 65 | static AppLauncher* appLauncherPtr; |
70 | 66 | ||
71 | const int appStopEventID = 1290; | 67 | const int appStopEventID = 1290; |
72 | 68 | ||
73 | class AppStoppedEvent : public QCustomEvent | 69 | class AppStoppedEvent : public QCustomEvent |
74 | { | 70 | { |
75 | public: | 71 | public: |
76 | AppStoppedEvent(int pid, int status) | 72 | AppStoppedEvent(int pid, int status) |
77 | : QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { } | 73 | : QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { } |
78 | 74 | ||
79 | int pid() { return mPid; } | 75 | int pid() { return mPid; } |
80 | int status() { return mStatus; } | 76 | int status() { return mStatus; } |
81 | 77 | ||
82 | private: | 78 | private: |
83 | int mPid, mStatus; | 79 | int mPid, mStatus; |
84 | }; | 80 | }; |
85 | 81 | ||
86 | AppLauncher::AppLauncher(QObject *parent, const char *name) | 82 | AppLauncher::AppLauncher(QObject *parent, const char *name) |
87 | : QObject(parent, name), qlPid(0), qlReady(FALSE), | 83 | : QObject(parent, name), qlPid(0), qlReady(FALSE), |
88 | appKillerBox(0) | 84 | appKillerBox(0) |
89 | { | 85 | { |
90 | connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&))); | 86 | connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&))); |
91 | connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&))); | 87 | connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&))); |
92 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); | 88 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); |
93 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 89 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
94 | this, SLOT(received(const QCString&, const QByteArray&)) ); | 90 | this, SLOT(received(const QCString&, const QByteArray&)) ); |
95 | 91 | ||
96 | channel = new QCopChannel( "QPE/Server", this ); | 92 | channel = new QCopChannel( "QPE/Server", this ); |
97 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 93 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
98 | this, SLOT(received(const QCString&, const QByteArray&)) ); | 94 | this, SLOT(received(const QCString&, const QByteArray&)) ); |
99 | 95 | ||
100 | #ifndef Q_OS_WIN32 | 96 | #ifndef Q_OS_WIN32 |
101 | signal(SIGCHLD, signalHandler); | 97 | signal(SIGCHLD, signalHandler); |
102 | #else | 98 | #else |
103 | runningAppsProc.setAutoDelete( TRUE ); | 99 | runningAppsProc.setAutoDelete( TRUE ); |
104 | #endif | 100 | #endif |
105 | QString tmp = qApp->argv()[0]; | 101 | QString tmp = qApp->argv()[0]; |
106 | int pos = tmp.findRev('/'); | 102 | int pos = tmp.findRev('/'); |
107 | if ( pos > -1 ) | 103 | if ( pos > -1 ) |
108 | tmp = tmp.mid(++pos); | 104 | tmp = tmp.mid(++pos); |
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp index e07920f..50ae6c2 100644 --- a/core/launcher/firstuse.cpp +++ b/core/launcher/firstuse.cpp | |||
@@ -1,109 +1,101 @@ | |||
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 | // I need access to some things you don't normally get access to. | 21 | // I need access to some things you don't normally get access to. |
22 | 22 | ||
23 | #ifndef _MSC_VER | 23 | #ifndef _MSC_VER |
24 | //### revise to allow removal of translators under MSVC | 24 | //### revise to allow removal of translators under MSVC |
25 | #define private public | 25 | #define private public |
26 | #define protected public | 26 | #define protected public |
27 | #endif | 27 | #endif |
28 | #include "firstuse.h" | 28 | #include "firstuse.h" |
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> | 32 | //#include <qtopia/custom.h> |
33 | 33 | ||
34 | #include "calibrate.h" | 34 | #include "calibrate.h" |
35 | #include "documentlist.h" | 35 | #include "documentlist.h" |
36 | 36 | ||
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/qpeapplication.h> | ||
40 | #include <qtopia/config.h> | 39 | #include <qtopia/config.h> |
41 | #include <qtopia/applnk.h> | ||
42 | #include <qtopia/mimetype.h> | ||
43 | #include <qtopia/fontmanager.h> | 40 | #include <qtopia/fontmanager.h> |
44 | 41 | ||
45 | #include <qapplication.h> | ||
46 | #include <qfile.h> | 42 | #include <qfile.h> |
47 | #include <qpainter.h> | 43 | #include <qpainter.h> |
48 | #include <qcstring.h> | ||
49 | #include <qsimplerichtext.h> | 44 | #include <qsimplerichtext.h> |
50 | #include <qcolor.h> | ||
51 | #include <qpushbutton.h> | 45 | #include <qpushbutton.h> |
52 | #include <qhbox.h> | ||
53 | #include <qlabel.h> | 46 | #include <qlabel.h> |
54 | #include <qtimer.h> | 47 | #include <qtimer.h> |
55 | 48 | ||
56 | #if defined( Q_WS_QWS ) | 49 | #if defined( Q_WS_QWS ) |
57 | #include <qwsdisplay_qws.h> | 50 | #include <qwsdisplay_qws.h> |
58 | #include <qgfx_qws.h> | 51 | #include <qgfx_qws.h> |
59 | #endif | 52 | #endif |
60 | 53 | ||
61 | #include <qwindowsystem_qws.h> | ||
62 | 54 | ||
63 | #include <stdlib.h> | 55 | #include <stdlib.h> |
64 | #include <sys/types.h> | 56 | #include <sys/types.h> |
65 | #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) | 57 | #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) |
66 | #include <unistd.h> | 58 | #include <unistd.h> |
67 | #endif | 59 | #endif |
68 | 60 | ||
69 | 61 | ||
70 | struct { | 62 | struct { |
71 | bool enabled; | 63 | bool enabled; |
72 | const char *app; | 64 | const char *app; |
73 | const char *start; | 65 | const char *start; |
74 | const char *stop; | 66 | const char *stop; |
75 | const char *desc; | 67 | const char *desc; |
76 | } | 68 | } |
77 | settingsTable [] = | 69 | settingsTable [] = |
78 | { | 70 | { |
79 | { FALSE, "language", "raise()", "accept()", // No tr | 71 | { FALSE, "language", "raise()", "accept()", // No tr |
80 | QT_TR_NOOP("Language") }, | 72 | QT_TR_NOOP("Language") }, |
81 | { FALSE, "doctab", "raise()", "accept()", // No tr | 73 | { FALSE, "doctab", "raise()", "accept()", // No tr |
82 | QT_TR_NOOP("DocTab") }, | 74 | QT_TR_NOOP("DocTab") }, |
83 | #ifndef Q_OS_WIN32 | 75 | #ifndef Q_OS_WIN32 |
84 | { FALSE, "systemtime", "raise()", "accept()", // No tr | 76 | { FALSE, "systemtime", "raise()", "accept()", // No tr |
85 | QT_TR_NOOP("Time and Date") }, | 77 | QT_TR_NOOP("Time and Date") }, |
86 | #endif | 78 | #endif |
87 | { FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr | 79 | { FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr |
88 | QT_TR_NOOP("Personal Information") }, | 80 | QT_TR_NOOP("Personal Information") }, |
89 | { FALSE, 0, 0, 0, 0 } | 81 | { FALSE, 0, 0, 0, 0 } |
90 | }; | 82 | }; |
91 | 83 | ||
92 | 84 | ||
93 | FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) : | 85 | FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) : |
94 | QDialog( parent, name, TRUE, wf), | 86 | QDialog( parent, name, TRUE, wf), |
95 | transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1), | 87 | transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1), |
96 | waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE) | 88 | waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE) |
97 | { | 89 | { |
98 | ServerApplication::allowRestart = FALSE; | 90 | ServerApplication::allowRestart = FALSE; |
99 | // we force our height beyound the maximum (which we set anyway) | 91 | // we force our height beyound the maximum (which we set anyway) |
100 | QRect desk = qApp->desktop()->geometry(); | 92 | QRect desk = qApp->desktop()->geometry(); |
101 | setGeometry( 0, 0, desk.width(), desk.height() ); | 93 | setGeometry( 0, 0, desk.width(), desk.height() ); |
102 | 94 | ||
103 | connect(qwsServer, SIGNAL(newChannel(const QString&)), | 95 | connect(qwsServer, SIGNAL(newChannel(const QString&)), |
104 | this, SLOT(newQcopChannel(const QString&))); | 96 | this, SLOT(newQcopChannel(const QString&))); |
105 | 97 | ||
106 | // Create a DocumentList so appLauncher has appLnkSet to search | 98 | // Create a DocumentList so appLauncher has appLnkSet to search |
107 | docList = new DocumentList( 0, FALSE ); | 99 | docList = new DocumentList( 0, FALSE ); |
108 | appLauncher = new AppLauncher( this ); | 100 | appLauncher = new AppLauncher( this ); |
109 | connect( appLauncher, SIGNAL(terminated(int, const QString&)), | 101 | connect( appLauncher, SIGNAL(terminated(int, const QString&)), |
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp index 5d8faf7..683f1e2 100644 --- a/core/launcher/inputmethods.cpp +++ b/core/launcher/inputmethods.cpp | |||
@@ -1,86 +1,80 @@ | |||
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 | #define QTOPIA_INTERNAL_LANGLIST | 21 | #define QTOPIA_INTERNAL_LANGLIST |
22 | #include "inputmethods.h" | 22 | #include "inputmethods.h" |
23 | 23 | ||
24 | #include <qtopia/config.h> | 24 | #include <qtopia/config.h> |
25 | #include <qtopia/qpeapplication.h> | 25 | #include <qtopia/qpeapplication.h> |
26 | #include <qtopia/inputmethodinterface.h> | ||
27 | #include <qtopia/global.h> | ||
28 | 26 | ||
29 | #include <qpopupmenu.h> | 27 | #include <qpopupmenu.h> |
30 | #include <qpushbutton.h> | ||
31 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
32 | #include <qwidgetstack.h> | 29 | #include <qwidgetstack.h> |
33 | #include <qwidget.h> | ||
34 | #include <qlayout.h> | 30 | #include <qlayout.h> |
35 | #include <qtimer.h> | ||
36 | #include <qdir.h> | 31 | #include <qdir.h> |
37 | #include <stdlib.h> | 32 | #include <stdlib.h> |
38 | #include <qtranslator.h> | ||
39 | #include <qtl.h> | 33 | #include <qtl.h> |
40 | 34 | ||
41 | #ifdef Q_WS_QWS | 35 | #ifdef Q_WS_QWS |
42 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
43 | #include <qwsevent_qws.h> | 37 | #include <qwsevent_qws.h> |
44 | #include <qcopchannel_qws.h> | 38 | #include <qcopchannel_qws.h> |
45 | #endif | 39 | #endif |
46 | 40 | ||
47 | /* ### SingleFloppy if someone is interested? */ | 41 | /* ### SingleFloppy if someone is interested? */ |
48 | #if 0 | 42 | #if 0 |
49 | #ifdef QT_NO_COMPONENT | 43 | #ifdef QT_NO_COMPONENT |
50 | #include "../plugins/inputmethods/handwriting/handwritingimpl.h" | 44 | #include "../plugins/inputmethods/handwriting/handwritingimpl.h" |
51 | #include "../plugins/inputmethods/keyboard/keyboardimpl.h" | 45 | #include "../plugins/inputmethods/keyboard/keyboardimpl.h" |
52 | #include "../3rdparty/plugins/inputmethods/pickboard/pickboardimpl.h" | 46 | #include "../3rdparty/plugins/inputmethods/pickboard/pickboardimpl.h" |
53 | #endif | 47 | #endif |
54 | #endif | 48 | #endif |
55 | 49 | ||
56 | /* XPM */ | 50 | /* XPM */ |
57 | static const char * tri_xpm[]={ | 51 | static const char * tri_xpm[]={ |
58 | "9 9 2 1", | 52 | "9 9 2 1", |
59 | "a c #000000", | 53 | "a c #000000", |
60 | ". c None", | 54 | ". c None", |
61 | ".........", | 55 | ".........", |
62 | ".........", | 56 | ".........", |
63 | ".........", | 57 | ".........", |
64 | "....a....", | 58 | "....a....", |
65 | "...aaa...", | 59 | "...aaa...", |
66 | "..aaaaa..", | 60 | "..aaaaa..", |
67 | ".aaaaaaa.", | 61 | ".aaaaaaa.", |
68 | ".........", | 62 | ".........", |
69 | "........."}; | 63 | "........."}; |
70 | 64 | ||
71 | int InputMethod::operator <(const InputMethod& o) const | 65 | int InputMethod::operator <(const InputMethod& o) const |
72 | { | 66 | { |
73 | return name() < o.name(); | 67 | return name() < o.name(); |
74 | } | 68 | } |
75 | int InputMethod::operator >(const InputMethod& o) const | 69 | int InputMethod::operator >(const InputMethod& o) const |
76 | { | 70 | { |
77 | return name() > o.name(); | 71 | return name() > o.name(); |
78 | } | 72 | } |
79 | int InputMethod::operator <=(const InputMethod& o) const | 73 | int InputMethod::operator <=(const InputMethod& o) const |
80 | { | 74 | { |
81 | return name() <= o.name(); | 75 | return name() <= o.name(); |
82 | } | 76 | } |
83 | 77 | ||
84 | 78 | ||
85 | /* | 79 | /* |
86 | Slightly hacky: We use WStyle_Tool as a flag to say "this widget | 80 | Slightly hacky: We use WStyle_Tool as a flag to say "this widget |
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp index 63f8d05..a0e9c16 100644 --- a/core/launcher/irserver.cpp +++ b/core/launcher/irserver.cpp | |||
@@ -1,75 +1,74 @@ | |||
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 | 21 | ||
22 | #include "irserver.h" | 22 | #include "irserver.h" |
23 | 23 | ||
24 | #include <qtopia/qlibrary.h> | 24 | #include <qtopia/qlibrary.h> |
25 | #include <qtopia/qpeapplication.h> | 25 | #include <qtopia/qpeapplication.h> |
26 | 26 | ||
27 | #include <qtranslator.h> | ||
28 | 27 | ||
29 | #include "obexinterface.h" | 28 | #include "obexinterface.h" |
30 | 29 | ||
31 | #include <qdir.h> | 30 | #include <qdir.h> |
32 | 31 | ||
33 | IrServer::IrServer( QObject *parent, const char *name ) | 32 | IrServer::IrServer( QObject *parent, const char *name ) |
34 | : QObject( parent, name ), obexIface(0) | 33 | : QObject( parent, name ), obexIface(0) |
35 | { | 34 | { |
36 | lib = 0; | 35 | lib = 0; |
37 | obexIface = 0; | 36 | obexIface = 0; |
38 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; | 37 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; |
39 | #ifdef Q_OS_MACX | 38 | #ifdef Q_OS_MACX |
40 | QDir dir( path, "lib*.dylib" ); | 39 | QDir dir( path, "lib*.dylib" ); |
41 | #else | 40 | #else |
42 | QDir dir( path, "lib*.so" ); | 41 | QDir dir( path, "lib*.so" ); |
43 | #endif /* Q_OS_MACX */ | 42 | #endif /* Q_OS_MACX */ |
44 | QStringList list = dir.entryList(); | 43 | QStringList list = dir.entryList(); |
45 | QStringList::Iterator it; | 44 | QStringList::Iterator it; |
46 | for ( it = list.begin(); it != list.end(); ++it ) { | 45 | for ( it = list.begin(); it != list.end(); ++it ) { |
47 | QLibrary *trylib = new QLibrary( path + *it ); | 46 | QLibrary *trylib = new QLibrary( path + *it ); |
48 | //qDebug("trying lib %s", (path + (*it)).latin1() ); | 47 | //qDebug("trying lib %s", (path + (*it)).latin1() ); |
49 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { | 48 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { |
50 | lib = trylib; | 49 | lib = trylib; |
51 | //qDebug("found obex lib" ); | 50 | //qDebug("found obex lib" ); |
52 | QString lang = getenv( "LANG" ); | 51 | QString lang = getenv( "LANG" ); |
53 | QTranslator * trans = new QTranslator(qApp); | 52 | QTranslator * trans = new QTranslator(qApp); |
54 | QString type = (*it).left( (*it).find(".") ); | 53 | QString type = (*it).left( (*it).find(".") ); |
55 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 54 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
56 | //qDebug("tr fpr obex: %s", tfn.latin1() ); | 55 | //qDebug("tr fpr obex: %s", tfn.latin1() ); |
57 | if ( trans->load( tfn )) | 56 | if ( trans->load( tfn )) |
58 | qApp->installTranslator( trans ); | 57 | qApp->installTranslator( trans ); |
59 | else | 58 | else |
60 | delete trans; | 59 | delete trans; |
61 | 60 | ||
62 | break; | 61 | break; |
63 | } else { | 62 | } else { |
64 | delete lib; | 63 | delete lib; |
65 | } | 64 | } |
66 | } | 65 | } |
67 | if ( !lib ) | 66 | if ( !lib ) |
68 | qDebug("could not load IR plugin" ); | 67 | qDebug("could not load IR plugin" ); |
69 | } | 68 | } |
70 | 69 | ||
71 | IrServer::~IrServer() | 70 | IrServer::~IrServer() |
72 | { | 71 | { |
73 | if ( obexIface ) | 72 | if ( obexIface ) |
74 | obexIface->release(); | 73 | obexIface->release(); |
75 | delete lib; | 74 | delete lib; |
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 984a57d..54efb0b 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -1,94 +1,92 @@ | |||
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 <qtopia/global.h> | 21 | #include <qtopia/global.h> |
22 | #ifdef Q_WS_QWS | 22 | #ifdef Q_WS_QWS |
23 | #include <qtopia/qcopenvelope_qws.h> | 23 | #include <qtopia/qcopenvelope_qws.h> |
24 | #endif | 24 | #endif |
25 | #include <qtopia/resource.h> | 25 | #include <qtopia/resource.h> |
26 | #include <qtopia/applnk.h> | 26 | #include <qtopia/applnk.h> |
27 | #include <qtopia/config.h> | 27 | #include <qtopia/config.h> |
28 | #include <qtopia/global.h> | ||
29 | #include <qtopia/qpeapplication.h> | 28 | #include <qtopia/qpeapplication.h> |
30 | #include <qtopia/mimetype.h> | 29 | #include <qtopia/mimetype.h> |
31 | #include <qtopia/private/categories.h> | 30 | #include <qtopia/private/categories.h> |
32 | //#include <qtopia/custom.h> | 31 | //#include <qtopia/custom.h> |
33 | 32 | ||
34 | #include <qdir.h> | 33 | #include <qdir.h> |
35 | #ifdef Q_WS_QWS | 34 | #ifdef Q_WS_QWS |
36 | #include <qwindowsystem_qws.h> | 35 | #include <qwindowsystem_qws.h> |
37 | #endif | 36 | #endif |
38 | #include <qtimer.h> | 37 | #include <qtimer.h> |
39 | #include <qcombobox.h> | 38 | #include <qcombobox.h> |
40 | #include <qvbox.h> | 39 | #include <qvbox.h> |
41 | #include <qlayout.h> | 40 | #include <qlayout.h> |
42 | #include <qstyle.h> | 41 | #include <qstyle.h> |
43 | #include <qpushbutton.h> | 42 | #include <qpushbutton.h> |
44 | #include <qtabbar.h> | 43 | #include <qtabbar.h> |
45 | #include <qwidgetstack.h> | 44 | #include <qwidgetstack.h> |
46 | #include <qlayout.h> | ||
47 | #include <qregexp.h> | 45 | #include <qregexp.h> |
48 | #include <qmessagebox.h> | 46 | #include <qmessagebox.h> |
49 | #include <qframe.h> | 47 | #include <qframe.h> |
50 | #include <qpainter.h> | 48 | #include <qpainter.h> |
51 | #include <qlabel.h> | 49 | #include <qlabel.h> |
52 | #include <qtextstream.h> | 50 | #include <qtextstream.h> |
53 | #include <qpopupmenu.h> | 51 | #include <qpopupmenu.h> |
54 | 52 | ||
55 | #include "startmenu.h" | 53 | #include "startmenu.h" |
56 | #include "taskbar.h" | 54 | #include "taskbar.h" |
57 | 55 | ||
58 | #include "serverinterface.h" | 56 | #include "serverinterface.h" |
59 | #include "launcherview.h" | 57 | #include "launcherview.h" |
60 | #include "launcher.h" | 58 | #include "launcher.h" |
61 | #include "server.h" | 59 | #include "server.h" |
62 | 60 | ||
63 | #define QTOPIA_INTERNAL_FSLP | 61 | #define QTOPIA_INTERNAL_FSLP |
64 | #include <qtopia/lnkproperties.h> | 62 | #include <qtopia/lnkproperties.h> |
65 | #include <stdlib.h> | 63 | #include <stdlib.h> |
66 | #include <assert.h> | 64 | #include <assert.h> |
67 | 65 | ||
68 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 66 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
69 | #include <unistd.h> | 67 | #include <unistd.h> |
70 | #include <stdio.h> | 68 | #include <stdio.h> |
71 | #include <sys/vfs.h> | 69 | #include <sys/vfs.h> |
72 | #include <mntent.h> | 70 | #include <mntent.h> |
73 | #endif | 71 | #endif |
74 | 72 | ||
75 | #ifdef Q_WS_QWS | 73 | #ifdef Q_WS_QWS |
76 | #include <qkeyboard_qws.h> | 74 | #include <qkeyboard_qws.h> |
77 | #include <qpe/lnkproperties.h> | 75 | #include <qpe/lnkproperties.h> |
78 | #endif | 76 | #endif |
79 | 77 | ||
80 | 78 | ||
81 | static bool isVisibleWindow( int ); | 79 | static bool isVisibleWindow( int ); |
82 | //=========================================================================== | 80 | //=========================================================================== |
83 | 81 | ||
84 | LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : | 82 | LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : |
85 | QVBox( parent ), docview( 0 ) | 83 | QVBox( parent ), docview( 0 ) |
86 | { | 84 | { |
87 | docLoadingWidgetEnabled = false; | 85 | docLoadingWidgetEnabled = false; |
88 | docLoadingWidget = 0; | 86 | docLoadingWidget = 0; |
89 | docLoadingWidgetProgress = 0; | 87 | docLoadingWidgetProgress = 0; |
90 | launcher = parent; | 88 | launcher = parent; |
91 | categoryBar = new LauncherTabBar( this ); | 89 | categoryBar = new LauncherTabBar( this ); |
92 | QPalette pal = categoryBar->palette(); | 90 | QPalette pal = categoryBar->palette(); |
93 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 91 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
94 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 92 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
diff --git a/core/launcher/launcherglobal.cpp b/core/launcher/launcherglobal.cpp index 84caa93..9abcae9 100644 --- a/core/launcher/launcherglobal.cpp +++ b/core/launcher/launcherglobal.cpp | |||
@@ -1,57 +1,53 @@ | |||
1 | /* | 1 | /* |
2 | * GPLv2 only | 2 | * GPLv2 only |
3 | * | 3 | * |
4 | * TT 2002-2002,2003 | 4 | * TT 2002-2002,2003 |
5 | */ | 5 | */ |
6 | #include <qstring.h> | ||
7 | #include <qcstring.h> | ||
8 | #include <qwidget.h> | ||
9 | #include <qguardedptr.h> | ||
10 | #include <qfile.h> | 6 | #include <qfile.h> |
11 | #include <qtextstream.h> | 7 | #include <qtextstream.h> |
12 | 8 | ||
13 | #include <qtopia/mimetype.h> | 9 | #include <qtopia/mimetype.h> |
14 | 10 | ||
15 | #include "launcherglobal.h" | 11 | #include "launcherglobal.h" |
16 | 12 | ||
17 | bool Opie::Global::isAppLnkFileName( const QString& file ) { | 13 | bool Opie::Global::isAppLnkFileName( const QString& file ) { |
18 | if ( file.right(1) == "/" ) | 14 | if ( file.right(1) == "/" ) |
19 | return FALSE; | 15 | return FALSE; |
20 | 16 | ||
21 | return file.find(MimeType::appsFolderName()+"/")==0; | 17 | return file.find(MimeType::appsFolderName()+"/")==0; |
22 | } | 18 | } |
23 | 19 | ||
24 | QString Opie::Global::tempDir() { | 20 | QString Opie::Global::tempDir() { |
25 | return QString::fromLatin1("/tmp/"); | 21 | return QString::fromLatin1("/tmp/"); |
26 | } | 22 | } |
27 | 23 | ||
28 | Global::Command* Opie::Global::builtinCommands() { | 24 | Global::Command* Opie::Global::builtinCommands() { |
29 | return builtin; | 25 | return builtin; |
30 | } | 26 | } |
31 | 27 | ||
32 | QGuardedPtr<QWidget>* Opie::Global::builtinRunning() { | 28 | QGuardedPtr<QWidget>* Opie::Global::builtinRunning() { |
33 | return running; | 29 | return running; |
34 | } | 30 | } |
35 | 31 | ||
36 | QString Opie::Global::uuid() { | 32 | QString Opie::Global::uuid() { |
37 | QFile file( "/proc/sys/kernel/random/uuid" ); | 33 | QFile file( "/proc/sys/kernel/random/uuid" ); |
38 | if (!file.open(IO_ReadOnly ) ) | 34 | if (!file.open(IO_ReadOnly ) ) |
39 | return QString::null; | 35 | return QString::null; |
40 | 36 | ||
41 | QTextStream stream(&file); | 37 | QTextStream stream(&file); |
42 | 38 | ||
43 | return "{" + stream.read().stripWhiteSpace() + "}"; | 39 | return "{" + stream.read().stripWhiteSpace() + "}"; |
44 | } | 40 | } |
45 | 41 | ||
46 | QByteArray Opie::Global::encodeBase64(const QByteArray& origData ) { | 42 | QByteArray Opie::Global::encodeBase64(const QByteArray& origData ) { |
47 | // follows simple algorithm from rsync code | 43 | // follows simple algorithm from rsync code |
48 | uchar *in = (uchar*)origData.data(); | 44 | uchar *in = (uchar*)origData.data(); |
49 | 45 | ||
50 | int inbytes = origData.size(); | 46 | int inbytes = origData.size(); |
51 | int outbytes = ((inbytes * 8) + 5) / 6; | 47 | int outbytes = ((inbytes * 8) + 5) / 6; |
52 | int padding = 4-outbytes%4; if ( padding == 4 ) padding = 0; | 48 | int padding = 4-outbytes%4; if ( padding == 4 ) padding = 0; |
53 | 49 | ||
54 | QByteArray outbuf(outbytes+padding); | 50 | QByteArray outbuf(outbytes+padding); |
55 | uchar* out = (uchar*)outbuf.data(); | 51 | uchar* out = (uchar*)outbuf.data(); |
56 | 52 | ||
57 | const char *b64 = | 53 | const char *b64 = |
diff --git a/core/launcher/launchertab.cpp b/core/launcher/launchertab.cpp index 10cfd5f..710f259 100644 --- a/core/launcher/launchertab.cpp +++ b/core/launcher/launchertab.cpp | |||
@@ -1,72 +1,69 @@ | |||
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 | #include "launchertab.h" | 20 | #include "launchertab.h" |
21 | #include <qapplication.h> | 21 | #include <qapplication.h> |
22 | #include <qstyle.h> | ||
23 | #include <qpainter.h> | ||
24 | #include <qbitmap.h> | ||
25 | 22 | ||
26 | 23 | ||
27 | LauncherTabBar::LauncherTabBar( QWidget *parent, const char *name ) | 24 | LauncherTabBar::LauncherTabBar( QWidget *parent, const char *name ) |
28 | : QTabBar( parent, name ) | 25 | : QTabBar( parent, name ) |
29 | { | 26 | { |
30 | setFocusPolicy( NoFocus ); | 27 | setFocusPolicy( NoFocus ); |
31 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); | 28 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); |
32 | } | 29 | } |
33 | 30 | ||
34 | LauncherTabBar::~LauncherTabBar() | 31 | LauncherTabBar::~LauncherTabBar() |
35 | { | 32 | { |
36 | } | 33 | } |
37 | 34 | ||
38 | void LauncherTabBar::insertTab( LauncherTab *t, int index ) | 35 | void LauncherTabBar::insertTab( LauncherTab *t, int index ) |
39 | { | 36 | { |
40 | if ( index < 0 ) | 37 | if ( index < 0 ) |
41 | items.append( t ); | 38 | items.append( t ); |
42 | else | 39 | else |
43 | items.insert( (uint)index, t ); | 40 | items.insert( (uint)index, t ); |
44 | tabs.insert( t->type, t ); | 41 | tabs.insert( t->type, t ); |
45 | QTabBar::insertTab( t, index ); | 42 | QTabBar::insertTab( t, index ); |
46 | } | 43 | } |
47 | 44 | ||
48 | void LauncherTabBar::removeTab( QTab *tab ) | 45 | void LauncherTabBar::removeTab( QTab *tab ) |
49 | { | 46 | { |
50 | LauncherTab *t = (LauncherTab *)tab; | 47 | LauncherTab *t = (LauncherTab *)tab; |
51 | tabs.remove( t->type ); | 48 | tabs.remove( t->type ); |
52 | items.remove( t ); | 49 | items.remove( t ); |
53 | QTabBar::removeTab( t ); | 50 | QTabBar::removeTab( t ); |
54 | } | 51 | } |
55 | 52 | ||
56 | void LauncherTabBar::prevTab() | 53 | void LauncherTabBar::prevTab() |
57 | { | 54 | { |
58 | int n = count(); | 55 | int n = count(); |
59 | int tab = currentTab(); | 56 | int tab = currentTab(); |
60 | if ( tab >= 0 ) | 57 | if ( tab >= 0 ) |
61 | setCurrentTab( (tab - 1 + n)%n ); | 58 | setCurrentTab( (tab - 1 + n)%n ); |
62 | } | 59 | } |
63 | 60 | ||
64 | void LauncherTabBar::nextTab() | 61 | void LauncherTabBar::nextTab() |
65 | { | 62 | { |
66 | int n = count(); | 63 | int n = count(); |
67 | int tab = currentTab(); | 64 | int tab = currentTab(); |
68 | setCurrentTab( (tab + 1)%n ); | 65 | setCurrentTab( (tab + 1)%n ); |
69 | } | 66 | } |
70 | 67 | ||
71 | void LauncherTabBar::showTab( const QString& id ) | 68 | void LauncherTabBar::showTab( const QString& id ) |
72 | { | 69 | { |
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 62c678d..513b1bd 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -1,94 +1,80 @@ | |||
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 "launcherview.h" | 21 | #include "launcherview.h" |
22 | 22 | ||
23 | #include <qtopia/qpeapplication.h> | 23 | #include <qtopia/qpeapplication.h> |
24 | #include <qtopia/applnk.h> | ||
25 | #include <qtopia/qpedebug.h> | ||
26 | #include <qtopia/private/categories.h> | 24 | #include <qtopia/private/categories.h> |
27 | #include <qtopia/categoryselect.h> | 25 | #include <qtopia/categoryselect.h> |
28 | #include <qtopia/menubutton.h> | ||
29 | #include <qtopia/mimetype.h> | 26 | #include <qtopia/mimetype.h> |
30 | #include <qtopia/resource.h> | 27 | #include <qtopia/resource.h> |
31 | #include <qtopia/qpetoolbar.h> | ||
32 | //#include <qtopia/private/palmtoprecord.h> | 28 | //#include <qtopia/private/palmtoprecord.h> |
33 | 29 | ||
34 | #include <qtimer.h> | 30 | #include <qtimer.h> |
35 | #include <qtextstream.h> | ||
36 | #include <qdict.h> | ||
37 | #include <qfile.h> | ||
38 | #include <qfileinfo.h> | 31 | #include <qfileinfo.h> |
39 | #include <qhbox.h> | ||
40 | #include <qiconview.h> | 32 | #include <qiconview.h> |
41 | #include <qwidgetstack.h> | ||
42 | #include <qpainter.h> | ||
43 | #include <qregexp.h> | ||
44 | #include <qtoolbutton.h> | ||
45 | #include <qimage.h> | ||
46 | #include <qlabel.h> | ||
47 | #include <qobjectlist.h> | 33 | #include <qobjectlist.h> |
48 | 34 | ||
49 | 35 | ||
50 | // These define how the busy icon is animated and highlighted | 36 | // These define how the busy icon is animated and highlighted |
51 | #define BRIGHTEN_BUSY_ICON | 37 | #define BRIGHTEN_BUSY_ICON |
52 | //#define ALPHA_FADE_BUSY_ICON | 38 | //#define ALPHA_FADE_BUSY_ICON |
53 | //#define USE_ANIMATED_BUSY_ICON_OVERLAY | 39 | //#define USE_ANIMATED_BUSY_ICON_OVERLAY |
54 | #define BOUNCE_BUSY_ICON | 40 | #define BOUNCE_BUSY_ICON |
55 | 41 | ||
56 | 42 | ||
57 | class BgPixmap | 43 | class BgPixmap |
58 | { | 44 | { |
59 | public: | 45 | public: |
60 | BgPixmap( const QPixmap &p ) : pm(p), ref(1) {} | 46 | BgPixmap( const QPixmap &p ) : pm(p), ref(1) {} |
61 | QPixmap pm; | 47 | QPixmap pm; |
62 | int ref; | 48 | int ref; |
63 | }; | 49 | }; |
64 | 50 | ||
65 | 51 | ||
66 | static QMap<QString,BgPixmap*> *bgCache = 0; | 52 | static QMap<QString,BgPixmap*> *bgCache = 0; |
67 | 53 | ||
68 | static void cleanup_cache() | 54 | static void cleanup_cache() |
69 | { | 55 | { |
70 | QMap<QString,BgPixmap*>::Iterator it = bgCache->begin(); | 56 | QMap<QString,BgPixmap*>::Iterator it = bgCache->begin(); |
71 | while ( it != bgCache->end() ) { | 57 | while ( it != bgCache->end() ) { |
72 | QMap<QString,BgPixmap*>::Iterator curr = it; | 58 | QMap<QString,BgPixmap*>::Iterator curr = it; |
73 | ++it; | 59 | ++it; |
74 | delete (*curr); | 60 | delete (*curr); |
75 | bgCache->remove( curr ); | 61 | bgCache->remove( curr ); |
76 | } | 62 | } |
77 | delete bgCache; | 63 | delete bgCache; |
78 | bgCache = 0; | 64 | bgCache = 0; |
79 | } | 65 | } |
80 | 66 | ||
81 | 67 | ||
82 | class LauncherItem : public QIconViewItem | 68 | class LauncherItem : public QIconViewItem |
83 | { | 69 | { |
84 | public: | 70 | public: |
85 | LauncherItem( QIconView *parent, AppLnk* applnk, bool bigIcon=TRUE ); | 71 | LauncherItem( QIconView *parent, AppLnk* applnk, bool bigIcon=TRUE ); |
86 | ~LauncherItem(); | 72 | ~LauncherItem(); |
87 | 73 | ||
88 | AppLnk *appLnk() const { return app; } | 74 | AppLnk *appLnk() const { return app; } |
89 | AppLnk *takeAppLnk() { AppLnk* r=app; app=0; return r; } | 75 | AppLnk *takeAppLnk() { AppLnk* r=app; app=0; return r; } |
90 | 76 | ||
91 | void animateIcon(); | 77 | void animateIcon(); |
92 | void resetIcon(); | 78 | void resetIcon(); |
93 | 79 | ||
94 | virtual int compare ( QIconViewItem * i ) const; | 80 | virtual int compare ( QIconViewItem * i ) const; |
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 9e53bb0..c136bd9 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -1,87 +1,82 @@ | |||
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 | #ifndef QTOPIA_INTERNAL_FILEOPERATIONS | 21 | #ifndef QTOPIA_INTERNAL_FILEOPERATIONS |
22 | #define QTOPIA_INTERNAL_FILEOPERATIONS | 22 | #define QTOPIA_INTERNAL_FILEOPERATIONS |
23 | #endif | 23 | #endif |
24 | #include "server.h" | 24 | #include "server.h" |
25 | #include "serverapp.h" | 25 | #include "serverapp.h" |
26 | #include "taskbar.h" | ||
27 | #include "stabmon.h" | 26 | #include "stabmon.h" |
28 | #include "launcher.h" | ||
29 | #include "firstuse.h" | 27 | #include "firstuse.h" |
30 | 28 | ||
31 | #include <opie2/oglobal.h> | 29 | #include <opie2/oglobal.h> |
32 | 30 | ||
33 | #include <qtopia/qpeapplication.h> | ||
34 | #include <qtopia/network.h> | 31 | #include <qtopia/network.h> |
35 | #include <qtopia/config.h> | ||
36 | //#include <qtopia/custom.h> | 32 | //#include <qtopia/custom.h> |
37 | 33 | ||
38 | 34 | ||
39 | #include <qfile.h> | ||
40 | #include <qdir.h> | 35 | #include <qdir.h> |
41 | #ifdef QWS | 36 | #ifdef QWS |
42 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
43 | #include <qtopia/qcopenvelope_qws.h> | 38 | #include <qtopia/qcopenvelope_qws.h> |
44 | #endif | 39 | #endif |
45 | #include <qtopia/alarmserver.h> | 40 | #include <qtopia/alarmserver.h> |
46 | 41 | ||
47 | #include <stdlib.h> | 42 | #include <stdlib.h> |
48 | #include <stdio.h> | 43 | #include <stdio.h> |
49 | #include <signal.h> | 44 | #include <signal.h> |
50 | #ifndef Q_OS_WIN32 | 45 | #ifndef Q_OS_WIN32 |
51 | #include <unistd.h> | 46 | #include <unistd.h> |
52 | #else | 47 | #else |
53 | #include <process.h> | 48 | #include <process.h> |
54 | #endif | 49 | #endif |
55 | 50 | ||
56 | #include "calibrate.h" | 51 | #include "calibrate.h" |
57 | 52 | ||
58 | 53 | ||
59 | #ifdef QT_QWS_LOGIN | 54 | #ifdef QT_QWS_LOGIN |
60 | #include "../login/qdmdialogimpl.h" | 55 | #include "../login/qdmdialogimpl.h" |
61 | #endif | 56 | #endif |
62 | 57 | ||
63 | #ifdef Q_WS_QWS | 58 | #ifdef Q_WS_QWS |
64 | #include <qkeyboard_qws.h> | 59 | #include <qkeyboard_qws.h> |
65 | #endif | 60 | #endif |
66 | 61 | ||
67 | #include <qmessagebox.h> | 62 | #include <qmessagebox.h> |
68 | #include <opie2/odevice.h> | 63 | #include <opie2/odevice.h> |
69 | 64 | ||
70 | using namespace Opie; | 65 | using namespace Opie; |
71 | 66 | ||
72 | 67 | ||
73 | static void cleanup() | 68 | static void cleanup() |
74 | { | 69 | { |
75 | QDir dir( "/tmp", "qcop-msg-*" ); | 70 | QDir dir( "/tmp", "qcop-msg-*" ); |
76 | 71 | ||
77 | QStringList stale = dir.entryList(); | 72 | QStringList stale = dir.entryList(); |
78 | QStringList::Iterator it; | 73 | QStringList::Iterator it; |
79 | for ( it = stale.begin(); it != stale.end(); ++it ) { | 74 | for ( it = stale.begin(); it != stale.end(); ++it ) { |
80 | dir.remove( *it ); | 75 | dir.remove( *it ); |
81 | } | 76 | } |
82 | } | 77 | } |
83 | 78 | ||
84 | static void refreshTimeZoneConfig() | 79 | static void refreshTimeZoneConfig() |
85 | { | 80 | { |
86 | /* ### FIXME timezone handling */ | 81 | /* ### FIXME timezone handling */ |
87 | #if 0 | 82 | #if 0 |
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp index bf34368..321b5dd 100644 --- a/core/launcher/packageslave.cpp +++ b/core/launcher/packageslave.cpp | |||
@@ -1,82 +1,80 @@ | |||
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 "packageslave.h" | 21 | #include "packageslave.h" |
22 | #include <qtopia/qprocess.h> | 22 | #include <qtopia/qprocess.h> |
23 | 23 | ||
24 | #ifdef Q_WS_QWS | 24 | #ifdef Q_WS_QWS |
25 | #include <qtopia/qcopenvelope_qws.h> | 25 | #include <qtopia/qcopenvelope_qws.h> |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #include <qdatastream.h> | ||
29 | #ifdef Q_WS_QWS | 28 | #ifdef Q_WS_QWS |
30 | #include <qcopchannel_qws.h> | 29 | #include <qcopchannel_qws.h> |
31 | #endif | 30 | #endif |
32 | 31 | ||
33 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
34 | #include <qdir.h> | ||
35 | 33 | ||
36 | #include <stdlib.h> | 34 | #include <stdlib.h> |
37 | #include <sys/stat.h> // mkdir() | 35 | #include <sys/stat.h> // mkdir() |
38 | 36 | ||
39 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 37 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
40 | #include <unistd.h> | 38 | #include <unistd.h> |
41 | #include <sys/vfs.h> | 39 | #include <sys/vfs.h> |
42 | #include <mntent.h> | 40 | #include <mntent.h> |
43 | #elif defined(Q_OS_WIN32) | 41 | #elif defined(Q_OS_WIN32) |
44 | #include <windows.h> | 42 | #include <windows.h> |
45 | #include <winbase.h> | 43 | #include <winbase.h> |
46 | #elif defined(Q_OS_MACX) | 44 | #elif defined(Q_OS_MACX) |
47 | #include <unistd.h> | 45 | #include <unistd.h> |
48 | #endif | 46 | #endif |
49 | 47 | ||
50 | 48 | ||
51 | PackageHandler::PackageHandler( QObject *parent, char* name ) | 49 | PackageHandler::PackageHandler( QObject *parent, char* name ) |
52 | : QObject( parent, name ), packageChannel( 0 ), currentProcess( 0 ), mNoSpaceLeft( FALSE ) | 50 | : QObject( parent, name ), packageChannel( 0 ), currentProcess( 0 ), mNoSpaceLeft( FALSE ) |
53 | { | 51 | { |
54 | // setup qcop channel | 52 | // setup qcop channel |
55 | #ifndef QT_NO_COP | 53 | #ifndef QT_NO_COP |
56 | packageChannel = new QCopChannel( "QPE/Package", this ); | 54 | packageChannel = new QCopChannel( "QPE/Package", this ); |
57 | connect( packageChannel, SIGNAL( received(const QCString &, const QByteArray &) ), | 55 | connect( packageChannel, SIGNAL( received(const QCString &, const QByteArray &) ), |
58 | this, SLOT( qcopMessage( const QCString &, const QByteArray &) ) ); | 56 | this, SLOT( qcopMessage( const QCString &, const QByteArray &) ) ); |
59 | #endif | 57 | #endif |
60 | } | 58 | } |
61 | 59 | ||
62 | void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) | 60 | void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) |
63 | { | 61 | { |
64 | QDataStream stream( data, IO_ReadOnly ); | 62 | QDataStream stream( data, IO_ReadOnly ); |
65 | 63 | ||
66 | if ( msg == "installPackage(QString)" ) { | 64 | if ( msg == "installPackage(QString)" ) { |
67 | QString file; | 65 | QString file; |
68 | stream >> file; | 66 | stream >> file; |
69 | installPackage( file ); | 67 | installPackage( file ); |
70 | } else if ( msg == "removePackage(QString)" ) { | 68 | } else if ( msg == "removePackage(QString)" ) { |
71 | QString file; | 69 | QString file; |
72 | stream >> file; | 70 | stream >> file; |
73 | removePackage( file ); | 71 | removePackage( file ); |
74 | } else if ( msg == "addPackageFiles(QString,QString)" ) { | 72 | } else if ( msg == "addPackageFiles(QString,QString)" ) { |
75 | QString location, listfile; | 73 | QString location, listfile; |
76 | stream >> location >> listfile; | 74 | stream >> location >> listfile; |
77 | addPackageFiles( location, listfile); | 75 | addPackageFiles( location, listfile); |
78 | } else if ( msg == "addPackages(QString)" ) { | 76 | } else if ( msg == "addPackages(QString)" ) { |
79 | QString location; | 77 | QString location; |
80 | stream >> location; | 78 | stream >> location; |
81 | addPackages( location ); | 79 | addPackages( location ); |
82 | } else if ( msg == "cleanupPackageFiles(QString)" ) { | 80 | } else if ( msg == "cleanupPackageFiles(QString)" ) { |
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp index 9bca360..24f471d 100644 --- a/core/launcher/qcopbridge.cpp +++ b/core/launcher/qcopbridge.cpp | |||
@@ -1,89 +1,81 @@ | |||
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 "qcopbridge.h" | 21 | #include "qcopbridge.h" |
22 | #include "transferserver.h" | 22 | #include "transferserver.h" |
23 | 23 | ||
24 | #include <opie2/oglobal.h> | 24 | #include <opie2/oglobal.h> |
25 | 25 | ||
26 | #ifdef Q_WS_QWS | 26 | #ifdef Q_WS_QWS |
27 | #include <qtopia/qcopenvelope_qws.h> | 27 | #include <qtopia/qcopenvelope_qws.h> |
28 | #endif | 28 | #endif |
29 | #include <qtopia/qpeapplication.h> | 29 | #include <qtopia/qpeapplication.h> |
30 | 30 | ||
31 | #include <qtopia/version.h> | 31 | #include <qtopia/version.h> |
32 | #include <qtopia/config.h> | ||
33 | 32 | ||
34 | #include <qdir.h> | ||
35 | #include <qfile.h> | ||
36 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
37 | #include <qdatastream.h> | ||
38 | #include <qcstring.h> | ||
39 | #include <qstringlist.h> | ||
40 | #include <qfileinfo.h> | ||
41 | #include <qregexp.h> | ||
42 | #include <qtimer.h> | 34 | #include <qtimer.h> |
43 | #ifdef Q_WS_QWS | 35 | #ifdef Q_WS_QWS |
44 | #include <qcopchannel_qws.h> | 36 | #include <qcopchannel_qws.h> |
45 | #endif | 37 | #endif |
46 | 38 | ||
47 | #ifndef _XOPEN_SOURCE | 39 | #ifndef _XOPEN_SOURCE |
48 | #define _XOPEN_SOURCE | 40 | #define _XOPEN_SOURCE |
49 | #endif | 41 | #endif |
50 | #ifndef Q_OS_WIN32 | 42 | #ifndef Q_OS_WIN32 |
51 | #include <pwd.h> | 43 | #include <pwd.h> |
52 | #include <unistd.h> | 44 | #include <unistd.h> |
53 | #include <sys/types.h> | 45 | #include <sys/types.h> |
54 | #endif | 46 | #endif |
55 | 47 | ||
56 | #if defined(_OS_LINUX_) | 48 | #if defined(_OS_LINUX_) |
57 | #include <shadow.h> | 49 | #include <shadow.h> |
58 | #endif | 50 | #endif |
59 | 51 | ||
60 | 52 | ||
61 | //#define INSECURE | 53 | //#define INSECURE |
62 | 54 | ||
63 | const int block_size = 51200; | 55 | const int block_size = 51200; |
64 | 56 | ||
65 | QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, | 57 | QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, |
66 | const char* name ) | 58 | const char* name ) |
67 | : QServerSocket( port, 1, parent, name ), | 59 | : QServerSocket( port, 1, parent, name ), |
68 | desktopChannel( 0 ), | 60 | desktopChannel( 0 ), |
69 | cardChannel( 0 ) | 61 | cardChannel( 0 ) |
70 | { | 62 | { |
71 | if ( !ok() ) | 63 | if ( !ok() ) |
72 | qWarning( "Failed to bind to port %d", port ); | 64 | qWarning( "Failed to bind to port %d", port ); |
73 | else { | 65 | else { |
74 | #ifndef QT_NO_COP | 66 | #ifndef QT_NO_COP |
75 | desktopChannel = new QCopChannel( "QPE/Desktop", this ); | 67 | desktopChannel = new QCopChannel( "QPE/Desktop", this ); |
76 | connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 68 | connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
77 | this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); | 69 | this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); |
78 | cardChannel = new QCopChannel( "QPE/Card", this ); | 70 | cardChannel = new QCopChannel( "QPE/Card", this ); |
79 | connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 71 | connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
80 | this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); | 72 | this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); |
81 | #endif | 73 | #endif |
82 | } | 74 | } |
83 | sendSync = FALSE; | 75 | sendSync = FALSE; |
84 | openConnections.setAutoDelete( TRUE ); | 76 | openConnections.setAutoDelete( TRUE ); |
85 | authorizeConnections(); | 77 | authorizeConnections(); |
86 | } | 78 | } |
87 | 79 | ||
88 | QCopBridge::~QCopBridge() | 80 | QCopBridge::~QCopBridge() |
89 | { | 81 | { |
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp index 1fda5a4..11d10dc 100644 --- a/core/launcher/runningappbar.cpp +++ b/core/launcher/runningappbar.cpp | |||
@@ -1,83 +1,76 @@ | |||
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 | #define QTOPIA_INTERNAL_PRELOADACCESS | 21 | #define QTOPIA_INTERNAL_PRELOADACCESS |
22 | 22 | ||
23 | #include <qtopia/global.h> | ||
24 | 23 | ||
25 | #include <stdlib.h> | 24 | #include <stdlib.h> |
26 | 25 | ||
27 | #include <qtimer.h> | ||
28 | #include <qpopupmenu.h> | ||
29 | #include <qpainter.h> | 26 | #include <qpainter.h> |
30 | #include <qmessagebox.h> | ||
31 | 27 | ||
32 | #include <qtopia/qpeapplication.h> | ||
33 | #include <qtopia/applnk.h> | ||
34 | #include <qtopia/qcopenvelope_qws.h> | 28 | #include <qtopia/qcopenvelope_qws.h> |
35 | #include <qtopia/mimetype.h> | ||
36 | 29 | ||
37 | #include "runningappbar.h" | 30 | #include "runningappbar.h" |
38 | #include "serverinterface.h" | 31 | #include "serverinterface.h" |
39 | 32 | ||
40 | RunningAppBar::RunningAppBar(QWidget* parent) | 33 | RunningAppBar::RunningAppBar(QWidget* parent) |
41 | : QFrame(parent), selectedAppIndex(-1) | 34 | : QFrame(parent), selectedAppIndex(-1) |
42 | { | 35 | { |
43 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); | 36 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); |
44 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 37 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
45 | this, SLOT(received(const QCString&, const QByteArray&)) ); | 38 | this, SLOT(received(const QCString&, const QByteArray&)) ); |
46 | 39 | ||
47 | spacing = AppLnk::smallIconSize()+3; | 40 | spacing = AppLnk::smallIconSize()+3; |
48 | } | 41 | } |
49 | 42 | ||
50 | RunningAppBar::~RunningAppBar() | 43 | RunningAppBar::~RunningAppBar() |
51 | { | 44 | { |
52 | } | 45 | } |
53 | 46 | ||
54 | void RunningAppBar::received(const QCString& msg, const QByteArray& data) { | 47 | void RunningAppBar::received(const QCString& msg, const QByteArray& data) { |
55 | // Since fast apps appear and disappear without disconnecting from their | 48 | // Since fast apps appear and disappear without disconnecting from their |
56 | // channel we need to watch for the showing/hiding events and update according. | 49 | // channel we need to watch for the showing/hiding events and update according. |
57 | QDataStream stream( data, IO_ReadOnly ); | 50 | QDataStream stream( data, IO_ReadOnly ); |
58 | if ( msg == "fastAppShowing(QString)") { | 51 | if ( msg == "fastAppShowing(QString)") { |
59 | QString appName; | 52 | QString appName; |
60 | stream >> appName; | 53 | stream >> appName; |
61 | // qDebug("fastAppShowing %s", appName.data() ); | 54 | // qDebug("fastAppShowing %s", appName.data() ); |
62 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); | 55 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); |
63 | if ( f ) addTask(*f); | 56 | if ( f ) addTask(*f); |
64 | } else if ( msg == "fastAppHiding(QString)") { | 57 | } else if ( msg == "fastAppHiding(QString)") { |
65 | QString appName; | 58 | QString appName; |
66 | stream >> appName; | 59 | stream >> appName; |
67 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); | 60 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); |
68 | if ( f ) removeTask(*f); | 61 | if ( f ) removeTask(*f); |
69 | } | 62 | } |
70 | } | 63 | } |
71 | 64 | ||
72 | void RunningAppBar::addTask(const AppLnk& appLnk) { | 65 | void RunningAppBar::addTask(const AppLnk& appLnk) { |
73 | qDebug("Added %s to app list.", appLnk.name().latin1()); | 66 | qDebug("Added %s to app list.", appLnk.name().latin1()); |
74 | AppLnk* newApp = new AppLnk(appLnk); | 67 | AppLnk* newApp = new AppLnk(appLnk); |
75 | newApp->setExec(appLnk.exec()); | 68 | newApp->setExec(appLnk.exec()); |
76 | appList.prepend(newApp); | 69 | appList.prepend(newApp); |
77 | update(); | 70 | update(); |
78 | } | 71 | } |
79 | 72 | ||
80 | void RunningAppBar::removeTask(const AppLnk& appLnk) { | 73 | void RunningAppBar::removeTask(const AppLnk& appLnk) { |
81 | unsigned int i = 0; | 74 | unsigned int i = 0; |
82 | for (; i < appList.count() ; i++) { | 75 | for (; i < appList.count() ; i++) { |
83 | AppLnk* target = appList.at(i); | 76 | AppLnk* target = appList.at(i); |
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp index 1146dcd..e544c61 100644 --- a/core/launcher/screensaver.cpp +++ b/core/launcher/screensaver.cpp | |||
@@ -1,53 +1,52 @@ | |||
1 | 1 | ||
2 | #include "screensaver.h" | 2 | #include "screensaver.h" |
3 | 3 | ||
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | #include <qpe/power.h> | ||
6 | #include <qpe/network.h> | 5 | #include <qpe/network.h> |
7 | 6 | ||
8 | #include <opie2/odevice.h> | 7 | #include <opie2/odevice.h> |
9 | 8 | ||
10 | 9 | ||
11 | using namespace Opie; | 10 | using namespace Opie; |
12 | 11 | ||
13 | 12 | ||
14 | 13 | ||
15 | OpieScreenSaver::OpieScreenSaver ( ) | 14 | OpieScreenSaver::OpieScreenSaver ( ) |
16 | : QObject ( 0, "screensaver" ), QWSScreenSaver ( ) | 15 | : QObject ( 0, "screensaver" ), QWSScreenSaver ( ) |
17 | { | 16 | { |
18 | m_disable_suspend = 100; | 17 | m_disable_suspend = 100; |
19 | m_enable_dim = false; | 18 | m_enable_dim = false; |
20 | m_enable_lightoff = false; | 19 | m_enable_lightoff = false; |
21 | m_enable_suspend = false; | 20 | m_enable_suspend = false; |
22 | m_onlylcdoff = false; | 21 | m_onlylcdoff = false; |
23 | 22 | ||
24 | m_enable_dim_ac = false; | 23 | m_enable_dim_ac = false; |
25 | m_enable_lightoff_ac = false; | 24 | m_enable_lightoff_ac = false; |
26 | m_enable_suspend_ac = false; | 25 | m_enable_suspend_ac = false; |
27 | m_onlylcdoff_ac = false; | 26 | m_onlylcdoff_ac = false; |
28 | 27 | ||
29 | m_use_light_sensor = false; | 28 | m_use_light_sensor = false; |
30 | m_backlight_sensor = -1; | 29 | m_backlight_sensor = -1; |
31 | ::memset ( m_sensordata, 0xff, LS_Count * sizeof( m_sensordata [0] )); | 30 | ::memset ( m_sensordata, 0xff, LS_Count * sizeof( m_sensordata [0] )); |
32 | 31 | ||
33 | m_lcd_status = true; | 32 | m_lcd_status = true; |
34 | 33 | ||
35 | m_backlight_normal = -1; | 34 | m_backlight_normal = -1; |
36 | m_backlight_current = -1; | 35 | m_backlight_current = -1; |
37 | m_backlight_forcedoff = false; | 36 | m_backlight_forcedoff = false; |
38 | 37 | ||
39 | m_on_ac = false; | 38 | m_on_ac = false; |
40 | 39 | ||
41 | m_level = -1; | 40 | m_level = -1; |
42 | 41 | ||
43 | // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) | 42 | // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) |
44 | ODevice::inst ( )-> setDisplayStatus ( true ); | 43 | ODevice::inst ( )-> setDisplayStatus ( true ); |
45 | setBacklight ( -1 ); | 44 | setBacklight ( -1 ); |
46 | } | 45 | } |
47 | 46 | ||
48 | 47 | ||
49 | /** | 48 | /** |
50 | * Stops the screen saver | 49 | * Stops the screen saver |
51 | */ | 50 | */ |
52 | void OpieScreenSaver::restore() | 51 | void OpieScreenSaver::restore() |
53 | { | 52 | { |
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp index 32fcdd0..068d716 100644 --- a/core/launcher/server.cpp +++ b/core/launcher/server.cpp | |||
@@ -1,80 +1,79 @@ | |||
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 "launcher.h" | ||
24 | #include "startmenu.h" | 23 | #include "startmenu.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 "launcher.h" | ||
33 | #include "shutdownimpl.h" | 32 | #include "shutdownimpl.h" |
34 | #include "applauncher.h" | 33 | #include "applauncher.h" |
35 | #if 0 | 34 | #if 0 |
36 | #include "suspendmonitor.h" | 35 | #include "suspendmonitor.h" |
37 | #endif | 36 | #endif |
38 | #include "documentlist.h" | 37 | #include "documentlist.h" |
39 | 38 | ||
40 | #include <qtopia/applnk.h> | 39 | #include <qtopia/applnk.h> |
41 | #include <qtopia/private/categories.h> | 40 | #include <qtopia/private/categories.h> |
42 | #include <qtopia/mimetype.h> | 41 | #include <qtopia/mimetype.h> |
43 | #include <qtopia/config.h> | 42 | #include <qtopia/config.h> |
44 | #include <qtopia/resource.h> | 43 | #include <qtopia/resource.h> |
45 | #include <qtopia/version.h> | 44 | #include <qtopia/version.h> |
46 | #include <qtopia/storage.h> | 45 | #include <qtopia/storage.h> |
47 | 46 | ||
48 | #include <qtopia/qcopenvelope_qws.h> | 47 | #include <qtopia/qcopenvelope_qws.h> |
49 | #include <qwindowsystem_qws.h> | 48 | #include <qwindowsystem_qws.h> |
50 | #include <qgfx_qws.h> | 49 | #include <qgfx_qws.h> |
51 | #include <qtopia/global.h> | 50 | #include <qtopia/global.h> |
52 | //#include <qtopia/custom.h> | 51 | //#include <qtopia/custom.h> |
53 | 52 | ||
54 | #include <opie2/odevicebutton.h> | 53 | #include <opie2/odevicebutton.h> |
55 | #include <opie2/odevice.h> | 54 | #include <opie2/odevice.h> |
56 | 55 | ||
57 | #include <unistd.h> | 56 | #include <unistd.h> |
58 | #include <qmainwindow.h> | 57 | #include <qmainwindow.h> |
59 | #include <qmessagebox.h> | 58 | #include <qmessagebox.h> |
60 | #include <qtimer.h> | 59 | #include <qtimer.h> |
61 | #include <qtextstream.h> | 60 | #include <qtextstream.h> |
62 | 61 | ||
63 | #include <stdlib.h> | 62 | #include <stdlib.h> |
64 | 63 | ||
65 | extern QRect qt_maxWindowRect; | 64 | extern QRect qt_maxWindowRect; |
66 | 65 | ||
67 | using namespace Opie; | 66 | using namespace Opie; |
68 | 67 | ||
69 | static QWidget *calibrate(bool) | 68 | static QWidget *calibrate(bool) |
70 | { | 69 | { |
71 | #ifdef Q_WS_QWS | 70 | #ifdef Q_WS_QWS |
72 | Calibrate *c = new Calibrate; | 71 | Calibrate *c = new Calibrate; |
73 | c->show(); | 72 | c->show(); |
74 | return c; | 73 | return c; |
75 | #else | 74 | #else |
76 | return 0; | 75 | return 0; |
77 | #endif | 76 | #endif |
78 | } | 77 | } |
79 | 78 | ||
80 | #define FACTORY(T) \ | 79 | #define FACTORY(T) \ |
diff --git a/core/launcher/shutdownimpl.cpp b/core/launcher/shutdownimpl.cpp index 899d9ac..f43a2a3 100644 --- a/core/launcher/shutdownimpl.cpp +++ b/core/launcher/shutdownimpl.cpp | |||
@@ -1,80 +1,79 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of 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 "shutdownimpl.h" | 21 | #include "shutdownimpl.h" |
22 | 22 | ||
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | 25 | ||
26 | #include <qtimer.h> | 26 | #include <qtimer.h> |
27 | #include <qprogressbar.h> | 27 | #include <qprogressbar.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qbuttongroup.h> | 29 | #include <qbuttongroup.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qpalette.h> | ||
33 | 32 | ||
34 | 33 | ||
35 | static void changeButtonColor ( QPushButton *btn, const QColor &col ) | 34 | static void changeButtonColor ( QPushButton *btn, const QColor &col ) |
36 | { | 35 | { |
37 | QPalette pal = btn-> palette ( ); | 36 | QPalette pal = btn-> palette ( ); |
38 | 37 | ||
39 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); | 38 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); |
40 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); | 39 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); |
41 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); | 40 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); |
42 | 41 | ||
43 | btn-> setPalette ( pal ); | 42 | btn-> setPalette ( pal ); |
44 | } | 43 | } |
45 | 44 | ||
46 | 45 | ||
47 | ShutdownImpl::ShutdownImpl( QWidget* parent, const char *name, WFlags fl ) | 46 | ShutdownImpl::ShutdownImpl( QWidget* parent, const char *name, WFlags fl ) |
48 | : QWidget ( parent, name, fl ) | 47 | : QWidget ( parent, name, fl ) |
49 | { | 48 | { |
50 | setCaption ( tr( "Shutdown..." ) ); | 49 | setCaption ( tr( "Shutdown..." ) ); |
51 | 50 | ||
52 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | 51 | QVBoxLayout *vbox = new QVBoxLayout ( this ); |
53 | vbox-> setSpacing ( 3 ); | 52 | vbox-> setSpacing ( 3 ); |
54 | vbox-> setMargin ( 6 ); | 53 | vbox-> setMargin ( 6 ); |
55 | 54 | ||
56 | QButtonGroup *btngrp = new QButtonGroup ( this ); | 55 | QButtonGroup *btngrp = new QButtonGroup ( this ); |
57 | 56 | ||
58 | btngrp-> setTitle ( tr( "Terminate" ) ); | 57 | btngrp-> setTitle ( tr( "Terminate" ) ); |
59 | btngrp-> setColumnLayout ( 0, Qt::Vertical ); | 58 | btngrp-> setColumnLayout ( 0, Qt::Vertical ); |
60 | btngrp-> layout ( ) -> setSpacing ( 0 ); | 59 | btngrp-> layout ( ) -> setSpacing ( 0 ); |
61 | btngrp-> layout ( ) -> setMargin ( 0 ); | 60 | btngrp-> layout ( ) -> setMargin ( 0 ); |
62 | 61 | ||
63 | QGridLayout *grid = new QGridLayout ( btngrp-> layout ( ) ); | 62 | QGridLayout *grid = new QGridLayout ( btngrp-> layout ( ) ); |
64 | grid-> setAlignment ( Qt::AlignTop ); | 63 | grid-> setAlignment ( Qt::AlignTop ); |
65 | grid-> setSpacing ( 3 ); | 64 | grid-> setSpacing ( 3 ); |
66 | grid-> setMargin ( 7 ); | 65 | grid-> setMargin ( 7 ); |
67 | 66 | ||
68 | QPushButton *quit = new QPushButton ( tr( "Terminate Opie" ), btngrp, "quit" ); | 67 | QPushButton *quit = new QPushButton ( tr( "Terminate Opie" ), btngrp, "quit" ); |
69 | changeButtonColor ( quit, QColor ( 236, 236, 179 ) ); | 68 | changeButtonColor ( quit, QColor ( 236, 236, 179 ) ); |
70 | btngrp-> insert ( quit, 4 ); | 69 | btngrp-> insert ( quit, 4 ); |
71 | grid-> addWidget ( quit, 1, 1 ); | 70 | grid-> addWidget ( quit, 1, 1 ); |
72 | 71 | ||
73 | QPushButton *reboot = new QPushButton ( tr( "Reboot" ), btngrp, "reboot" ); | 72 | QPushButton *reboot = new QPushButton ( tr( "Reboot" ), btngrp, "reboot" ); |
74 | changeButtonColor ( reboot, QColor( 236, 183, 181 ) ); | 73 | changeButtonColor ( reboot, QColor( 236, 183, 181 ) ); |
75 | btngrp-> insert ( reboot, 2 ); | 74 | btngrp-> insert ( reboot, 2 ); |
76 | grid-> addWidget( reboot, 1, 0 ); | 75 | grid-> addWidget( reboot, 1, 0 ); |
77 | 76 | ||
78 | QPushButton *restart = new QPushButton ( tr( "Restart Opie" ), btngrp, "restart" ); | 77 | QPushButton *restart = new QPushButton ( tr( "Restart Opie" ), btngrp, "restart" ); |
79 | changeButtonColor ( restart, QColor( 236, 236, 179 ) ); | 78 | changeButtonColor ( restart, QColor( 236, 236, 179 ) ); |
80 | btngrp-> insert ( restart, 3 ); | 79 | btngrp-> insert ( restart, 3 ); |
diff --git a/core/launcher/stabmon.cpp b/core/launcher/stabmon.cpp index 4e5f290..f2d694b 100644 --- a/core/launcher/stabmon.cpp +++ b/core/launcher/stabmon.cpp | |||
@@ -1,77 +1,76 @@ | |||
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 | 21 | ||
22 | #include "stabmon.h" | 22 | #include "stabmon.h" |
23 | 23 | ||
24 | #ifdef QWS | 24 | #ifdef QWS |
25 | #include <qtopia/qcopenvelope_qws.h> | 25 | #include <qtopia/qcopenvelope_qws.h> |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #include <qfile.h> | 28 | #include <qfile.h> |
29 | #include <qcstring.h> | ||
30 | 29 | ||
31 | #include <sys/stat.h> | 30 | #include <sys/stat.h> |
32 | #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) | 31 | #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) |
33 | #include <unistd.h> | 32 | #include <unistd.h> |
34 | #endif | 33 | #endif |
35 | #include <stdlib.h> | 34 | #include <stdlib.h> |
36 | 35 | ||
37 | SysFileMonitor::SysFileMonitor(QObject* parent) : | 36 | SysFileMonitor::SysFileMonitor(QObject* parent) : |
38 | QObject(parent) | 37 | QObject(parent) |
39 | { | 38 | { |
40 | startTimer(2000); | 39 | startTimer(2000); |
41 | } | 40 | } |
42 | 41 | ||
43 | const char * stab0 = "/var/run/stab"; | 42 | const char * stab0 = "/var/run/stab"; |
44 | const char * stab1 = "/var/state/pcmcia/stab"; | 43 | const char * stab1 = "/var/state/pcmcia/stab"; |
45 | const char * stab2 = "/var/lib/pcmcia/stab"; | 44 | const char * stab2 = "/var/lib/pcmcia/stab"; |
46 | 45 | ||
47 | void SysFileMonitor::timerEvent(QTimerEvent*) | 46 | void SysFileMonitor::timerEvent(QTimerEvent*) |
48 | { | 47 | { |
49 | struct stat s; | 48 | struct stat s; |
50 | 49 | ||
51 | static const char * tab [] = { | 50 | static const char * tab [] = { |
52 | stab0, | 51 | stab0, |
53 | stab1, | 52 | stab1, |
54 | stab2 | 53 | stab2 |
55 | }; | 54 | }; |
56 | static const int nstab = sizeof(tab)/sizeof(const char *); | 55 | static const int nstab = sizeof(tab)/sizeof(const char *); |
57 | static int last[nstab]; | 56 | static int last[nstab]; |
58 | 57 | ||
59 | bool ch = FALSE; | 58 | bool ch = FALSE; |
60 | for ( int i=0; i<nstab; i++ ) { | 59 | for ( int i=0; i<nstab; i++ ) { |
61 | if ( ::stat(tab[i], &s)==0 && (long)s.st_mtime != last[i] ) { | 60 | if ( ::stat(tab[i], &s)==0 && (long)s.st_mtime != last[i] ) { |
62 | last[i] = (long)s.st_mtime; | 61 | last[i] = (long)s.st_mtime; |
63 | ch=TRUE; | 62 | ch=TRUE; |
64 | } | 63 | } |
65 | if ( ch ) { | 64 | if ( ch ) { |
66 | #ifndef QT_NO_COP | 65 | #ifndef QT_NO_COP |
67 | QCopEnvelope("QPE/Card", "stabChanged()" ); | 66 | QCopEnvelope("QPE/Card", "stabChanged()" ); |
68 | #endif | 67 | #endif |
69 | break; | 68 | break; |
70 | } | 69 | } |
71 | } | 70 | } |
72 | 71 | ||
73 | // st_size is no use, it's 0 for /proc/mounts too. Read it all. | 72 | // st_size is no use, it's 0 for /proc/mounts too. Read it all. |
74 | static int mtabSize = 0; | 73 | static int mtabSize = 0; |
75 | QFile f( "/proc/mounts" ); | 74 | QFile f( "/proc/mounts" ); |
76 | if ( f.open(IO_ReadOnly) ) { | 75 | if ( f.open(IO_ReadOnly) ) { |
77 | #if 0 | 76 | #if 0 |
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index c199063..f3a7651 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp | |||
@@ -1,87 +1,83 @@ | |||
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 | // TODO. During startup | 21 | // TODO. During startup |
22 | // Launcher::typeAdded | 22 | // Launcher::typeAdded |
23 | // is called for each new tab and calls then each time the refresh of startmenu | 23 | // is called for each new tab and calls then each time the refresh of startmenu |
24 | // suboptimal | 24 | // suboptimal |
25 | 25 | ||
26 | #define INCLUDE_MENUITEM_DEF | 26 | #define INCLUDE_MENUITEM_DEF |
27 | 27 | ||
28 | #include "startmenu.h" | 28 | #include "startmenu.h" |
29 | 29 | ||
30 | #include <qtopia/qpeapplication.h> | 30 | #include <qtopia/qpeapplication.h> |
31 | #include <qtopia/config.h> | 31 | #include <qtopia/config.h> |
32 | #include <qtopia/applnk.h> | ||
33 | #include <qtopia/global.h> | ||
34 | #include <qtopia/resource.h> | 32 | #include <qtopia/resource.h> |
35 | #include <qtopia/mimetype.h> | 33 | #include <qtopia/mimetype.h> |
36 | #include <qtopia/qlibrary.h> | 34 | #include <qtopia/qlibrary.h> |
37 | 35 | ||
38 | #include <qdict.h> | ||
39 | #include <qdir.h> | ||
40 | //#include <qpainter.h> | 36 | //#include <qpainter.h> |
41 | 37 | ||
42 | //#include <stdlib.h> | 38 | //#include <stdlib.h> |
43 | 39 | ||
44 | 40 | ||
45 | #define APPLNK_ID_OFFSET 250 | 41 | #define APPLNK_ID_OFFSET 250 |
46 | #define NO_ID -1 | 42 | #define NO_ID -1 |
47 | 43 | ||
48 | 44 | ||
49 | void StartPopupMenu::keyPressEvent( QKeyEvent *e ) | 45 | void StartPopupMenu::keyPressEvent( QKeyEvent *e ) |
50 | { | 46 | { |
51 | if ( e->key() == Key_F33 || e->key() == Key_Space ) { | 47 | if ( e->key() == Key_F33 || e->key() == Key_Space ) { |
52 | // "OK" button, little hacky | 48 | // "OK" button, little hacky |
53 | QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); | 49 | QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); |
54 | QPopupMenu::keyPressEvent( &ke ); | 50 | QPopupMenu::keyPressEvent( &ke ); |
55 | } else { | 51 | } else { |
56 | QPopupMenu::keyPressEvent( e ); | 52 | QPopupMenu::keyPressEvent( e ); |
57 | } | 53 | } |
58 | } | 54 | } |
59 | 55 | ||
60 | //--------------------------------------------------------------------------- | 56 | //--------------------------------------------------------------------------- |
61 | 57 | ||
62 | StartMenu::StartMenu(QWidget *parent) : QLabel( parent ) | 58 | StartMenu::StartMenu(QWidget *parent) : QLabel( parent ) |
63 | { | 59 | { |
64 | startButtonPixmap = "go"; // No tr | 60 | startButtonPixmap = "go"; // No tr |
65 | 61 | ||
66 | int sz = AppLnk::smallIconSize()+3; | 62 | int sz = AppLnk::smallIconSize()+3; |
67 | QPixmap pm; | 63 | QPixmap pm; |
68 | pm.convertFromImage(Resource::loadImage( startButtonPixmap).smoothScale( sz,sz) ); | 64 | pm.convertFromImage(Resource::loadImage( startButtonPixmap).smoothScale( sz,sz) ); |
69 | setPixmap(pm); | 65 | setPixmap(pm); |
70 | setFocusPolicy( NoFocus ); | 66 | setFocusPolicy( NoFocus ); |
71 | 67 | ||
72 | useWidePopupMenu = true; | 68 | useWidePopupMenu = true; |
73 | launchMenu = 0; | 69 | launchMenu = 0; |
74 | refreshMenu(); | 70 | refreshMenu(); |
75 | } | 71 | } |
76 | 72 | ||
77 | 73 | ||
78 | void StartMenu::mousePressEvent( QMouseEvent * ) | 74 | void StartMenu::mousePressEvent( QMouseEvent * ) |
79 | { | 75 | { |
80 | launch(); | 76 | launch(); |
81 | } | 77 | } |
82 | 78 | ||
83 | 79 | ||
84 | StartMenu::~StartMenu() | 80 | StartMenu::~StartMenu() |
85 | { | 81 | { |
86 | clearApplets(); | 82 | clearApplets(); |
87 | } | 83 | } |
diff --git a/core/launcher/syncdialog.cpp b/core/launcher/syncdialog.cpp index 6f6c781..4a2b8ff 100644 --- a/core/launcher/syncdialog.cpp +++ b/core/launcher/syncdialog.cpp | |||
@@ -1,73 +1,72 @@ | |||
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 "syncdialog.h" | 21 | #include "syncdialog.h" |
22 | 22 | ||
23 | #include <qtopia/resource.h> | 23 | #include <qtopia/resource.h> |
24 | 24 | ||
25 | #include <qimage.h> | ||
26 | #include <qpainter.h> | 25 | #include <qpainter.h> |
27 | #include <qapplication.h> | 26 | #include <qapplication.h> |
28 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
29 | #include <qfile.h> | 28 | #include <qfile.h> |
30 | 29 | ||
31 | 30 | ||
32 | SyncDialog::SyncDialog( QWidget *parent, const QString &w ) | 31 | SyncDialog::SyncDialog( QWidget *parent, const QString &w ) |
33 | : QDialog( parent, "SyncDialog", FALSE, WStyle_Tool | WStyle_Customize | | 32 | : QDialog( parent, "SyncDialog", FALSE, WStyle_Tool | WStyle_Customize | |
34 | WStyle_StaysOnTop ), what(w), nextPt(0), rev(FALSE), hideDot(TRUE) | 33 | WStyle_StaysOnTop ), what(w), nextPt(0), rev(FALSE), hideDot(TRUE) |
35 | { | 34 | { |
36 | QFont f( font() ); | 35 | QFont f( font() ); |
37 | f.setPointSize( 16 ); | 36 | f.setPointSize( 16 ); |
38 | setFont(f); | 37 | setFont(f); |
39 | 38 | ||
40 | loadPath(); | 39 | loadPath(); |
41 | 40 | ||
42 | QSize ds = qApp->desktop()->size(); | 41 | QSize ds = qApp->desktop()->size(); |
43 | setGeometry( 0, 0, ds.width(), ds.height() ); | 42 | setGeometry( 0, 0, ds.width(), ds.height() ); |
44 | img = Resource::loadImage( "SyncScreen" ); | 43 | img = Resource::loadImage( "SyncScreen" ); |
45 | if ( img.width() > ds.width() || img.height() > ds.height() ) { | 44 | if ( img.width() > ds.width() || img.height() > ds.height() ) { |
46 | path = scalePath( path, ds.width(), img.width(), ds.height(), img.height() ); | 45 | path = scalePath( path, ds.width(), img.width(), ds.height(), img.height() ); |
47 | img = img.smoothScale( ds.width(), ds.height() ); | 46 | img = img.smoothScale( ds.width(), ds.height() ); |
48 | } | 47 | } |
49 | dot = Resource::loadImage( "syncdot" ); | 48 | dot = Resource::loadImage( "syncdot" ); |
50 | setBackgroundColor( white ); | 49 | setBackgroundColor( white ); |
51 | 50 | ||
52 | QPushButton *pb = new QPushButton( tr("Abort"), this, "CancelSync" ); | 51 | QPushButton *pb = new QPushButton( tr("Abort"), this, "CancelSync" ); |
53 | QSize bs = pb->sizeHint(); | 52 | QSize bs = pb->sizeHint(); |
54 | bs.rwidth() += 10; | 53 | bs.rwidth() += 10; |
55 | bs.rheight() += 5; | 54 | bs.rheight() += 5; |
56 | pb->setGeometry( (ds.width()-bs.width())/2, 4*ds.height()/5, | 55 | pb->setGeometry( (ds.width()-bs.width())/2, 4*ds.height()/5, |
57 | bs.width(), bs.height() ); | 56 | bs.width(), bs.height() ); |
58 | connect( pb, SIGNAL(clicked()), this, SIGNAL(cancel()) ); | 57 | connect( pb, SIGNAL(clicked()), this, SIGNAL(cancel()) ); |
59 | 58 | ||
60 | if ( path.count() >= 2 ) { | 59 | if ( path.count() >= 2 ) { |
61 | path = generatePath( path, 8 ); | 60 | path = generatePath( path, 8 ); |
62 | startTimer( 200 ); | 61 | startTimer( 200 ); |
63 | } | 62 | } |
64 | } | 63 | } |
65 | 64 | ||
66 | void SyncDialog::paintEvent( QPaintEvent *pe ) | 65 | void SyncDialog::paintEvent( QPaintEvent *pe ) |
67 | { | 66 | { |
68 | QPainter p(this ); | 67 | QPainter p(this ); |
69 | p.setClipRect( pe->rect() ); | 68 | p.setClipRect( pe->rect() ); |
70 | int ox = (width() - img.width())/2; | 69 | int ox = (width() - img.width())/2; |
71 | int oy = (height() - img.height())/2; | 70 | int oy = (height() - img.height())/2; |
72 | 71 | ||
73 | QRect ir = QRect(ox, oy, img.width(), img.height()) & pe->rect(); | 72 | QRect ir = QRect(ox, oy, img.width(), img.height()) & pe->rect(); |
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 691f6b8..6cc1446 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -1,76 +1,74 @@ | |||
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 <qtopia/qpeapplication.h> | 21 | #include <qtopia/qpeapplication.h> |
22 | #include <qtopia/qlibrary.h> | 22 | #include <qtopia/qlibrary.h> |
23 | #include <qtopia/config.h> | 23 | #include <qtopia/config.h> |
24 | 24 | ||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qdir.h> | 26 | #include <qdir.h> |
27 | #include <qmessagebox.h> | ||
28 | #include <qtranslator.h> | ||
29 | 27 | ||
30 | #include "systray.h" | 28 | #include "systray.h" |
31 | 29 | ||
32 | #include <stdlib.h> | 30 | #include <stdlib.h> |
33 | 31 | ||
34 | /* ### Single build floppies ### */ | 32 | /* ### Single build floppies ### */ |
35 | #if 0 | 33 | #if 0 |
36 | #ifdef QT_NO_COMPONENTS | 34 | #ifdef QT_NO_COMPONENTS |
37 | #include "../plugins/applets/clockapplet/clockappletimpl.h" | 35 | #include "../plugins/applets/clockapplet/clockappletimpl.h" |
38 | #endif | 36 | #endif |
39 | #endif | 37 | #endif |
40 | 38 | ||
41 | SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0) | 39 | SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0) |
42 | { | 40 | { |
43 | //setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 41 | //setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
44 | loadApplets(); | 42 | loadApplets(); |
45 | } | 43 | } |
46 | 44 | ||
47 | SysTray::~SysTray() | 45 | SysTray::~SysTray() |
48 | { | 46 | { |
49 | clearApplets(); | 47 | clearApplets(); |
50 | } | 48 | } |
51 | 49 | ||
52 | static int compareAppletPositions(const void *a, const void *b) | 50 | static int compareAppletPositions(const void *a, const void *b) |
53 | { | 51 | { |
54 | const TaskbarApplet* aa = *(const TaskbarApplet**)a; | 52 | const TaskbarApplet* aa = *(const TaskbarApplet**)a; |
55 | const TaskbarApplet* ab = *(const TaskbarApplet**)b; | 53 | const TaskbarApplet* ab = *(const TaskbarApplet**)b; |
56 | int d = ab->iface->position() - aa->iface->position(); | 54 | int d = ab->iface->position() - aa->iface->position(); |
57 | if ( d ) return d; | 55 | if ( d ) return d; |
58 | return QString::compare(ab->name,aa->name); | 56 | return QString::compare(ab->name,aa->name); |
59 | } | 57 | } |
60 | 58 | ||
61 | void SysTray::loadApplets() | 59 | void SysTray::loadApplets() |
62 | { | 60 | { |
63 | hide(); | 61 | hide(); |
64 | clearApplets(); | 62 | clearApplets(); |
65 | addApplets(); | 63 | addApplets(); |
66 | } | 64 | } |
67 | 65 | ||
68 | void SysTray::clearApplets() | 66 | void SysTray::clearApplets() |
69 | { | 67 | { |
70 | #ifndef QT_NO_COMPONENTS | 68 | #ifndef QT_NO_COMPONENTS |
71 | 69 | ||
72 | /* | 70 | /* |
73 | * Note on clearing. SOme applets delete their | 71 | * Note on clearing. SOme applets delete their |
74 | * applets themselves some don't do it | 72 | * applets themselves some don't do it |
75 | * and on restart this can crash. If we delete it | 73 | * and on restart this can crash. If we delete it |
76 | * here we might end up in a double deletion. We could | 74 | * here we might end up in a double deletion. We could |
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index 8367a62..b998e95 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp | |||
@@ -1,108 +1,98 @@ | |||
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 | //#define _XOPEN_SOURCE | 20 | //#define _XOPEN_SOURCE |
21 | 21 | ||
22 | #include <opie2/oglobal.h> | 22 | #include <opie2/oglobal.h> |
23 | #include <qtopia/qpeapplication.h> | ||
24 | 23 | ||
25 | #ifndef Q_OS_WIN32 | 24 | #ifndef Q_OS_WIN32 |
26 | #include <pwd.h> | 25 | #include <pwd.h> |
27 | #include <sys/types.h> | 26 | #include <sys/types.h> |
28 | #include <unistd.h> | 27 | #include <unistd.h> |
29 | #include <stdlib.h> | 28 | #include <stdlib.h> |
30 | #include <time.h> | 29 | #include <time.h> |
31 | 30 | ||
32 | #ifndef Q_OS_MACX | 31 | #ifndef Q_OS_MACX |
33 | #include <shadow.h> | 32 | #include <shadow.h> |
34 | #include <crypt.h> | 33 | #include <crypt.h> |
35 | #endif /* Q_OS_MACX */ | 34 | #endif /* Q_OS_MACX */ |
36 | 35 | ||
37 | #else | 36 | #else |
38 | #include <stdlib.h> | 37 | #include <stdlib.h> |
39 | #include <time.h> | 38 | #include <time.h> |
40 | #endif | 39 | #endif |
41 | 40 | ||
42 | 41 | ||
43 | #if defined(_OS_LINUX_) | 42 | #if defined(_OS_LINUX_) |
44 | #include <shadow.h> | 43 | #include <shadow.h> |
45 | #endif | 44 | #endif |
46 | 45 | ||
47 | #include <qdir.h> | ||
48 | #include <qfile.h> | ||
49 | #include <qtextstream.h> | 46 | #include <qtextstream.h> |
50 | #include <qdatastream.h> | ||
51 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
52 | #include <qstringlist.h> | ||
53 | #include <qfileinfo.h> | ||
54 | #include <qregexp.h> | ||
55 | //#include <qtopia/qcopchannel_qws.h> | 48 | //#include <qtopia/qcopchannel_qws.h> |
56 | #include <qtopia/process.h> | 49 | #include <qtopia/process.h> |
57 | #include <qtopia/global.h> | ||
58 | #include <qtopia/config.h> | ||
59 | #include <qtopia/private/contact.h> | 50 | #include <qtopia/private/contact.h> |
60 | #include <qtopia/quuid.h> | ||
61 | #include <qtopia/version.h> | 51 | #include <qtopia/version.h> |
62 | #ifdef Q_WS_QWS | 52 | #ifdef Q_WS_QWS |
63 | #include <qtopia/qcopenvelope_qws.h> | 53 | #include <qtopia/qcopenvelope_qws.h> |
64 | #endif | 54 | #endif |
65 | 55 | ||
66 | 56 | ||
67 | #include "transferserver.h" | 57 | #include "transferserver.h" |
68 | #include <qtopia/qprocess.h> | 58 | #include <qtopia/qprocess.h> |
69 | 59 | ||
70 | const int block_size = 51200; | 60 | const int block_size = 51200; |
71 | 61 | ||
72 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent, | 62 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent, |
73 | const char* name) | 63 | const char* name) |
74 | : QServerSocket( port, 1, parent, name ) | 64 | : QServerSocket( port, 1, parent, name ) |
75 | { | 65 | { |
76 | connections.setAutoDelete( TRUE ); | 66 | connections.setAutoDelete( TRUE ); |
77 | if ( !ok() ) | 67 | if ( !ok() ) |
78 | qWarning( "Failed to bind to port %d", port ); | 68 | qWarning( "Failed to bind to port %d", port ); |
79 | } | 69 | } |
80 | 70 | ||
81 | void TransferServer::authorizeConnections() | 71 | void TransferServer::authorizeConnections() |
82 | { | 72 | { |
83 | QListIterator<ServerPI> it(connections); | 73 | QListIterator<ServerPI> it(connections); |
84 | while ( it.current() ) { | 74 | while ( it.current() ) { |
85 | if ( !it.current()->verifyAuthorised() ) { | 75 | if ( !it.current()->verifyAuthorised() ) { |
86 | disconnect( it.current(), SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); | 76 | disconnect( it.current(), SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); |
87 | connections.removeRef( it.current() ); | 77 | connections.removeRef( it.current() ); |
88 | } else | 78 | } else |
89 | ++it; | 79 | ++it; |
90 | } | 80 | } |
91 | } | 81 | } |
92 | 82 | ||
93 | void TransferServer::closed(ServerPI *item) | 83 | void TransferServer::closed(ServerPI *item) |
94 | { | 84 | { |
95 | connections.removeRef(item); | 85 | connections.removeRef(item); |
96 | } | 86 | } |
97 | 87 | ||
98 | TransferServer::~TransferServer() | 88 | TransferServer::~TransferServer() |
99 | { | 89 | { |
100 | } | 90 | } |
101 | 91 | ||
102 | void TransferServer::newConnection( int socket ) | 92 | void TransferServer::newConnection( int socket ) |
103 | { | 93 | { |
104 | ServerPI *ptr = new ServerPI( socket, this ); | 94 | ServerPI *ptr = new ServerPI( socket, this ); |
105 | connect( ptr, SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); | 95 | connect( ptr, SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); |
106 | connections.append( ptr ); | 96 | connections.append( ptr ); |
107 | } | 97 | } |
108 | 98 | ||
diff --git a/core/launcher/wait.cpp b/core/launcher/wait.cpp index 34ffd1a..4148e57 100644 --- a/core/launcher/wait.cpp +++ b/core/launcher/wait.cpp | |||
@@ -1,78 +1,74 @@ | |||
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 "wait.h" | 21 | #include "wait.h" |
22 | 22 | ||
23 | #include <qtopia/resource.h> | ||
24 | #include <qtopia/config.h> | 23 | #include <qtopia/config.h> |
25 | 24 | ||
26 | #include <opie2/owait.h> | 25 | #include <opie2/owait.h> |
27 | 26 | ||
28 | #include <qwidget.h> | ||
29 | #include <qpixmap.h> | ||
30 | #include <qpainter.h> | ||
31 | 27 | ||
32 | 28 | ||
33 | Wait *lastWaitObject = NULL; | 29 | Wait *lastWaitObject = NULL; |
34 | 30 | ||
35 | 31 | ||
36 | Wait::Wait( QWidget *parent ) : QWidget( parent ), | 32 | Wait::Wait( QWidget *parent ) : QWidget( parent ), |
37 | pm( Resource::loadPixmap( "wait" ) ), waiting( FALSE ) | 33 | pm( Resource::loadPixmap( "wait" ) ), waiting( FALSE ) |
38 | { | 34 | { |
39 | setFixedSize( pm.size() ); | 35 | setFixedSize( pm.size() ); |
40 | lastWaitObject = this; | 36 | lastWaitObject = this; |
41 | m_centralWait = new OWait( 0l ); | 37 | m_centralWait = new OWait( 0l ); |
42 | m_centralWait->hide(); | 38 | m_centralWait->hide(); |
43 | hide(); | 39 | hide(); |
44 | } | 40 | } |
45 | 41 | ||
46 | 42 | ||
47 | Wait *Wait::getWaitObject() | 43 | Wait *Wait::getWaitObject() |
48 | { | 44 | { |
49 | return lastWaitObject; | 45 | return lastWaitObject; |
50 | } | 46 | } |
51 | 47 | ||
52 | 48 | ||
53 | void Wait::setWaiting( bool w ) | 49 | void Wait::setWaiting( bool w ) |
54 | { | 50 | { |
55 | Config cfg ( "Launcher" ); | 51 | Config cfg ( "Launcher" ); |
56 | cfg.setGroup("GUI"); | 52 | cfg.setGroup("GUI"); |
57 | 53 | ||
58 | 54 | ||
59 | waiting = w; | 55 | waiting = w; |
60 | if ( w ) { | 56 | if ( w ) { |
61 | if ( cfg. readBoolEntry( "BigBusy" ) ) | 57 | if ( cfg. readBoolEntry( "BigBusy" ) ) |
62 | m_centralWait->show(); | 58 | m_centralWait->show(); |
63 | else | 59 | else |
64 | show(); | 60 | show(); |
65 | }else{ | 61 | }else{ |
66 | m_centralWait->hide(); | 62 | m_centralWait->hide(); |
67 | hide(); | 63 | hide(); |
68 | } | 64 | } |
69 | } | 65 | } |
70 | 66 | ||
71 | 67 | ||
72 | void Wait::paintEvent( QPaintEvent * ) | 68 | void Wait::paintEvent( QPaintEvent * ) |
73 | { | 69 | { |
74 | QPainter p( this ); | 70 | QPainter p( this ); |
75 | p.drawPixmap( 0, 0, pm ); | 71 | p.drawPixmap( 0, 0, pm ); |
76 | } | 72 | } |
77 | 73 | ||
78 | 74 | ||