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:
parent
a6f060d7ec
commit
6207129af4
2 changed files with 6 additions and 1 deletions
|
@ -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(),
|
||||
|
|
|
@ -134,6 +134,8 @@ private:
|
|||
|
||||
QAction *addInterfaceAction;
|
||||
AddInterface *add_iface;
|
||||
|
||||
bool connectedToService;
|
||||
};
|
||||
|
||||
#endif /* WPAGUI_H */
|
||||
|
|
Loading…
Reference in a new issue