eventhistory.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * wpa_gui - EventHistory class
  3. * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef EVENTHISTORY_H
  15. #define EVENTHISTORY_H
  16. #include <QObject>
  17. #include "ui_eventhistory.h"
  18. class EventListModel : public QAbstractTableModel
  19. {
  20. Q_OBJECT
  21. public:
  22. EventListModel(QObject *parent = 0)
  23. : QAbstractTableModel(parent) {}
  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. private:
  31. QStringList timeList;
  32. QStringList msgList;
  33. };
  34. class EventHistory : public QDialog, public Ui::EventHistory
  35. {
  36. Q_OBJECT
  37. public:
  38. EventHistory(QWidget *parent = 0, const char *name = 0,
  39. bool modal = false, Qt::WFlags fl = 0);
  40. ~EventHistory();
  41. public slots:
  42. virtual void addEvents(WpaMsgList msgs);
  43. virtual void addEvent(WpaMsg msg);
  44. protected slots:
  45. virtual void languageChange();
  46. private:
  47. EventListModel *elm;
  48. };
  49. #endif /* EVENTHISTORY_H */