Fix a crash by clearing our reference to the menuwidget when it is deleted
[dhcpcd-ui] / src / dhcpcd-qt / dhcpcd-ssidmenu.h
index 75a27eb26f6588afb0df62adc7cf64c945033f26..a359c50459f9b6098007f16a12f12c4099c17ed2 100644 (file)
  * SUCH DAMAGE.
  */
 
-#include <QWidget>
+#include <QWidgetAction>
 
 #include "dhcpcd.h"
 
-class QRadioButton;
-class QLabel;
-class QProgressBar;
+class QWidget;
 
-class DhcpcdSsidMenu : public QWidget
+class DhcpcdWi;
+class DhcpcdSsidMenuWidget;
+
+class DhcpcdSsidMenu : public QWidgetAction
 {
        Q_OBJECT
 
 public:
-       DhcpcdSsidMenu(QWidget *parent, DHCPCD_IF *ifp, DHCPCD_WI_SCAN *scan);
+       DhcpcdSsidMenu(QWidget *parent,
+           DhcpcdWi *wi, DHCPCD_WI_SCAN *scan);
        ~DhcpcdSsidMenu() {};
 
-signals:
-       void selected(DHCPCD_IF *ifp, DHCPCD_WI_SCAN *scan);
+       QWidget *createWidget(QWidget *parent);
+       void deleteWidget(QWidget *widget);
+       DHCPCD_WI_SCAN *getScan();
+       void setScan(DHCPCD_WI_SCAN *scan);
+       bool isAssociated();
 
-private slots:
-       bool eventFilter(QObject *obj, QEvent *event);
+public slots:
+       void hover();
+       void trigger();
+
+signals:
+       void hovered();
+       void triggered(DHCPCD_WI_SCAN *scan);
 
 private:
-       DHCPCD_IF *ifp;
+       DhcpcdWi *wi;
        DHCPCD_WI_SCAN *scan;
-
-       QRadioButton *button;
-       QLabel *licon;
-       QProgressBar *bar;
+       DhcpcdSsidMenuWidget *ssidWidget;
 };