Diffstat (limited to 'noncore/settings/sysinfo/modulesinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/modulesinfo.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp index 7a32c20..a0d26c7 100644 --- a/noncore/settings/sysinfo/modulesinfo.cpp +++ b/noncore/settings/sysinfo/modulesinfo.cpp | |||
@@ -1,73 +1,75 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** ModulesInfo | 2 | ** ModulesInfo |
3 | ** | 3 | ** |
4 | ** Display Modules information | 4 | ** Display Modules information |
5 | ** | 5 | ** |
6 | ** Copyright (C) 2002, Michael Lauer | 6 | ** Copyright (C) 2002, Michael Lauer |
7 | ** mickey@tm.informatik.uni-frankfurt.de | 7 | ** mickey@tm.informatik.uni-frankfurt.de |
8 | ** http://www.Vanille.de | 8 | ** http://www.Vanille.de |
9 | ** | 9 | ** |
10 | ** Based on ProcessInfo by Dan Williams <williamsdr@acm.org> | 10 | ** Based on ProcessInfo by Dan Williams <williamsdr@acm.org> |
11 | ** | 11 | ** |
12 | ** This file may be distributed and/or modified under the terms of the | 12 | ** This file may be distributed and/or modified under the terms of the |
13 | ** GNU General Public License version 2 as published by the Free Software | 13 | ** GNU General Public License version 2 as published by the Free Software |
14 | ** Foundation and appearing in the file LICENSE.GPL included in the | 14 | ** Foundation and appearing in the file LICENSE.GPL included in the |
15 | ** packaging of this file. | 15 | ** packaging of this file. |
16 | ** | 16 | ** |
17 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 17 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
18 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 18 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
23 | 23 | ||
24 | #include <qfile.h> | ||
24 | #include <qheader.h> | 25 | #include <qheader.h> |
25 | #include <qlistview.h> | ||
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlistview.h> | ||
27 | #include <qtimer.h> | 28 | #include <qtimer.h> |
28 | #include <qfile.h> | 29 | #include <qwhatsthis.h> |
29 | 30 | ||
30 | #include "modulesinfo.h" | 31 | #include "modulesinfo.h" |
31 | 32 | ||
32 | ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) | 33 | ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) |
33 | : QWidget( parent, name, fl ) | 34 | : QWidget( parent, name, fl ) |
34 | { | 35 | { |
35 | QVBoxLayout *layout = new QVBoxLayout( this, 5 ); | 36 | QVBoxLayout *layout = new QVBoxLayout( this, 5 ); |
36 | 37 | ||
37 | ModulesView = new QListView( this, "ModulesView" ); | 38 | ModulesView = new QListView( this, "ModulesView" ); |
38 | int colnum = ModulesView->addColumn( tr( "Module" ) ); | 39 | int colnum = ModulesView->addColumn( tr( "Module" ) ); |
39 | colnum = ModulesView->addColumn( tr( "Size" ) ); | 40 | colnum = ModulesView->addColumn( tr( "Size" ) ); |
40 | ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); | 41 | ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); |
41 | colnum = ModulesView->addColumn( tr( "Use#" ) ); | 42 | colnum = ModulesView->addColumn( tr( "Use#" ) ); |
42 | ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); | 43 | ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); |
43 | colnum = ModulesView->addColumn( tr( "Used By" ) ); | 44 | colnum = ModulesView->addColumn( tr( "Used By" ) ); |
44 | ModulesView->setAllColumnsShowFocus( TRUE ); | 45 | ModulesView->setAllColumnsShowFocus( TRUE ); |
45 | QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); | 46 | QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); |
46 | connect( ModulesView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), | 47 | connect( ModulesView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), |
47 | this, SLOT( viewModules( QListViewItem * ) ) ); | 48 | this, SLOT( viewModules( QListViewItem * ) ) ); |
48 | |||
49 | layout->addWidget( ModulesView ); | 49 | layout->addWidget( ModulesView ); |
50 | QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) ); | ||
51 | |||
50 | QTimer *t = new QTimer( this ); | 52 | QTimer *t = new QTimer( this ); |
51 | connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); | 53 | connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); |
52 | t->start( 5000 ); | 54 | t->start( 5000 ); |
53 | 55 | ||
54 | updateData(); | 56 | updateData(); |
55 | 57 | ||
56 | ModulesDtl = new ModulesDetail( 0, 0, 0 ); | 58 | ModulesDtl = new ModulesDetail( 0, 0, 0 ); |
57 | ModulesDtl->ModulesView->setTextFormat( PlainText ); | 59 | ModulesDtl->ModulesView->setTextFormat( PlainText ); |
58 | } | 60 | } |
59 | 61 | ||
60 | ModulesInfo::~ModulesInfo() | 62 | ModulesInfo::~ModulesInfo() |
61 | { | 63 | { |
62 | } | 64 | } |
63 | 65 | ||
64 | void ModulesInfo::updateData() | 66 | void ModulesInfo::updateData() |
65 | { | 67 | { |
66 | char modname[64]; | 68 | char modname[64]; |
67 | char usage[200]; | 69 | char usage[200]; |
68 | int modsize, usecount; | 70 | int modsize, usecount; |
69 | 71 | ||
70 | ModulesView->clear(); | 72 | ModulesView->clear(); |
71 | 73 | ||
72 | FILE *procfile = fopen( ( QString ) ( "/proc/modules"), "r"); | 74 | FILE *procfile = fopen( ( QString ) ( "/proc/modules"), "r"); |
73 | 75 | ||