author | mickeyl <mickeyl> | 2003-10-27 19:51:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-27 19:51:32 (UTC) |
commit | 951d1d4125a80dc814f95d2956853bf53ca52e9a (patch) (unidiff) | |
tree | 46c7a70b80a7eebb54cd59c46204c28335f3821c /noncore/settings | |
parent | f0a15a9866f9eddfe10596e63a1e6300b92b9e3f (diff) | |
download | opie-951d1d4125a80dc814f95d2956853bf53ca52e9a.zip opie-951d1d4125a80dc814f95d2956853bf53ca52e9a.tar.gz opie-951d1d4125a80dc814f95d2956853bf53ca52e9a.tar.bz2 |
merge noncore/apps/* except
- advancedfm (ljp, please...)
- odict (tille, please...)
-rw-r--r-- | noncore/settings/aqpkg/.cvsignore | 1 | ||||
-rw-r--r-- | noncore/settings/aqpkg/aqpkg.pro | 26 | ||||
-rw-r--r-- | noncore/settings/aqpkg/main.cpp | 44 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 31 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 5 | ||||
-rw-r--r-- | noncore/settings/sysinfo/main.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 27 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.h | 1 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.pro | 9 |
9 files changed, 43 insertions, 112 deletions
diff --git a/noncore/settings/aqpkg/.cvsignore b/noncore/settings/aqpkg/.cvsignore index 2888d4a..4183697 100644 --- a/noncore/settings/aqpkg/.cvsignore +++ b/noncore/settings/aqpkg/.cvsignore | |||
@@ -1,2 +1,3 @@ | |||
1 | Makefile* | 1 | Makefile* |
2 | moc* | 2 | moc* |
3 | .moc* | ||
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro index d241d1b..882cfd4 100644 --- a/noncore/settings/aqpkg/aqpkg.pro +++ b/noncore/settings/aqpkg/aqpkg.pro | |||
@@ -1,62 +1,40 @@ | |||
1 | TEMPLATE= app | 1 | CONFIG = qt warn_on release quick-app |
2 | CONFIG = qt warn_on release | ||
3 | HEADERS = global.h \ | 2 | HEADERS = global.h \ |
4 | mainwin.h \ | 3 | mainwin.h \ |
5 | datamgr.h \ | 4 | datamgr.h \ |
6 | settingsimpl.h \ | 5 | settingsimpl.h \ |
7 | ipkg.h \ | 6 | ipkg.h \ |
8 | packagewin.h \ | 7 | packagewin.h \ |
9 | package.h \ | 8 | package.h \ |
10 | installdlgimpl.h \ | 9 | installdlgimpl.h \ |
11 | instoptionsimpl.h \ | 10 | instoptionsimpl.h \ |
12 | destination.h \ | 11 | destination.h \ |
13 | utils.h \ | 12 | utils.h \ |
14 | server.h \ | 13 | server.h \ |
15 | letterpushbutton.h \ | 14 | letterpushbutton.h \ |
16 | inputdlg.h \ | 15 | inputdlg.h \ |
17 | categoryfilterimpl.h | 16 | categoryfilterimpl.h |
18 | SOURCES = mainwin.cpp \ | 17 | SOURCES = mainwin.cpp \ |
19 | datamgr.cpp \ | 18 | datamgr.cpp \ |
20 | mem.cpp \ | 19 | mem.cpp \ |
21 | settingsimpl.cpp \ | 20 | settingsimpl.cpp \ |
22 | ipkg.cpp \ | 21 | ipkg.cpp \ |
23 | main.cpp \ | 22 | main.cpp \ |
24 | packagewin.cpp \ | 23 | packagewin.cpp \ |
25 | package.cpp \ | 24 | package.cpp \ |
26 | installdlgimpl.cpp \ | 25 | installdlgimpl.cpp \ |
27 | instoptionsimpl.cpp \ | 26 | instoptionsimpl.cpp \ |
28 | destination.cpp \ | 27 | destination.cpp \ |
29 | utils.cpp \ | 28 | utils.cpp \ |
30 | server.cpp \ | 29 | server.cpp \ |
31 | letterpushbutton.cpp \ | 30 | letterpushbutton.cpp \ |
32 | inputdlg.cpp \ | 31 | inputdlg.cpp \ |
33 | version.cpp \ | 32 | version.cpp \ |
34 | categoryfilterimpl.cpp | 33 | categoryfilterimpl.cpp |
35 | INTERFACES= | ||
36 | TARGET = aqpkg | 34 | TARGET = aqpkg |
37 | INCLUDEPATH += $(OPIEDIR)/include | 35 | INCLUDEPATH += $(OPIEDIR)/include |
38 | DEPENDPATH += $(OPIEDIR)/include | 36 | DEPENDPATH += $(OPIEDIR)/include |
39 | LIBS += -lqpe -lopie -lstdc++ | 37 | LIBS += -lqpe -lopie -lstdc++ |
40 | DESTDIR = $(OPIEDIR)/bin | ||
41 | |||
42 | TRANSLATIONS = ../../../i18n/de/aqpkg.ts \ | ||
43 | ../../../i18n/nl/aqpkg.ts \ | ||
44 | ../../../i18n/xx/aqpkg.ts \ | ||
45 | ../../../i18n/en/aqpkg.ts \ | ||
46 | ../../../i18n/es/aqpkg.ts \ | ||
47 | ../../../i18n/fr/aqpkg.ts \ | ||
48 | ../../../i18n/hu/aqpkg.ts \ | ||
49 | ../../../i18n/ja/aqpkg.ts \ | ||
50 | ../../../i18n/ko/aqpkg.ts \ | ||
51 | ../../../i18n/no/aqpkg.ts \ | ||
52 | ../../../i18n/pl/aqpkg.ts \ | ||
53 | ../../../i18n/pt/aqpkg.ts \ | ||
54 | ../../../i18n/pt_BR/aqpkg.ts \ | ||
55 | ../../../i18n/sl/aqpkg.ts \ | ||
56 | ../../../i18n/zh_CN/aqpkg.ts \ | ||
57 | ../../../i18n/zh_TW/aqpkg.ts \ | ||
58 | ../../../i18n/it/aqpkg.ts \ | ||
59 | ../../../i18n/da/aqpkg.ts | ||
60 | |||
61 | 38 | ||
62 | include ( $(OPIEDIR)/include.pro ) | 39 | include ( $(OPIEDIR)/include.pro ) |
40 | |||
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp index b7f8b7b..179f8b7 100644 --- a/noncore/settings/aqpkg/main.cpp +++ b/noncore/settings/aqpkg/main.cpp | |||
@@ -6,73 +6,33 @@ | |||
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifdef QWS | ||
31 | #include <qpe/qpeapplication.h> | ||
32 | #include <qpe/qcopenvelope_qws.h> | ||
33 | #else | ||
34 | #include <qapplication.h> | ||
35 | #endif | ||
36 | |||
37 | #include <qobjectdefs.h> | ||
38 | |||
39 | #include "mainwin.h" | 30 | #include "mainwin.h" |
40 | #include "server.h" | ||
41 | |||
42 | #include "global.h" | ||
43 | 31 | ||
32 | #include <opie/oapplicationfactory.h> | ||
44 | 33 | ||
45 | /* be less intrusive for translation -zecke */ | 34 | /* be less intrusive for translation -zecke */ |
46 | extern QString LOCAL_SERVER; | 35 | extern QString LOCAL_SERVER; |
47 | extern QString LOCAL_IPKGS; | 36 | extern QString LOCAL_IPKGS; |
48 | 37 | ||
49 | int main(int argc, char *argv[]) | 38 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
50 | { | ||
51 | #ifdef QWS | ||
52 | QPEApplication a( argc, argv ); | ||
53 | #else | ||
54 | QApplication a( argc, argv ); | ||
55 | #endif | ||
56 | |||
57 | #ifdef QWS | ||
58 | // Disable suspend mode | ||
59 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; | ||
60 | #endif | ||
61 | |||
62 | LOCAL_SERVER = QObject::tr( "Installed packages" ); | ||
63 | LOCAL_IPKGS = QObject::tr( "Local packages" ); | ||
64 | |||
65 | MainWindow *win = new MainWindow(); | ||
66 | a.setMainWidget(win); | ||
67 | win->showMaximized(); | ||
68 | |||
69 | a.exec(); | ||
70 | |||
71 | #ifdef QWS | ||
72 | // Reenable suspend mode | ||
73 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | ||
74 | #endif | ||
75 | #ifdef _DEBUG | ||
76 | DumpUnfreed(); | ||
77 | #endif | ||
78 | } | ||
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 42093cf..dbe694e 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -1,27 +1,27 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
@@ -45,51 +45,57 @@ | |||
45 | #include <qlineedit.h> | 45 | #include <qlineedit.h> |
46 | #include <qlistview.h> | 46 | #include <qlistview.h> |
47 | #include <qmenubar.h> | 47 | #include <qmenubar.h> |
48 | #include <qmessagebox.h> | 48 | #include <qmessagebox.h> |
49 | #include <qpopupmenu.h> | 49 | #include <qpopupmenu.h> |
50 | #include <qprogressbar.h> | 50 | #include <qprogressbar.h> |
51 | #include <qtimer.h> | 51 | #include <qtimer.h> |
52 | #include <qwhatsthis.h> | 52 | #include <qwhatsthis.h> |
53 | #include <qwidgetstack.h> | 53 | #include <qwidgetstack.h> |
54 | 54 | ||
55 | #include "categoryfilterimpl.h" | 55 | #include "categoryfilterimpl.h" |
56 | #include "datamgr.h" | 56 | #include "datamgr.h" |
57 | #include "global.h" | 57 | #include "global.h" |
58 | #include "inputdlg.h" | 58 | #include "inputdlg.h" |
59 | #include "ipkg.h" | 59 | #include "ipkg.h" |
60 | #include "installdlgimpl.h" | 60 | #include "installdlgimpl.h" |
61 | #include "letterpushbutton.h" | 61 | #include "letterpushbutton.h" |
62 | #include "mainwin.h" | 62 | #include "mainwin.h" |
63 | #include "packagewin.h" | 63 | #include "packagewin.h" |
64 | #include "settingsimpl.h" | 64 | #include "settingsimpl.h" |
65 | #include "utils.h" | 65 | #include "utils.h" |
66 | 66 | ||
67 | extern int compareVersions( const char *v1, const char *v2 ); | 67 | extern int compareVersions( const char *v1, const char *v2 ); |
68 | 68 | ||
69 | MainWindow :: MainWindow() | 69 | MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) |
70 | :QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) | 70 | :QMainWindow( parent, name, fl || WStyle_ContextHelp ) |
71 | { | 71 | { |
72 | // Disable suspend mode | ||
73 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; | ||
74 | |||
75 | LOCAL_SERVER = QObject::tr( "Installed packages" ); | ||
76 | LOCAL_IPKGS = QObject::tr( "Local packages" ); | ||
77 | |||
72 | setCaption( tr( "AQPkg - Package Manager" ) ); | 78 | setCaption( tr( "AQPkg - Package Manager" ) ); |
73 | 79 | ||
74 | // Create UI widgets | 80 | // Create UI widgets |
75 | initMainWidget(); | 81 | initMainWidget(); |
76 | initProgressWidget(); | 82 | initProgressWidget(); |
77 | 83 | ||
78 | // Build menu and tool bars | 84 | // Build menu and tool bars |
79 | setToolBarsMovable( FALSE ); | 85 | setToolBarsMovable( FALSE ); |
80 | 86 | ||
81 | QToolBar *bar = new QToolBar( this ); | 87 | QToolBar *bar = new QToolBar( this ); |
82 | bar->setHorizontalStretchable( TRUE ); | 88 | bar->setHorizontalStretchable( TRUE ); |
83 | QMenuBar *mb = new QMenuBar( bar ); | 89 | QMenuBar *mb = new QMenuBar( bar ); |
84 | mb->setMargin( 0 ); | 90 | mb->setMargin( 0 ); |
85 | bar = new QToolBar( this ); | 91 | bar = new QToolBar( this ); |
86 | 92 | ||
87 | // Find toolbar | 93 | // Find toolbar |
88 | findBar = new QToolBar( this ); | 94 | findBar = new QToolBar( this ); |
89 | addToolBar( findBar, QMainWindow::Top, true ); | 95 | addToolBar( findBar, QMainWindow::Top, true ); |
90 | findBar->setHorizontalStretchable( true ); | 96 | findBar->setHorizontalStretchable( true ); |
91 | findEdit = new QLineEdit( findBar ); | 97 | findEdit = new QLineEdit( findBar ); |
92 | QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) ); | 98 | QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) ); |
93 | findBar->setStretchableWidget( findEdit ); | 99 | findBar->setStretchableWidget( findEdit ); |
94 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); | 100 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); |
95 | 101 | ||
@@ -213,48 +219,51 @@ MainWindow :: MainWindow() | |||
213 | 219 | ||
214 | mb->insertItem( tr( "View" ), popup ); | 220 | mb->insertItem( tr( "View" ), popup ); |
215 | 221 | ||
216 | // Finish find toolbar creation | 222 | // Finish find toolbar creation |
217 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 223 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
218 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); | 224 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); |
219 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); | 225 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); |
220 | a->addTo( findBar ); | 226 | a->addTo( findBar ); |
221 | findBar->hide(); | 227 | findBar->hide(); |
222 | 228 | ||
223 | // Create widget stack and add UI widgets | 229 | // Create widget stack and add UI widgets |
224 | stack = new QWidgetStack( this ); | 230 | stack = new QWidgetStack( this ); |
225 | stack->addWidget( progressWindow, 2 ); | 231 | stack->addWidget( progressWindow, 2 ); |
226 | stack->addWidget( networkPkgWindow, 1 ); | 232 | stack->addWidget( networkPkgWindow, 1 ); |
227 | setCentralWidget( stack ); | 233 | setCentralWidget( stack ); |
228 | stack->raiseWidget( progressWindow ); | 234 | stack->raiseWidget( progressWindow ); |
229 | 235 | ||
230 | // Delayed call to finish initialization | 236 | // Delayed call to finish initialization |
231 | QTimer::singleShot( 100, this, SLOT( init() ) ); | 237 | QTimer::singleShot( 100, this, SLOT( init() ) ); |
232 | } | 238 | } |
233 | 239 | ||
234 | MainWindow :: ~MainWindow() | 240 | MainWindow :: ~MainWindow() |
235 | { | 241 | { |
236 | delete mgr; | 242 | delete mgr; |
243 | |||
244 | // Reenable suspend mode | ||
245 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | ||
237 | } | 246 | } |
238 | 247 | ||
239 | void MainWindow :: initMainWidget() | 248 | void MainWindow :: initMainWidget() |
240 | { | 249 | { |
241 | networkPkgWindow = new QWidget( this ); | 250 | networkPkgWindow = new QWidget( this ); |
242 | 251 | ||
243 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); | 252 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); |
244 | 253 | ||
245 | serversList = new QComboBox( networkPkgWindow ); | 254 | serversList = new QComboBox( networkPkgWindow ); |
246 | connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) ); | 255 | connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) ); |
247 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); | 256 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); |
248 | 257 | ||
249 | installedIcon = Resource::loadPixmap( "installed" ); | 258 | installedIcon = Resource::loadPixmap( "installed" ); |
250 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); | 259 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); |
251 | 260 | ||
252 | packagesList = new QListView( networkPkgWindow ); | 261 | packagesList = new QListView( networkPkgWindow ); |
253 | packagesList->addColumn( tr( "Packages" ), 225 ); | 262 | packagesList->addColumn( tr( "Packages" ), 225 ); |
254 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); | 263 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); |
255 | QPEApplication::setStylusOperation( packagesList->viewport(), QPEApplication::RightOnHold ); | 264 | QPEApplication::setStylusOperation( packagesList->viewport(), QPEApplication::RightOnHold ); |
256 | connect( packagesList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)), | 265 | connect( packagesList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)), |
257 | this, SLOT(slotDisplayPackage(QListViewItem *)) ); | 266 | this, SLOT(slotDisplayPackage(QListViewItem *)) ); |
258 | 267 | ||
259 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); | 268 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); |
260 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); | 269 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); |
@@ -991,83 +1000,81 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
991 | { | 1000 | { |
992 | QString name = item->text(); | 1001 | QString name = item->text(); |
993 | 1002 | ||
994 | // Get package | 1003 | // Get package |
995 | Server *s = mgr->getServer( serversList->currentText() ); | 1004 | Server *s = mgr->getServer( serversList->currentText() ); |
996 | Package *p = s->getPackage( name ); | 1005 | Package *p = s->getPackage( name ); |
997 | 1006 | ||
998 | // If the package has a filename then it is a local file | 1007 | // If the package has a filename then it is a local file |
999 | if ( p->isPackageStoredLocally() ) | 1008 | if ( p->isPackageStoredLocally() ) |
1000 | name = p->getFilename(); | 1009 | name = p->getFilename(); |
1001 | 1010 | ||
1002 | QString option; | 1011 | QString option; |
1003 | QString dest = "root"; | 1012 | QString dest = "root"; |
1004 | if ( !p->isInstalled() ) | 1013 | if ( !p->isInstalled() ) |
1005 | { | 1014 | { |
1006 | InstallData *newitem = new InstallData(); | 1015 | InstallData *newitem = new InstallData(); |
1007 | newitem->option = "I"; | 1016 | newitem->option = "I"; |
1008 | newitem->packageName = name; | 1017 | newitem->packageName = name; |
1009 | return newitem; | 1018 | return newitem; |
1010 | } | 1019 | } |
1011 | else | 1020 | else |
1012 | { | 1021 | { |
1013 | InstallData *newitem = new InstallData(); | 1022 | InstallData *newitem = new InstallData(); |
1014 | newitem->option = "D"; | 1023 | newitem->option = "D"; |
1015 | |||
1016 | // If local file, remove using package name, not filename | 1024 | // If local file, remove using package name, not filename |
1017 | if ( p->isPackageStoredLocally() ) | 1025 | if ( p->isPackageStoredLocally() ) |
1018 | name = item->text(); | 1026 | name = item->text(); |
1019 | 1027 | ||
1020 | if ( !p->isPackageStoredLocally() ) | 1028 | if ( !p->isPackageStoredLocally() ) |
1021 | newitem->packageName = p->getInstalledPackageName(); | 1029 | newitem->packageName = p->getInstalledPackageName(); |
1022 | else | 1030 | else |
1023 | newitem->packageName = name; | 1031 | newitem->packageName = name; |
1024 | 1032 | ||
1025 | if ( p->getInstalledTo() ) | 1033 | if ( p->getInstalledTo() ) |
1026 | { | 1034 | { |
1027 | newitem->destination = p->getInstalledTo(); | 1035 | newitem->destination = p->getInstalledTo(); |
1028 | } | 1036 | } |
1029 | else | 1037 | else |
1030 | { | 1038 | { |
1031 | newitem->destination = p->getLocalPackage()->getInstalledTo(); | 1039 | newitem->destination = p->getLocalPackage()->getInstalledTo(); |
1032 | } | 1040 | } |
1033 | 1041 | ||
1034 | // Now see if version is newer or not | 1042 | // Now see if version is newer or not |
1035 | int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); | 1043 | int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); |
1036 | 1044 | ||
1037 | // If the version requested is older and user selected a local ipk file, then reinstall the file | 1045 | // If the version requested is older and user selected a local ipk file, then reinstall the file |
1038 | if ( p->isPackageStoredLocally() && val == -1 ) | 1046 | if ( p->isPackageStoredLocally() && val == -1 ) |
1039 | val = 0; | 1047 | val = 0; |
1040 | 1048 | ||
1041 | if ( val == -2 ) | 1049 | if ( val == -2 ) |
1042 | { | 1050 | { |
1043 | // Error - should handle | 1051 | // Error - should handle |
1044 | } | 1052 | } |
1045 | else if ( val == -1 ) | 1053 | else if ( val == -1 ) |
1046 | { | 1054 | { |
1047 | // Version available is older - remove only | 1055 | // Version available is older - remove only |
1048 | newitem->option = "D"; | 1056 | newitem->option = "D"; |
1049 | |||
1050 | // If local file, remove using package name, not filename | 1057 | // If local file, remove using package name, not filename |
1051 | if ( p->isPackageStoredLocally() ) | 1058 | if ( p->isPackageStoredLocally() ) |
1052 | name = item->text(); | 1059 | name = item->text(); |
1053 | } | 1060 | } |
1054 | else | 1061 | else |
1055 | { | 1062 | { |
1056 | QString caption; | 1063 | QString caption; |
1057 | QString text; | 1064 | QString text; |
1058 | QString secondButton; | 1065 | QString secondButton; |
1059 | QString secondOption; | 1066 | QString secondOption; |
1060 | if ( val == 0 ) | 1067 | if ( val == 0 ) |
1061 | { | 1068 | { |
1062 | // Version available is the same - option to remove or reinstall | 1069 | // Version available is the same - option to remove or reinstall |
1063 | caption = tr( "Do you wish to remove or reinstall\n%1?" ); | 1070 | caption = tr( "Do you wish to remove or reinstall\n%1?" ); |
1064 | text = tr( "Remove or ReInstall" ); | 1071 | text = tr( "Remove or ReInstall" ); |
1065 | secondButton = tr( "ReInstall" ); | 1072 | secondButton = tr( "ReInstall" ); |
1066 | secondOption = "R"; // Internal action code, do not translate | 1073 | secondOption = "R"; // Internal action code, do not translate |
1067 | } | 1074 | } |
1068 | else if ( val == 1 ) | 1075 | else if ( val == 1 ) |
1069 | { | 1076 | { |
1070 | // Version available is newer - option to remove or upgrade | 1077 | // Version available is newer - option to remove or upgrade |
1071 | caption = tr( "Do you wish to remove or upgrade\n%1?" ); | 1078 | caption = tr( "Do you wish to remove or upgrade\n%1?" ); |
1072 | text = tr( "Remove or Upgrade" ); | 1079 | text = tr( "Remove or Upgrade" ); |
1073 | secondButton = tr( "Upgrade" ); | 1080 | secondButton = tr( "Upgrade" ); |
@@ -1168,66 +1175,66 @@ void MainWindow :: letterPushed( QString t ) | |||
1168 | { | 1175 | { |
1169 | packagesList->setSelected( item, true ); | 1176 | packagesList->setSelected( item, true ); |
1170 | packagesList->ensureItemVisible( item ); | 1177 | packagesList->ensureItemVisible( item ); |
1171 | break; | 1178 | break; |
1172 | } | 1179 | } |
1173 | 1180 | ||
1174 | item = (QCheckListItem *)item->nextSibling(); | 1181 | item = (QCheckListItem *)item->nextSibling(); |
1175 | if ( !item ) | 1182 | if ( !item ) |
1176 | item = (QCheckListItem *)packagesList->firstChild(); | 1183 | item = (QCheckListItem *)packagesList->firstChild(); |
1177 | } while ( item != start); | 1184 | } while ( item != start); |
1178 | } | 1185 | } |
1179 | 1186 | ||
1180 | void MainWindow :: slotDisplayPackage( QListViewItem *item ) | 1187 | void MainWindow :: slotDisplayPackage( QListViewItem *item ) |
1181 | { | 1188 | { |
1182 | QString itemstr( ((QCheckListItem*)item)->text() ); | 1189 | QString itemstr( ((QCheckListItem*)item)->text() ); |
1183 | PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) ); | 1190 | PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) ); |
1184 | p->showMaximized(); | 1191 | p->showMaximized(); |
1185 | } | 1192 | } |
1186 | 1193 | ||
1187 | QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn ) | 1194 | QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn ) |
1188 | : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog ) | 1195 | : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog ) |
1189 | { | 1196 | { |
1190 | setCaption( caption ); | 1197 | setCaption( caption ); |
1191 | resize( 175, 100 ); | 1198 | resize( 175, 100 ); |
1192 | 1199 | ||
1193 | QGridLayout *layout = new QGridLayout( this ); | 1200 | QGridLayout *layout = new QGridLayout( this ); |
1194 | 1201 | ||
1195 | QLabel *l = new QLabel( text, this ); | 1202 | QLabel *l = new QLabel( text, this ); |
1196 | l->setAlignment( AlignCenter | WordBreak ); | 1203 | l->setAlignment( AlignCenter | WordBreak ); |
1197 | layout->addMultiCellWidget( l, 0, 0, 0, 1 ); | 1204 | layout->addMultiCellWidget( l, 0, 0, 0, 1 ); |
1198 | 1205 | ||
1199 | btn1 = new QPushButton( tr( "Remove" ), this ); | 1206 | btn1 = new QPushButton( tr( "Remove" ), this ); |
1200 | connect( btn1, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); | 1207 | connect( btn1, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); |
1201 | layout->addWidget( btn1, 1, 0 ); | 1208 | layout->addWidget( btn1, 1, 0 ); |
1202 | 1209 | ||
1203 | btn2 = new QPushButton( secondbtn, this ); | 1210 | btn2 = new QPushButton( secondbtn, this ); |
1204 | connect( btn2, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); | 1211 | connect( btn2, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); |
1205 | layout->addWidget( btn2, 1, 1 ); | 1212 | layout->addWidget( btn2, 1, 1 ); |
1206 | 1213 | ||
1207 | executing = FALSE; | 1214 | executing = FALSE; |
1208 | } | 1215 | } |
1209 | 1216 | ||
1210 | int QuestionDlg::exec() | 1217 | int QuestionDlg::exec() |
1211 | { | 1218 | { |
1212 | show(); | 1219 | show(); |
1213 | 1220 | ||
1214 | if ( !executing ) | 1221 | if ( !executing ) |
1215 | { | 1222 | { |
1216 | executing = TRUE; | 1223 | executing = TRUE; |
1217 | qApp->enter_loop(); | 1224 | qApp->enter_loop(); |
1218 | } | 1225 | } |
1219 | 1226 | ||
1220 | return buttonpressed; | 1227 | return buttonpressed; |
1221 | } | 1228 | } |
1222 | 1229 | ||
1223 | void QuestionDlg::slotButtonPressed() | 1230 | void QuestionDlg::slotButtonPressed() |
1224 | { | 1231 | { |
1225 | if ( sender() == btn1 ) | 1232 | if ( sender() == btn1 ) |
1226 | buttonpressed = 1; | 1233 | buttonpressed = 1; |
1227 | else if ( sender() == btn2 ) | 1234 | else if ( sender() == btn2 ) |
1228 | buttonpressed = 2; | 1235 | buttonpressed = 2; |
1229 | else | 1236 | else |
1230 | buttonpressed = 0; | 1237 | buttonpressed = 0; |
1231 | 1238 | ||
1232 | qApp->exit_loop(); | 1239 | qApp->exit_loop(); |
1233 | } | 1240 | } |
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h index 615ff8b..b8e1c98 100644 --- a/noncore/settings/aqpkg/mainwin.h +++ b/noncore/settings/aqpkg/mainwin.h | |||
@@ -30,53 +30,54 @@ | |||
30 | #ifndef MAINWIN_H | 30 | #ifndef MAINWIN_H |
31 | #define MAINWIN_H | 31 | #define MAINWIN_H |
32 | 32 | ||
33 | #include <qmainwindow.h> | 33 | #include <qmainwindow.h> |
34 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
35 | 35 | ||
36 | class DataManager; | 36 | class DataManager; |
37 | class InstallData; | 37 | class InstallData; |
38 | class InstallDlgImpl; | 38 | class InstallDlgImpl; |
39 | 39 | ||
40 | class QAction; | 40 | class QAction; |
41 | class QCheckListItem; | 41 | class QCheckListItem; |
42 | class QComboBox; | 42 | class QComboBox; |
43 | class QLabel; | 43 | class QLabel; |
44 | class QLineEdit; | 44 | class QLineEdit; |
45 | class QListView; | 45 | class QListView; |
46 | class QListViewItem; | 46 | class QListViewItem; |
47 | class QToolBar; | 47 | class QToolBar; |
48 | class QProgressBar; | 48 | class QProgressBar; |
49 | class QPushButton; | 49 | class QPushButton; |
50 | class QWidgetStack; | 50 | class QWidgetStack; |
51 | 51 | ||
52 | class MainWindow :public QMainWindow | 52 | class MainWindow :public QMainWindow |
53 | { | 53 | { |
54 | Q_OBJECT | 54 | Q_OBJECT |
55 | public: | 55 | public: |
56 | 56 | ||
57 | MainWindow(); | 57 | MainWindow( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
58 | ~MainWindow(); | 58 | ~MainWindow(); |
59 | static QString appName() { return QString::fromLatin1( "aqpkg" ); }; | ||
59 | 60 | ||
60 | protected: | 61 | protected: |
61 | void closeEvent( QCloseEvent* e ); | 62 | void closeEvent( QCloseEvent* e ); |
62 | 63 | ||
63 | private: | 64 | private: |
64 | DataManager *mgr; | 65 | DataManager *mgr; |
65 | 66 | ||
66 | QWidgetStack *stack; | 67 | QWidgetStack *stack; |
67 | 68 | ||
68 | QToolBar *findBar; | 69 | QToolBar *findBar; |
69 | QToolBar *jumpBar; | 70 | QToolBar *jumpBar; |
70 | QLineEdit *findEdit; | 71 | QLineEdit *findEdit; |
71 | QAction *actionFindNext; | 72 | QAction *actionFindNext; |
72 | QAction *actionFilter; | 73 | QAction *actionFilter; |
73 | QAction *actionUpgrade; | 74 | QAction *actionUpgrade; |
74 | QAction *actionDownload; | 75 | QAction *actionDownload; |
75 | QAction *actionUninstalled; | 76 | QAction *actionUninstalled; |
76 | QAction *actionInstalled; | 77 | QAction *actionInstalled; |
77 | QAction *actionUpdated; | 78 | QAction *actionUpdated; |
78 | 79 | ||
79 | QPixmap iconDownload; | 80 | QPixmap iconDownload; |
80 | QPixmap iconRemove; | 81 | QPixmap iconRemove; |
81 | 82 | ||
82 | int mnuShowUninstalledPkgsId; | 83 | int mnuShowUninstalledPkgsId; |
diff --git a/noncore/settings/sysinfo/main.cpp b/noncore/settings/sysinfo/main.cpp index 6e889db..02b1098 100644 --- a/noncore/settings/sysinfo/main.cpp +++ b/noncore/settings/sysinfo/main.cpp | |||
@@ -1,34 +1,27 @@ | |||
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 "sysinfo.h" | 21 | #include "sysinfo.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <opie/oapplicationfactory.h> | ||
24 | 25 | ||
25 | int main( int argc, char *argv[] ) | ||
26 | { | ||
27 | QPEApplication a( argc, argv ); | ||
28 | |||
29 | SystemInfo *si = new SystemInfo(); | ||
30 | a.showMainWidget( si ); | ||
31 | |||
32 | return a.exec(); | ||
33 | } | ||
34 | 26 | ||
27 | OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> ) | ||
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp index c4474d5..4ef7122 100644 --- a/noncore/settings/sysinfo/storage.cpp +++ b/noncore/settings/sysinfo/storage.cpp | |||
@@ -29,159 +29,150 @@ | |||
29 | 29 | ||
30 | #include "graph.h" | 30 | #include "graph.h" |
31 | #include "storage.h" | 31 | #include "storage.h" |
32 | 32 | ||
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 34 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
35 | #include <sys/vfs.h> | 35 | #include <sys/vfs.h> |
36 | #include <mntent.h> | 36 | #include <mntent.h> |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) | 39 | FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) |
40 | : QWidget( parent, name ) | 40 | : QWidget( parent, name ) |
41 | { | 41 | { |
42 | QVBoxLayout *tmpvb = new QVBoxLayout( this ); | 42 | QVBoxLayout *tmpvb = new QVBoxLayout( this ); |
43 | QScrollView *sv = new QScrollView( this ); | 43 | QScrollView *sv = new QScrollView( this ); |
44 | tmpvb->addWidget( sv, 0, 0 ); | 44 | tmpvb->addWidget( sv, 0, 0 ); |
45 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 45 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
46 | sv->setFrameStyle( QFrame::NoFrame ); | 46 | sv->setFrameStyle( QFrame::NoFrame ); |
47 | container = new QWidget( sv->viewport() ); | 47 | container = new QWidget( sv->viewport() ); |
48 | sv->addChild( container ); | 48 | sv->addChild( container ); |
49 | vb = 0x0; | 49 | vb = 0x0; |
50 | 50 | ||
51 | storage = new StorageInfo( this ); | 51 | storage = new StorageInfo( this ); |
52 | connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); | 52 | connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); |
53 | 53 | ||
54 | lines.setAutoDelete(TRUE); | 54 | lines.setAutoDelete(TRUE); |
55 | 55 | ||
56 | rebuildDisks = TRUE; | 56 | rebuildDisks = TRUE; |
57 | updateMounts(); | 57 | updateMounts(); |
58 | startTimer( 5000 ); | 58 | startTimer( 5000 ); |
59 | } | 59 | } |
60 | 60 | ||
61 | |||
61 | void FileSysInfo::timerEvent(QTimerEvent*) | 62 | void FileSysInfo::timerEvent(QTimerEvent*) |
62 | { | 63 | { |
63 | updateMounts(); | 64 | updateMounts(); |
64 | } | 65 | } |
65 | 66 | ||
66 | void FileSysInfo::updateMounts() | 67 | void FileSysInfo::updateMounts() |
67 | { | 68 | { |
68 | storage->update(); | 69 | storage->update(); |
69 | 70 | ||
70 | if ( rebuildDisks ) | 71 | if ( rebuildDisks ) |
71 | { | 72 | { |
72 | // Cannot auto delete QDict<MountInfo> disks because it seems to delete | ||
73 | // the filesystem object as well causing a segfault | ||
74 | MountInfo *mi; | ||
75 | for ( QDictIterator<MountInfo> delit(disks); delit.current(); ++delit ) | ||
76 | { | ||
77 | mi = delit.current(); | ||
78 | mi->fs = 0x0; | ||
79 | delete mi; | ||
80 | } | ||
81 | disks.clear(); | 73 | disks.clear(); |
82 | lines.clear(); | 74 | lines.clear(); |
83 | 75 | ||
84 | delete vb; | 76 | delete vb; |
85 | vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); | 77 | vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); |
86 | 78 | ||
87 | bool frst=TRUE; | 79 | bool frst=TRUE; |
88 | 80 | ||
89 | FileSystem *fs; | 81 | FileSystem *fs; |
90 | for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) | 82 | for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) |
91 | { | 83 | { |
92 | fs = it.current(); | 84 | fs = it.current(); |
93 | 85 | ||
94 | if ( !frst ) | 86 | if ( !frst ) |
95 | { | 87 | { |
96 | QFrame *f = new QFrame( container ); | 88 | QFrame *f = new QFrame( container ); |
97 | vb->addWidget(f); | 89 | vb->addWidget(f); |
98 | f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); | 90 | f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); |
99 | lines.append(f); | 91 | lines.append(f); |
100 | f->show(); | 92 | f->show(); |
101 | } | 93 | } |
102 | frst = FALSE; | 94 | frst = FALSE; |
103 | 95 | ||
104 | MountInfo *mi = new MountInfo( fs, container ); | 96 | MountInfo *mi = new MountInfo( fs, container ); |
105 | vb->addWidget( mi ); | 97 | vb->addWidget( mi ); |
106 | disks.insert( fs->path(), mi ); | 98 | disks.insert( fs->path(), mi ); |
107 | mi->show(); | 99 | mi->show(); |
108 | QString tempstr = fs->name().left( 2 ); | 100 | QString tempstr = fs->name().left( 2 ); |
109 | if ( tempstr == tr( "CF" ) ) | 101 | if ( tempstr == tr( "CF" ) ) |
110 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Compact Flash memory card." ) ); | 102 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Compact Flash memory card." ) ); |
111 | else if ( tempstr == tr( "Ha" ) ) | 103 | else if ( tempstr == tr( "Ha" ) ) |
112 | QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) ); | 104 | QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) ); |
113 | else if ( tempstr == tr( "SD" ) ) | 105 | else if ( tempstr == tr( "SD" ) ) |
114 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Secure Digital memory card." ) ); | 106 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Secure Digital memory card." ) ); |
115 | else if ( tempstr == tr( "SC" ) ) | 107 | else if ( tempstr == tr( "SC" ) ) |
116 | QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) ); | 108 | QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) ); |
117 | else if ( tempstr == tr( "In" ) ) | 109 | else if ( tempstr == tr( "In" ) ) |
118 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the built-in memory (i.e. Flash memory) on this handheld device." ) ); | 110 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the built-in memory (i.e. Flash memory) on this handheld device." ) ); |
119 | else if ( tempstr == tr( "RA" ) ) | 111 | else if ( tempstr == tr( "RA" ) ) |
120 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the temporary RAM disk." ) ); | 112 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the temporary RAM disk." ) ); |
121 | } | 113 | } |
122 | vb->addStretch(); | 114 | vb->addStretch(); |
123 | } | 115 | } |
124 | else | 116 | else |
125 | { | 117 | { |
126 | for (QDictIterator<MountInfo> i(disks); i.current(); ++i) | 118 | for (QDictIterator<MountInfo> i(disks); i.current(); ++i) |
127 | i.current()->updateData(); | 119 | i.current()->updateData(); |
128 | } | 120 | } |
129 | 121 | ||
130 | rebuildDisks = FALSE; | 122 | rebuildDisks = FALSE; |
131 | } | 123 | } |
132 | 124 | ||
133 | void FileSysInfo::disksChanged() | 125 | void FileSysInfo::disksChanged() |
134 | { | 126 | { |
135 | rebuildDisks = TRUE; | 127 | rebuildDisks = TRUE; |
136 | } | 128 | } |
137 | 129 | ||
138 | MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) | 130 | MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) |
139 | : QWidget( parent, name ) | 131 | : QWidget( parent, name ) |
140 | { | 132 | { |
141 | QVBoxLayout *vb = new QVBoxLayout( this, 3 ); | 133 | QVBoxLayout *vb = new QVBoxLayout( this, 3 ); |
142 | 134 | ||
143 | totalSize = new QLabel( this ); | 135 | totalSize = new QLabel( this ); |
144 | vb->addWidget( totalSize ); | 136 | vb->addWidget( totalSize ); |
145 | 137 | ||
146 | fs = filesys; | 138 | fs = filesys; |
147 | title = fs->name(); | 139 | title = fs->name(); |
148 | 140 | ||
149 | data = new GraphData(); | 141 | data = new GraphData(); |
150 | graph = new BarGraph( this ); | 142 | graph = new BarGraph( this ); |
151 | graph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 143 | graph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
152 | vb->addWidget( graph, 1 ); | 144 | vb->addWidget( graph, 1 ); |
153 | graph->setData( data ); | 145 | graph->setData( data ); |
154 | 146 | ||
155 | legend = new GraphLegend( this ); | 147 | legend = new GraphLegend( this ); |
156 | legend->setOrientation(Horizontal); | 148 | legend->setOrientation(Horizontal); |
157 | vb->addWidget( legend ); | 149 | vb->addWidget( legend ); |
158 | legend->setData( data ); | 150 | legend->setData( data ); |
159 | 151 | ||
160 | updateData(); | 152 | updateData(); |
161 | } | 153 | } |
162 | 154 | ||
163 | MountInfo::~MountInfo() | 155 | MountInfo::~MountInfo() |
164 | { | 156 | { |
165 | delete data; | 157 | delete data; |
166 | delete fs; | ||
167 | } | 158 | } |
168 | 159 | ||
169 | void MountInfo::updateData() | 160 | void MountInfo::updateData() |
170 | { | 161 | { |
171 | long mult = fs->blockSize() / 1024; | 162 | long mult = fs->blockSize() / 1024; |
172 | long div = 1024 / fs->blockSize(); | 163 | long div = 1024 / fs->blockSize(); |
173 | if ( !mult ) mult = 1; | 164 | if ( !mult ) mult = 1; |
174 | if ( !div ) div = 1; | 165 | if ( !div ) div = 1; |
175 | long total = fs->totalBlocks() * mult / div; | 166 | long total = fs->totalBlocks() * mult / div; |
176 | long avail = fs->availBlocks() * mult / div; | 167 | long avail = fs->availBlocks() * mult / div; |
177 | long used = total - avail; | 168 | long used = total - avail; |
178 | totalSize->setText( title + tr(" : %1 kB").arg( total ) ); | 169 | totalSize->setText( title + tr(" : %1 kB").arg( total ) ); |
179 | data->clear(); | 170 | data->clear(); |
180 | data->addItem( tr("Used (%1 kB)").arg(used), used ); | 171 | data->addItem( tr("Used (%1 kB)").arg(used), used ); |
181 | data->addItem( tr("Available (%1 kB)").arg(avail), avail ); | 172 | data->addItem( tr("Available (%1 kB)").arg(avail), avail ); |
182 | graph->repaint( FALSE ); | 173 | graph->repaint( FALSE ); |
183 | legend->update(); | 174 | legend->update(); |
184 | graph->show(); | 175 | graph->show(); |
185 | legend->show(); | 176 | legend->show(); |
186 | } | 177 | } |
187 | 178 | ||
diff --git a/noncore/settings/sysinfo/sysinfo.h b/noncore/settings/sysinfo/sysinfo.h index d69346a..94c3876 100644 --- a/noncore/settings/sysinfo/sysinfo.h +++ b/noncore/settings/sysinfo/sysinfo.h | |||
@@ -8,26 +8,27 @@ | |||
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 | ** Enhancements by: Dan Williams, <williamsdr@acm.org> | 21 | ** Enhancements by: Dan Williams, <williamsdr@acm.org> |
22 | ** | 22 | ** |
23 | **********************************************************************/ | 23 | **********************************************************************/ |
24 | 24 | ||
25 | #include <qwidget.h> | 25 | #include <qwidget.h> |
26 | 26 | ||
27 | class SystemInfo : public QWidget | 27 | class SystemInfo : public QWidget |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | public: | 30 | public: |
31 | SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 31 | SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
32 | static QString appName() { return QString::fromLatin1("sysinfo"); } | ||
32 | }; | 33 | }; |
33 | 34 | ||
diff --git a/noncore/settings/sysinfo/sysinfo.pro b/noncore/settings/sysinfo/sysinfo.pro index 2582ea2..2322989 100644 --- a/noncore/settings/sysinfo/sysinfo.pro +++ b/noncore/settings/sysinfo/sysinfo.pro | |||
@@ -1,49 +1,48 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG = qt warn_on release quick-app |
2 | CONFIG = qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = memory.h \ | 2 | HEADERS = memory.h \ |
5 | graph.h \ | 3 | graph.h \ |
6 | load.h \ | 4 | load.h \ |
7 | storage.h \ | 5 | storage.h \ |
8 | processinfo.h \ | 6 | processinfo.h \ |
9 | modulesinfo.h \ | 7 | modulesinfo.h \ |
10 | detail.h \ | 8 | detail.h \ |
11 | versioninfo.h \ | 9 | versioninfo.h \ |
12 | sysinfo.h | 10 | sysinfo.h |
13 | SOURCES = main.cpp \ | 11 | SOURCES = main.cpp \ |
14 | memory.cpp \ | 12 | memory.cpp \ |
15 | graph.cpp \ | 13 | graph.cpp \ |
16 | load.cpp \ | 14 | load.cpp \ |
17 | storage.cpp \ | 15 | storage.cpp \ |
18 | processinfo.cpp \ | 16 | processinfo.cpp \ |
19 | modulesinfo.cpp \ | 17 | modulesinfo.cpp \ |
20 | detail.cpp \ | 18 | detail.cpp \ |
21 | versioninfo.cpp \ | 19 | versioninfo.cpp \ |
22 | sysinfo.cpp | 20 | sysinfo.cpp |
23 | INTERFACES = | 21 | |
24 | INCLUDEPATH += $(OPIEDIR)/include | 22 | INCLUDEPATH += $(OPIEDIR)/include |
25 | DEPENDPATH += $(OPIEDIR)/include | 23 | DEPENDPATH += $(OPIEDIR)/include |
26 | LIBS += -lqpe -lopie | 24 | LIBS += -lqpe -lopie |
27 | TARGET = sysinfo | 25 | |
26 | TARGET= sysinfo | ||
28 | 27 | ||
29 | TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ | 28 | TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ |
30 | ../../../i18n/nl/sysinfo.ts \ | 29 | ../../../i18n/nl/sysinfo.ts \ |
31 | ../../../i18n/xx/sysinfo.ts \ | 30 | ../../../i18n/xx/sysinfo.ts \ |
32 | ../../../i18n/en/sysinfo.ts \ | 31 | ../../../i18n/en/sysinfo.ts \ |
33 | ../../../i18n/es/sysinfo.ts \ | 32 | ../../../i18n/es/sysinfo.ts \ |
34 | ../../../i18n/fr/sysinfo.ts \ | 33 | ../../../i18n/fr/sysinfo.ts \ |
35 | ../../../i18n/hu/sysinfo.ts \ | 34 | ../../../i18n/hu/sysinfo.ts \ |
36 | ../../../i18n/ja/sysinfo.ts \ | 35 | ../../../i18n/ja/sysinfo.ts \ |
37 | ../../../i18n/ko/sysinfo.ts \ | 36 | ../../../i18n/ko/sysinfo.ts \ |
38 | ../../../i18n/no/sysinfo.ts \ | 37 | ../../../i18n/no/sysinfo.ts \ |
39 | ../../../i18n/pl/sysinfo.ts \ | 38 | ../../../i18n/pl/sysinfo.ts \ |
40 | ../../../i18n/pt/sysinfo.ts \ | 39 | ../../../i18n/pt/sysinfo.ts \ |
41 | ../../../i18n/pt_BR/sysinfo.ts \ | 40 | ../../../i18n/pt_BR/sysinfo.ts \ |
42 | ../../../i18n/sl/sysinfo.ts \ | 41 | ../../../i18n/sl/sysinfo.ts \ |
43 | ../../../i18n/zh_CN/sysinfo.ts \ | 42 | ../../../i18n/zh_CN/sysinfo.ts \ |
44 | ../../../i18n/zh_TW/sysinfo.ts \ | 43 | ../../../i18n/zh_TW/sysinfo.ts \ |
45 | ../../../i18n/da/sysinfo.ts | 44 | ../../../i18n/da/sysinfo.ts |
46 | 45 | ||
47 | 46 | ||
48 | 47 | ||
49 | include ( $(OPIEDIR)/include.pro ) | 48 | include ( $(OPIEDIR)/include.pro ) |