Diffstat (limited to 'noncore/settings/sysinfo/storage.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/storage.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/noncore/settings/sysinfo/storage.h b/noncore/settings/sysinfo/storage.h new file mode 100644 index 0000000..3fa5b79 --- a/dev/null +++ b/noncore/settings/sysinfo/storage.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #include <qwidget.h> | ||
21 | #include <qframe.h> | ||
22 | #include <qlist.h> | ||
23 | #include <qdict.h> | ||
24 | |||
25 | class QLabel; | ||
26 | class GraphData; | ||
27 | class Graph; | ||
28 | class GraphLegend; | ||
29 | class FileSystem; | ||
30 | class MountInfo; | ||
31 | class QVBoxLayout; | ||
32 | |||
33 | |||
34 | class StorageInfo : public QWidget | ||
35 | { | ||
36 | Q_OBJECT | ||
37 | public: | ||
38 | StorageInfo( QWidget *parent=0, const char *name=0 ); | ||
39 | |||
40 | protected: | ||
41 | void timerEvent(QTimerEvent*); | ||
42 | |||
43 | private: | ||
44 | void updateMounts(); | ||
45 | QDict<MountInfo> disks; | ||
46 | QList<QFrame> lines; | ||
47 | QVBoxLayout *vb; | ||
48 | }; | ||
49 | |||
50 | class MountInfo : public QWidget | ||
51 | { | ||
52 | Q_OBJECT | ||
53 | public: | ||
54 | MountInfo( const QString &path, const QString &ttl, QWidget *parent=0, const char *name=0 ); | ||
55 | ~MountInfo(); | ||
56 | |||
57 | void updateData(); | ||
58 | |||
59 | private: | ||
60 | QString title; | ||
61 | FileSystem *fs; | ||
62 | QLabel *totalSize; | ||
63 | GraphData *data; | ||
64 | Graph *graph; | ||
65 | GraphLegend *legend; | ||
66 | }; | ||
67 | |||
68 | class FileSystem | ||
69 | { | ||
70 | public: | ||
71 | FileSystem( const QString &p ); | ||
72 | |||
73 | void update(); | ||
74 | |||
75 | const QString &path() const { return fspath; } | ||
76 | long blockSize() const { return blkSize; } | ||
77 | long totalBlocks() const { return totalBlks; } | ||
78 | long availBlocks() const { return availBlks; } | ||
79 | |||
80 | private: | ||
81 | QString fspath; | ||
82 | long blkSize; | ||
83 | long totalBlks; | ||
84 | long availBlks; | ||
85 | }; | ||
86 | |||
87 | |||