eventhistory.h 1.3 KB

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