summaryrefslogtreecommitdiff
authordrw <drw>2002-11-17 02:14:03 (UTC)
committer drw <drw>2002-11-17 02:14:03 (UTC)
commit9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2 (patch) (side-by-side diff)
treef84b36548fa91496c0c100c96a3fa1512ec8b108
parent5a1f5ba99dfb754f1be4500dd55dca42b36413b8 (diff)
downloadopie-9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2.zip
opie-9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2.tar.gz
opie-9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2.tar.bz2
Start of What's This for Sysinfo, plus some code tweaks
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/load.cpp9
-rw-r--r--noncore/settings/sysinfo/memory.cpp10
-rw-r--r--noncore/settings/sysinfo/opie-sysinfo.control2
-rw-r--r--noncore/settings/sysinfo/storage.cpp39
-rw-r--r--noncore/settings/sysinfo/sysinfo.cpp2
-rw-r--r--noncore/settings/sysinfo/versioninfo.cpp15
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
@@ -14,23 +14,26 @@
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <stdio.h>
+
+#include <qfile.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qpainter.h>
#include <qpixmap.h>
-#include <qtimer.h>
-#include <qfile.h>
#include <qtextstream.h>
+#include <qtimer.h>
+#include <qwhatsthis.h>
+
#include "load.h"
LoadInfo::LoadInfo( QWidget *parent, const char *name, WFlags f )
: QWidget( parent, name, f )
{
QVBoxLayout *vb = new QVBoxLayout( this, 6 );
QString cpuInfo = getCpuInfo();
@@ -39,16 +42,18 @@ LoadInfo::LoadInfo( QWidget *parent, const char *name, WFlags f )
vb->addWidget( new Load( this ), 100 );
QLabel *l = new QLabel( this );
l->setPixmap( makeLabel( red, tr("Application CPU usage (%)") ) );
vb->addWidget( l, 1 );
l = new QLabel( this );
l->setPixmap( makeLabel( green, tr("System CPU usage (%)") ) );
vb->addWidget( l, 1 );
vb->addStretch(50);
+
+ QWhatsThis::add( this, tr( "This page shows how much this device's processor is being used." ) );
}
QPixmap LoadInfo::makeLabel( const QColor &col, const QString &text )
{
int h = fontMetrics().height();
QPixmap pm( 20 + fontMetrics().width( text ), h );
QPainter p( &pm );
p.fillRect( pm.rect(), colorGroup().background() );
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
@@ -14,25 +14,27 @@
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qlabel.h>
-#include <qtimer.h>
#include <qfile.h>
-#include <qtextstream.h>
#include <qlayout.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <qwhatsthis.h>
+
#include "graph.h"
#include "memory.h"
MemoryInfo::MemoryInfo( QWidget *parent, const char *name, WFlags f )
- : QWidget( parent, name, f )
+ : QWidget( parent, name, WStyle_ContextHelp )
{
QVBoxLayout *vb = new QVBoxLayout( this, 5 );
totalMem = new QLabel( this );
vb->addWidget( totalMem );
data = new GraphData();
// graph = new PieGraph( this );
@@ -46,16 +48,18 @@ MemoryInfo::MemoryInfo( QWidget *parent, const char *name, WFlags f )
legend->setData( data );
vb->addStretch( 1 );
updateData();
QTimer *t = new QTimer( this );
connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) );
t->start( 5000 );
+
+ 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." ) );
}
MemoryInfo::~MemoryInfo()
{
delete data;
}
void MemoryInfo::updateData()
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 @@
Files: bin/sysinfo apps/Applications/sysinfo.desktop pics/sysinfo
Priority: optional
Section: opie/applications
-Maintainer: Dan Williams <wiliamsdr@acm.org>
+Maintainer: Dan Williams <williamsdr@acm.org>
Architecture: arm
Version: $QPE_VERSION-$SUB_VERSION
Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION)
Description: System Information dialog
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
@@ -16,17 +16,18 @@
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
// additions copyright 2002 by L.J. Potter
#include <qlabel.h>
#include <qlayout.h>
#include <qtimer.h>
-#include <qlayout.h>
+#include <qwhatsthis.h>
+
#include "graph.h"
#include "storage.h"
#include <stdio.h>
#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
#include <sys/vfs.h>
#include <mntent.h>
#endif
@@ -118,39 +119,55 @@ void StorageInfo::updateMounts()
vb->addWidget(f);
f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
lines.append(f);
f->show();
} frst=FALSE;
QString humanname=*it;
// qDebug(humanname);
if ( isCF(humanname) )
- humanname = tr("CF Card: "+*fsmount+" "+*fsTit+" ");
+ humanname = tr( "CF Card: " );
else if ( humanname == "/dev/hda1" )
- humanname = tr("Hard Disk "+*fsmount+" "+*fsTit+" ");
+ humanname = tr( "Hard Disk " );
else if ( humanname.left(9) == "/dev/mmcd" )
- humanname = tr("SD Card "+*fsmount+" "+*fsTit+" ");
+ humanname = tr( "SD Card " );
else if ( humanname.left(7) == "/dev/hd" )
- humanname = tr("Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" ";
+ humanname = tr( "Hard Disk /dev/hd " );
else if ( humanname.left(7) == "/dev/sd" )
- humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" ";
+ humanname = tr( "SCSI Hard Disk /dev/sd " );
else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" )
- humanname = tr("Int. Storage "+*fsmount+" "+*fsTit+"\n");
+ humanname = tr( "Int. Storage " );
else if ( humanname.left(14) == "/dev/mtdblock/" )
- humanname = tr("Int. Storage") + " " + humanname.mid(14)+" "+*fsmount+" "+*fsTit+" ";
+ humanname = tr( "Int. Storage /dev/mtdblock/ " );
else if ( humanname.left(13) == "/dev/mtdblock" )
- humanname = tr("Int. Storage") + " " + humanname.mid(13)+" "+*fsmount+" "+*fsTit+" ";
- else if ( humanname.left(9) == "/dev/root" )
- humanname = tr("Int. Storage "+*fsmount+" "+*fsTit+" ");
+ humanname = tr( "Int. Storage /dev/mtdblock " );
+ else if ( humanname.left(9) == "/dev/root" )
+ humanname = tr( "Int. Storage " );
// etc.
+ humanname.append( *fsmount );
+ humanname.append( " " );
+ humanname.append( *fsTit );
+ humanname.append( " " );
+
MountInfo* mi = new MountInfo( *fsit, humanname, this );
vb->addWidget(mi);
disks.insert(*fsit,mi);
mi->show();
fsmount++;fsTit++;
+ QString tempstr = humanname.left( 2 );
+ if ( tempstr == tr( "CF" ) )
+ QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Compact Flash memory card." ) );
+ else if ( tempstr == tr( "Ha" ) )
+ QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) );
+ else if ( tempstr == tr( "SD" ) )
+ QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Secure Digital memory card." ) );
+ else if ( tempstr == tr( "SC" ) )
+ QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) );
+ else if ( tempstr == tr( "In" ) )
+ 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." ) );
}
vb->addStretch();
} else {
// just update them
for (QDictIterator<MountInfo> i(disks); i.current(); ++i)
i.current()->updateData();
}
#endif
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
@@ -33,17 +33,17 @@
#include <opie/otabwidget.h>
#include <qpe/config.h>
#include <qpe/resource.h>
#include <qlayout.h>
SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags f )
- : QWidget( parent, name, f )
+ : QWidget( parent, name, WStyle_ContextHelp )
{
setIcon( Resource::loadPixmap( "system_icon" ) );
setCaption( tr("System Info") );
resize( 220, 180 );
Config config( "qpe" );
config.setGroup( "Appearance" );
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
@@ -16,28 +16,30 @@
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qpe/resource.h>
#include <qpe/version.h>
-
+#include <qfile.h>
+#include <qimage.h>
#include <qlabel.h>
+#include <qlayout.h>
#include <qpixmap.h>
#include <qpainter.h>
-#include <qimage.h>
-#include <qtimer.h>
-#include <qfile.h>
#include <qtextstream.h>
-#include <qlayout.h>
+#include <qtimer.h>
+#include <qwhatsthis.h>
+
#include "versioninfo.h"
#include <opie/odevice.h>
+
using namespace Opie;
VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
: QWidget( parent, name, f )
{
setMinimumSize( 200, 150 );
QVBoxLayout *vb = new QVBoxLayout( this, 4 );
@@ -116,15 +118,16 @@ VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
QString systemString = "<b>"+ ODevice::inst()->systemString()+"</b>"
+tr("<p>Version: " ) + ODevice::inst()->systemVersionString()
+tr("<p>Model: ") + ODevice::inst()->modelString()
+tr("<p>Vendor: ") + ODevice::inst()->vendorString();
QLabel *systemVersion = new QLabel( this );
systemVersion->setText( systemString );
hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft );
-
+
+ QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) );
}
VersionInfo::~VersionInfo()
{
}