Home | History | Annotate | Download | only in wpa_gui-qt4
      1 /*
      2  * wpa_gui - EventHistory class
      3  * Copyright (c) 2005-2006, Jouni Malinen <j (at) w1.fi>
      4  *
      5  * This software may be distributed under the terms of the BSD license.
      6  * See README for more details.
      7  */
      8 
      9 #ifndef EVENTHISTORY_H
     10 #define EVENTHISTORY_H
     11 
     12 #include <QObject>
     13 #include "ui_eventhistory.h"
     14 
     15 
     16 class EventListModel : public QAbstractTableModel
     17 {
     18 	Q_OBJECT
     19 
     20 public:
     21 	EventListModel(QObject *parent = 0)
     22 		: QAbstractTableModel(parent) {}
     23 
     24         int rowCount(const QModelIndex &parent = QModelIndex()) const;
     25         int columnCount(const QModelIndex &parent = QModelIndex()) const;
     26         QVariant data(const QModelIndex &index, int role) const;
     27         QVariant headerData(int section, Qt::Orientation orientation,
     28                             int role = Qt::DisplayRole) const;
     29 	void addEvent(QString time, QString msg);
     30 
     31 private:
     32 	QStringList timeList;
     33 	QStringList msgList;
     34 };
     35 
     36 
     37 class EventHistory : public QDialog, public Ui::EventHistory
     38 {
     39 	Q_OBJECT
     40 
     41 public:
     42 	EventHistory(QWidget *parent = 0, const char *name = 0,
     43 		     bool modal = false, Qt::WFlags fl = 0);
     44 	~EventHistory();
     45 
     46 public slots:
     47 	virtual void addEvents(WpaMsgList msgs);
     48 	virtual void addEvent(WpaMsg msg);
     49 
     50 protected slots:
     51 	virtual void languageChange();
     52 
     53 private:
     54 	EventListModel *elm;
     55 };
     56 
     57 #endif /* EVENTHISTORY_H */
     58