author | drw <drw> | 2002-11-17 02:14:03 (UTC) |
---|---|---|
committer | drw <drw> | 2002-11-17 02:14:03 (UTC) |
commit | 9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2 (patch) (unidiff) | |
tree | f84b36548fa91496c0c100c96a3fa1512ec8b108 | |
parent | 5a1f5ba99dfb754f1be4500dd55dca42b36413b8 (diff) | |
download | opie-9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2.zip opie-9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2.tar.gz opie-9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2.tar.bz2 |
Start of What's This for Sysinfo, plus some code tweaks
-rw-r--r-- | noncore/settings/sysinfo/load.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/sysinfo/memory.cpp | 10 | ||||
-rw-r--r-- | noncore/settings/sysinfo/opie-sysinfo.control | 2 | ||||
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 39 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/sysinfo/versioninfo.cpp | 15 |
6 files changed, 53 insertions, 24 deletions
diff --git a/noncore/settings/sysinfo/load.cpp b/noncore/settings/sysinfo/load.cpp index 0fcfa6b..900b3d3 100644 --- a/noncore/settings/sysinfo/load.cpp +++ b/noncore/settings/sysinfo/load.cpp | |||
@@ -16,19 +16,22 @@ | |||
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 <stdio.h> | 21 | #include <stdio.h> |
22 | |||
23 | #include <qfile.h> | ||
22 | #include <qlayout.h> | 24 | #include <qlayout.h> |
23 | #include <qlabel.h> | 25 | #include <qlabel.h> |
24 | #include <qpainter.h> | 26 | #include <qpainter.h> |
25 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
26 | #include <qtimer.h> | ||
27 | #include <qfile.h> | ||
28 | #include <qtextstream.h> | 28 | #include <qtextstream.h> |
29 | #include <qtimer.h> | ||
30 | #include <qwhatsthis.h> | ||
31 | |||
29 | #include "load.h" | 32 | #include "load.h" |
30 | 33 | ||
31 | LoadInfo::LoadInfo( QWidget *parent, const char *name, WFlags f ) | 34 | LoadInfo::LoadInfo( QWidget *parent, const char *name, WFlags f ) |
32 | : QWidget( parent, name, f ) | 35 | : QWidget( parent, name, f ) |
33 | { | 36 | { |
34 | QVBoxLayout *vb = new QVBoxLayout( this, 6 ); | 37 | QVBoxLayout *vb = new QVBoxLayout( this, 6 ); |
@@ -41,12 +44,14 @@ LoadInfo::LoadInfo( QWidget *parent, const char *name, WFlags f ) | |||
41 | l->setPixmap( makeLabel( red, tr("Application CPU usage (%)") ) ); | 44 | l->setPixmap( makeLabel( red, tr("Application CPU usage (%)") ) ); |
42 | vb->addWidget( l, 1 ); | 45 | vb->addWidget( l, 1 ); |
43 | l = new QLabel( this ); | 46 | l = new QLabel( this ); |
44 | l->setPixmap( makeLabel( green, tr("System CPU usage (%)") ) ); | 47 | l->setPixmap( makeLabel( green, tr("System CPU usage (%)") ) ); |
45 | vb->addWidget( l, 1 ); | 48 | vb->addWidget( l, 1 ); |
46 | vb->addStretch(50); | 49 | vb->addStretch(50); |
50 | |||
51 | QWhatsThis::add( this, tr( "This page shows how much this device's processor is being used." ) ); | ||
47 | } | 52 | } |
48 | 53 | ||
49 | QPixmap LoadInfo::makeLabel( const QColor &col, const QString &text ) | 54 | QPixmap LoadInfo::makeLabel( const QColor &col, const QString &text ) |
50 | { | 55 | { |
51 | int h = fontMetrics().height(); | 56 | int h = fontMetrics().height(); |
52 | QPixmap pm( 20 + fontMetrics().width( text ), h ); | 57 | QPixmap pm( 20 + fontMetrics().width( text ), h ); |
diff --git a/noncore/settings/sysinfo/memory.cpp b/noncore/settings/sysinfo/memory.cpp index 781f0df..30d42d5 100644 --- a/noncore/settings/sysinfo/memory.cpp +++ b/noncore/settings/sysinfo/memory.cpp | |||
@@ -16,21 +16,23 @@ | |||
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 <qlabel.h> | 21 | #include <qlabel.h> |
22 | #include <qtimer.h> | ||
23 | #include <qfile.h> | 22 | #include <qfile.h> |
24 | #include <qtextstream.h> | ||
25 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | #include <qtextstream.h> | ||
25 | #include <qtimer.h> | ||
26 | #include <qwhatsthis.h> | ||
27 | |||
26 | #include "graph.h" | 28 | #include "graph.h" |
27 | #include "memory.h" | 29 | #include "memory.h" |
28 | 30 | ||
29 | MemoryInfo::MemoryInfo( QWidget *parent, const char *name, WFlags f ) | 31 | MemoryInfo::MemoryInfo( QWidget *parent, const char *name, WFlags f ) |
30 | : QWidget( parent, name, f ) | 32 | : QWidget( parent, name, WStyle_ContextHelp ) |
31 | { | 33 | { |
32 | QVBoxLayout *vb = new QVBoxLayout( this, 5 ); | 34 | QVBoxLayout *vb = new QVBoxLayout( this, 5 ); |
33 | 35 | ||
34 | totalMem = new QLabel( this ); | 36 | totalMem = new QLabel( this ); |
35 | vb->addWidget( totalMem ); | 37 | vb->addWidget( totalMem ); |
36 | 38 | ||
@@ -48,12 +50,14 @@ MemoryInfo::MemoryInfo( QWidget *parent, const char *name, WFlags f ) | |||
48 | vb->addStretch( 1 ); | 50 | vb->addStretch( 1 ); |
49 | updateData(); | 51 | updateData(); |
50 | 52 | ||
51 | QTimer *t = new QTimer( this ); | 53 | QTimer *t = new QTimer( this ); |
52 | connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); | 54 | connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); |
53 | t->start( 5000 ); | 55 | t->start( 5000 ); |
56 | |||
57 | QWhatsThis::add( this, tr( "This page shows how memory (i.e. RAM) is being allocated on your handheld device.\nMemory is categorized as follows:\n\n1. Used - memory used to by Opie and any running applications.\n2. Buffers - temporary storage used to improve performance\n3. Cached - information that has recently been used, but has not been freed yet.\n4. Free - memory not currently used by Opie or any running applications." ) ); | ||
54 | } | 58 | } |
55 | 59 | ||
56 | MemoryInfo::~MemoryInfo() | 60 | MemoryInfo::~MemoryInfo() |
57 | { | 61 | { |
58 | delete data; | 62 | delete data; |
59 | } | 63 | } |
diff --git a/noncore/settings/sysinfo/opie-sysinfo.control b/noncore/settings/sysinfo/opie-sysinfo.control index 796f734..4a6855d 100644 --- a/noncore/settings/sysinfo/opie-sysinfo.control +++ b/noncore/settings/sysinfo/opie-sysinfo.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Files: bin/sysinfo apps/Applications/sysinfo.desktop pics/sysinfo | 1 | Files: bin/sysinfo apps/Applications/sysinfo.desktop pics/sysinfo |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Dan Williams <wiliamsdr@acm.org> | 4 | Maintainer: Dan Williams <williamsdr@acm.org> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | 6 | Version: $QPE_VERSION-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) |
8 | Description: System Information dialog | 8 | Description: System Information dialog |
9 | For the Opie environment. | 9 | For the Opie environment. |
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp index b369ff1..c33663e 100644 --- a/noncore/settings/sysinfo/storage.cpp +++ b/noncore/settings/sysinfo/storage.cpp | |||
@@ -18,13 +18,14 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // additions copyright 2002 by L.J. Potter | 20 | // additions copyright 2002 by L.J. Potter |
21 | #include <qlabel.h> | 21 | #include <qlabel.h> |
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qlayout.h> | 24 | #include <qwhatsthis.h> |
25 | |||
25 | #include "graph.h" | 26 | #include "graph.h" |
26 | #include "storage.h" | 27 | #include "storage.h" |
27 | 28 | ||
28 | #include <stdio.h> | 29 | #include <stdio.h> |
29 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 30 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
30 | #include <sys/vfs.h> | 31 | #include <sys/vfs.h> |
@@ -120,35 +121,51 @@ void StorageInfo::updateMounts() | |||
120 | lines.append(f); | 121 | lines.append(f); |
121 | f->show(); | 122 | f->show(); |
122 | } frst=FALSE; | 123 | } frst=FALSE; |
123 | QString humanname=*it; | 124 | QString humanname=*it; |
124 | // qDebug(humanname); | 125 | // qDebug(humanname); |
125 | if ( isCF(humanname) ) | 126 | if ( isCF(humanname) ) |
126 | humanname = tr("CF Card: "+*fsmount+" "+*fsTit+" "); | 127 | humanname = tr( "CF Card: " ); |
127 | else if ( humanname == "/dev/hda1" ) | 128 | else if ( humanname == "/dev/hda1" ) |
128 | humanname = tr("Hard Disk "+*fsmount+" "+*fsTit+" "); | 129 | humanname = tr( "Hard Disk " ); |
129 | else if ( humanname.left(9) == "/dev/mmcd" ) | 130 | else if ( humanname.left(9) == "/dev/mmcd" ) |
130 | humanname = tr("SD Card "+*fsmount+" "+*fsTit+" "); | 131 | humanname = tr( "SD Card " ); |
131 | else if ( humanname.left(7) == "/dev/hd" ) | 132 | else if ( humanname.left(7) == "/dev/hd" ) |
132 | humanname = tr("Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" "; | 133 | humanname = tr( "Hard Disk /dev/hd " ); |
133 | else if ( humanname.left(7) == "/dev/sd" ) | 134 | else if ( humanname.left(7) == "/dev/sd" ) |
134 | humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" "; | 135 | humanname = tr( "SCSI Hard Disk /dev/sd " ); |
135 | else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" ) | 136 | else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" ) |
136 | humanname = tr("Int. Storage "+*fsmount+" "+*fsTit+"\n"); | 137 | humanname = tr( "Int. Storage " ); |
137 | else if ( humanname.left(14) == "/dev/mtdblock/" ) | 138 | else if ( humanname.left(14) == "/dev/mtdblock/" ) |
138 | humanname = tr("Int. Storage") + " " + humanname.mid(14)+" "+*fsmount+" "+*fsTit+" "; | 139 | humanname = tr( "Int. Storage /dev/mtdblock/ " ); |
139 | else if ( humanname.left(13) == "/dev/mtdblock" ) | 140 | else if ( humanname.left(13) == "/dev/mtdblock" ) |
140 | humanname = tr("Int. Storage") + " " + humanname.mid(13)+" "+*fsmount+" "+*fsTit+" "; | 141 | humanname = tr( "Int. Storage /dev/mtdblock " ); |
141 | else if ( humanname.left(9) == "/dev/root" ) | 142 | else if ( humanname.left(9) == "/dev/root" ) |
142 | humanname = tr("Int. Storage "+*fsmount+" "+*fsTit+" "); | 143 | humanname = tr( "Int. Storage " ); |
143 | // etc. | 144 | // etc. |
145 | humanname.append( *fsmount ); | ||
146 | humanname.append( " " ); | ||
147 | humanname.append( *fsTit ); | ||
148 | humanname.append( " " ); | ||
149 | |||
144 | MountInfo* mi = new MountInfo( *fsit, humanname, this ); | 150 | MountInfo* mi = new MountInfo( *fsit, humanname, this ); |
145 | vb->addWidget(mi); | 151 | vb->addWidget(mi); |
146 | disks.insert(*fsit,mi); | 152 | disks.insert(*fsit,mi); |
147 | mi->show(); | 153 | mi->show(); |
148 | fsmount++;fsTit++; | 154 | fsmount++;fsTit++; |
155 | QString tempstr = humanname.left( 2 ); | ||
156 | if ( tempstr == tr( "CF" ) ) | ||
157 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Compact Flash memory card." ) ); | ||
158 | else if ( tempstr == tr( "Ha" ) ) | ||
159 | QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) ); | ||
160 | else if ( tempstr == tr( "SD" ) ) | ||
161 | QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Secure Digital memory card." ) ); | ||
162 | else if ( tempstr == tr( "SC" ) ) | ||
163 | QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) ); | ||
164 | else if ( tempstr == tr( "In" ) ) | ||
165 | 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." ) ); | ||
149 | } | 166 | } |
150 | vb->addStretch(); | 167 | vb->addStretch(); |
151 | } else { | 168 | } else { |
152 | // just update them | 169 | // just update them |
153 | for (QDictIterator<MountInfo> i(disks); i.current(); ++i) | 170 | for (QDictIterator<MountInfo> i(disks); i.current(); ++i) |
154 | i.current()->updateData(); | 171 | i.current()->updateData(); |
diff --git a/noncore/settings/sysinfo/sysinfo.cpp b/noncore/settings/sysinfo/sysinfo.cpp index f727443..6d2a64f 100644 --- a/noncore/settings/sysinfo/sysinfo.cpp +++ b/noncore/settings/sysinfo/sysinfo.cpp | |||
@@ -35,13 +35,13 @@ | |||
35 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | 37 | ||
38 | #include <qlayout.h> | 38 | #include <qlayout.h> |
39 | 39 | ||
40 | SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags f ) | 40 | SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags f ) |
41 | : QWidget( parent, name, f ) | 41 | : QWidget( parent, name, WStyle_ContextHelp ) |
42 | { | 42 | { |
43 | setIcon( Resource::loadPixmap( "system_icon" ) ); | 43 | setIcon( Resource::loadPixmap( "system_icon" ) ); |
44 | setCaption( tr("System Info") ); | 44 | setCaption( tr("System Info") ); |
45 | 45 | ||
46 | resize( 220, 180 ); | 46 | resize( 220, 180 ); |
47 | 47 | ||
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp index a8db207..79e7fea 100644 --- a/noncore/settings/sysinfo/versioninfo.cpp +++ b/noncore/settings/sysinfo/versioninfo.cpp | |||
@@ -18,24 +18,26 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include <qpe/version.h> | 22 | #include <qpe/version.h> |
23 | 23 | ||
24 | 24 | #include <qfile.h> | |
25 | #include <qimage.h> | ||
25 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qlayout.h> | ||
26 | #include <qpixmap.h> | 28 | #include <qpixmap.h> |
27 | #include <qpainter.h> | 29 | #include <qpainter.h> |
28 | #include <qimage.h> | ||
29 | #include <qtimer.h> | ||
30 | #include <qfile.h> | ||
31 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
32 | #include <qlayout.h> | 31 | #include <qtimer.h> |
32 | #include <qwhatsthis.h> | ||
33 | |||
33 | #include "versioninfo.h" | 34 | #include "versioninfo.h" |
34 | 35 | ||
35 | #include <opie/odevice.h> | 36 | #include <opie/odevice.h> |
37 | |||
36 | using namespace Opie; | 38 | using namespace Opie; |
37 | 39 | ||
38 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | 40 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) |
39 | : QWidget( parent, name, f ) | 41 | : QWidget( parent, name, f ) |
40 | { | 42 | { |
41 | setMinimumSize( 200, 150 ); | 43 | setMinimumSize( 200, 150 ); |
@@ -118,13 +120,14 @@ VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | |||
118 | +tr("<p>Model: ") + ODevice::inst()->modelString() | 120 | +tr("<p>Model: ") + ODevice::inst()->modelString() |
119 | +tr("<p>Vendor: ") + ODevice::inst()->vendorString(); | 121 | +tr("<p>Vendor: ") + ODevice::inst()->vendorString(); |
120 | 122 | ||
121 | QLabel *systemVersion = new QLabel( this ); | 123 | QLabel *systemVersion = new QLabel( this ); |
122 | systemVersion->setText( systemString ); | 124 | systemVersion->setText( systemString ); |
123 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 125 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
124 | 126 | ||
127 | QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); | ||
125 | } | 128 | } |
126 | 129 | ||
127 | VersionInfo::~VersionInfo() | 130 | VersionInfo::~VersionInfo() |
128 | { | 131 | { |
129 | } | 132 | } |
130 | 133 | ||