summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/storage.h
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/storage.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/storage.h87
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
25class QLabel;
26class GraphData;
27class Graph;
28class GraphLegend;
29class FileSystem;
30class MountInfo;
31class QVBoxLayout;
32
33
34class StorageInfo : public QWidget
35{
36 Q_OBJECT
37public:
38 StorageInfo( QWidget *parent=0, const char *name=0 );
39
40protected:
41 void timerEvent(QTimerEvent*);
42
43private:
44 void updateMounts();
45 QDict<MountInfo> disks;
46 QList<QFrame> lines;
47 QVBoxLayout *vb;
48};
49
50class MountInfo : public QWidget
51{
52 Q_OBJECT
53public:
54 MountInfo( const QString &path, const QString &ttl, QWidget *parent=0, const char *name=0 );
55 ~MountInfo();
56
57 void updateData();
58
59private:
60 QString title;
61 FileSystem *fs;
62 QLabel *totalSize;
63 GraphData *data;
64 Graph *graph;
65 GraphLegend *legend;
66};
67
68class FileSystem
69{
70public:
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
80private:
81 QString fspath;
82 long blkSize;
83 long totalBlks;
84 long availBlks;
85};
86
87