Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / kinfocenter / samba / kcmsambastatistics.h
blob0e0e1f0e0a51be16f5f2990b415d9bbcf74d8b32
1 /*
2 * kcmsambastatistics.h
4 * Copyright (c) 2000 Alexander Neundorf <alexander.neundorf@rz.tu-ilmenau.de>
6 * Requires the Qt widget libraries, available at no cost at
7 * http://www.troll.no/
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef kcmsambastatistics_h_included
24 #define kcmsambastatistics_h_included
26 #include <Qt3Support/Q3PtrList>
27 #include <QWidget>
29 class Q3ListView;
30 class QLabel;
31 class QComboBox;
32 class QCheckBox;
33 class QLineEdit;
34 class QPushButton;
36 class KConfig;
38 class SmallLogItem {
39 public:
40 SmallLogItem() :
41 name(""), count(0) {
43 SmallLogItem(const QString &n) :
44 name(n), count(1) {
46 QString name;
47 int count;
50 class LogItem {
51 public:
52 LogItem() :
53 name(""), accessed(), count(0) {
55 LogItem(const QString &n, const QString &a) :
56 name(n), accessed(), count(1) {
57 accessed.setAutoDelete(true);
58 accessed.append(new SmallLogItem(a));
60 QString name;
61 //QStrList accessedBy;
62 Q3PtrList<SmallLogItem> accessed;
63 int count;
64 SmallLogItem* itemInList(const QString &name);
65 void addItem(const QString &host);
68 class SambaLog {
69 public:
70 SambaLog() {
71 items.setAutoDelete(true);
73 Q3PtrList<LogItem> items;
74 void addItem(const QString &share, const QString &host);
75 void printItems();
76 private:
77 LogItem* itemInList(const QString &name);
80 class StatisticsView : public QWidget {
81 Q_OBJECT
82 public:
83 explicit StatisticsView(QWidget *parent=0, KConfig *config=0);
84 virtual ~StatisticsView() {
86 void saveSettings() {
88 void loadSettings() {
90 public Q_SLOTS:
91 void setListInfo(Q3ListView *list, int nrOfFiles, int nrOfConnections);
92 private:
93 KConfig *configFile;
94 Q3ListView *dataList;
95 Q3ListView* viewStatistics;
96 QLabel* connectionsL, *filesL;
97 QComboBox* eventCb;
98 QLabel* eventL;
99 QLineEdit* serviceLe;
100 QLabel* serviceL;
101 QLineEdit* hostLe;
102 QLabel* hostL;
103 QPushButton* calcButton, *clearButton;
104 QCheckBox* expandedInfoCb, *expandedUserCb;
105 int connectionsCount, filesCount, calcCount;
106 private Q_SLOTS:
107 void clearStatistics();
108 void calculate();
110 #endif // main_included