Diffstat (limited to 'noncore/settings/sysinfo/storage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 39 |
1 files changed, 28 insertions, 11 deletions
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 @@ -12,25 +12,26 @@ ** 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. ** **********************************************************************/ // 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 StorageInfo::StorageInfo( QWidget *parent, const char *name ) : QWidget( parent, name ) { @@ -114,47 +115,63 @@ void StorageInfo::updateMounts() for (; it!=curdisks.end(); ++it, ++fsit) { if ( !frst ) { QFrame *f = new QFrame( this ); 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 } MountInfo::MountInfo( const QString &path, const QString &ttl, QWidget *parent, const char *name ) |