wpa_gui-qt4: Do not about new network adapters unless service is running
authorJouni Malinen <j@w1.fi>
Thu, 25 Dec 2008 15:32:51 +0000 (17:32 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 25 Dec 2008 15:32:51 +0000 (17:32 +0200)
Skip the user prompt for adding a new network interface if wpa_gui is
not yet connected to wpasvc.

wpa_supplicant/wpa_gui-qt4/wpagui.cpp
wpa_supplicant/wpa_gui-qt4/wpagui.h

index aca98f8..c993a85 100644 (file)
@@ -142,6 +142,7 @@ WpaGui::WpaGui(QWidget *parent, const char *, Qt::WFlags)
        else
                show();
 
+       connectedToService = false;
        textStatus->setText("connecting to wpa_supplicant");
        timer = new QTimer(this);
        connect(timer, SIGNAL(timeout()), SLOT(ping()));
@@ -293,6 +294,7 @@ int WpaGui::openCtrlConnection(const char *ifname)
                        ret = wpa_ctrl_request(ctrl, "INTERFACES", 10, buf,
                                               &len, NULL);
                        if (ret >= 0) {
+                               connectedToService = true;
                                buf[len] = '\0';
                                pos = strchr(buf, '\n');
                                if (pos)
@@ -455,7 +457,8 @@ void WpaGui::updateStatus()
 
 #ifdef CONFIG_NATIVE_WINDOWS
                static bool first = true;
-               if (first && (ctrl_iface == NULL || *ctrl_iface == '\0')) {
+               if (first && connectedToService &&
+                   (ctrl_iface == NULL || *ctrl_iface == '\0')) {
                        first = false;
                        if (QMessageBox::information(
                                    this, qAppName(),
index 2b14458..1067e42 100644 (file)
@@ -134,6 +134,8 @@ private:
 
        QAction *addInterfaceAction;
        AddInterface *add_iface;
+
+       bool connectedToService;
 };
 
 #endif /* WPAGUI_H */