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 | |||
@@ -16,17 +16,18 @@ | |||
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 | // 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> |
31 | #include <mntent.h> | 32 | #include <mntent.h> |
32 | #endif | 33 | #endif |
@@ -118,39 +119,55 @@ void StorageInfo::updateMounts() | |||
118 | vb->addWidget(f); | 119 | vb->addWidget(f); |
119 | f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); | 120 | f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); |
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(); |
155 | } | 172 | } |
156 | #endif | 173 | #endif |