wpa_gui-qt4: Do not about new network adapters unless service is running

Skip the user prompt for adding a new network interface if wpa_gui is
not yet connected to wpasvc.
This commit is contained in:
Jouni Malinen 2008-12-25 17:32:51 +02:00
parent a6f060d7ec
commit 6207129af4
2 changed files with 6 additions and 1 deletions

View file

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

View file

@ -134,6 +134,8 @@ private:
QAction *addInterfaceAction; QAction *addInterfaceAction;
AddInterface *add_iface; AddInterface *add_iface;
bool connectedToService;
}; };
#endif /* WPAGUI_H */ #endif /* WPAGUI_H */