author | drw <drw> | 2002-11-17 02:14:03 (UTC) |
---|---|---|
committer | drw <drw> | 2002-11-17 02:14:03 (UTC) |
commit | 9ed0a6022d4c3bcd8428096cdf28cad1e0355ab2 (patch) (side-by-side diff) | |
tree | f84b36548fa91496c0c100c96a3fa1512ec8b108 /noncore/settings/sysinfo/load.cpp | |
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
Diffstat (limited to 'noncore/settings/sysinfo/load.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/load.cpp | 9 |
1 files changed, 7 insertions, 2 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 @@ -10,49 +10,54 @@ ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** 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(); if ( !cpuInfo.isNull() ) vb->addWidget( new QLabel( cpuInfo, this ) ); 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() ); p.fillRect( 0, h/2-4, 18, h/2+3, black ); p.setPen( col ); p.drawLine( 2, h/2, 15, h/2 ); p.setPen( colorGroup().text() ); |