From b7955e0136d06c73ae6e35506c7c40133c488603 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 16 Dec 2019 14:00:04 -0600 Subject: Qt UI: Move filtering in the proper place We restart wpactrl every time we do a new scan (for some reason?), so we need to add the filters when we attempt to join or else they won't be there. --- ui/qt5/netsimplewifipage.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/qt5/netsimplewifipage.cc b/ui/qt5/netsimplewifipage.cc index b9dc3f1..15de6f1 100644 --- a/ui/qt5/netsimplewifipage.cc +++ b/ui/qt5/netsimplewifipage.cc @@ -50,9 +50,6 @@ NetworkSimpleWirelessPage::NetworkSimpleWirelessPage(QWidget *parent) #ifdef HAS_INSTALL_ENV exchange_item.filter = "CTRL-EVENT-SCAN-RESULTS"; exchange_item.cb = &scanResults; - wpactrl_filter_add(&control, "CTRL-EVENT-ASSOC-REJECT"); - wpactrl_filter_add(&control, "CTRL-EVENT-AUTH-REJECT"); - wpactrl_filter_add(&control, "CTRL-EVENT-CONNECTED"); notify = nullptr; connNotify = nullptr; dialog = nullptr; @@ -333,6 +330,10 @@ bool NetworkSimpleWirelessPage::validatePage() { connNotify = nullptr; } + wpactrl_filter_add(&control, "CTRL-EVENT-ASSOC-REJECT"); + wpactrl_filter_add(&control, "CTRL-EVENT-AUTH-REJECT"); + wpactrl_filter_add(&control, "CTRL-EVENT-CONNECTED"); + connNotify = new QSocketNotifier(wpactrl_fd(&control), QSocketNotifier::Read, this); connect(connNotify, &QSocketNotifier::activated, [=](int) { if(wpactrl_update(&control) < 0) { -- cgit v1.2.3-70-g09d2