ui: Don't notify new scan results if ANY interface is connected
authorRoy Marples <roy@marples.name>
Tue, 4 Aug 2020 02:41:29 +0000 (03:41 +0100)
committerRoy Marples <roy@marples.name>
Tue, 4 Aug 2020 02:41:29 +0000 (03:41 +0100)
We don't want to be spammed if wired is connected and wireless isn't.

src/dhcpcd-gtk/main.c
src/dhcpcd-qt/dhcpcd-qt.cpp

index 6444bf8ffefbdd665043faffa8cb32185bd5a4e4..bc45a28c1482cf6e524f4375103142d234940f19 100644 (file)
@@ -620,7 +620,9 @@ dhcpcd_wpa_scan_cb(DHCPCD_WPA *wpa, _unused void *data)
                TAILQ_INIT(&w->menus);
                TAILQ_INSERT_TAIL(&wi_scans, w, next);
        } else {
-               if (!i->up) {
+               DHCPCD_CONNECTION *con = dhcpcd_if_connection(i);
+
+               if (dhcpcd_status(con, NULL) != DHC_CONNECTED) {
                        char *txt, *t;
 
                        txt = NULL;
index bfc72e1a0a5c399d53e9bf3dd24c0a15ef87629a..3730c2a9b90604ed85b1a127018f343805c037b4 100644 (file)
@@ -368,12 +368,9 @@ DhcpcdWi *DhcpcdQt::findWi(DHCPCD_WPA *wpa)
 
 void DhcpcdQt::processScans(DhcpcdWi *wi, DHCPCD_WI_SCAN *scans)
 {
-       DHCPCD_IF *i;
 
        /* Don't spam the user if we're already connected. */
-       i = dhcpcd_wpa_if(wi->getWpa());
-
-       if (!i->up) {
+       if (lastStatus != DHC_CONNECTED) {
                QString title = tr("New Access Point");
                QString txt;
                DHCPCD_WI_SCAN *s1, *s2;