aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_gui-qt4/eventhistory.h
blob: afd7b63469a203de7c5d4ee893c46dba965c209a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * wpa_gui - EventHistory class
 * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
 *
 * This software may be distributed under the terms of the BSD license.
 * See README for more details.
 */

#ifndef EVENTHISTORY_H
#define EVENTHISTORY_H

#include <QObject>
#include "ui_eventhistory.h"


class EventListModel : public QAbstractTableModel
{
	Q_OBJECT

public:
	EventListModel(QObject *parent = 0)
		: QAbstractTableModel(parent) {}

        int rowCount(const QModelIndex &parent = QModelIndex()) const;
        int columnCount(const QModelIndex &parent = QModelIndex()) const;
        QVariant data(const QModelIndex &index, int role) const;
        QVariant headerData(int section, Qt::Orientation orientation,
                            int role = Qt::DisplayRole) const;
	void addEvent(QString time, QString msg);

private:
	QStringList timeList;
	QStringList msgList;
};


class EventHistory : public QDialog, public Ui::EventHistory
{
	Q_OBJECT

public:
	EventHistory(QWidget *parent = 0, const char *name = 0,
		     bool modal = false, Qt::WindowFlags fl = 0);
	~EventHistory();

public slots:
	virtual void addEvents(WpaMsgList msgs);
	virtual void addEvent(WpaMsg msg);

protected slots:
	virtual void languageChange();

private:
	EventListModel *elm;
};

#endif /* EVENTHISTORY_H */