peers.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * wpa_gui - Peers class
  3. * Copyright (c) 2009, Atheros Communications
  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 PEERS_H
  15. #define PEERS_H
  16. #include <QObject>
  17. #include <QStandardItemModel>
  18. #include "wpamsg.h"
  19. #include "ui_peers.h"
  20. class WpaGui;
  21. class Peers : public QDialog, public Ui::Peers
  22. {
  23. Q_OBJECT
  24. public:
  25. Peers(QWidget *parent = 0, const char *name = 0,
  26. bool modal = false, Qt::WFlags fl = 0);
  27. ~Peers();
  28. void setWpaGui(WpaGui *_wpagui);
  29. void event_notify(WpaMsg msg);
  30. public slots:
  31. virtual void context_menu(const QPoint &pos);
  32. virtual void enter_pin();
  33. virtual void ctx_refresh();
  34. protected slots:
  35. virtual void languageChange();
  36. virtual void closeEvent(QCloseEvent *event);
  37. private:
  38. void add_station(QString info);
  39. void add_stations();
  40. void add_single_station(const char *addr);
  41. void add_scan_results();
  42. void update_peers();
  43. QStandardItem * find_addr(QString addr);
  44. QStandardItem * find_uuid(QString uuid);
  45. void done(int r);
  46. void remove_enrollee_uuid(QString uuid);
  47. WpaGui *wpagui;
  48. QStandardItemModel model;
  49. QIcon *default_icon;
  50. QStandardItem *ctx_item;
  51. };
  52. #endif /* PEERS_H */