wpa_gui: select any network as the first entry in the list

Victor Ananyev vindex10 at gmail.com
Tue Sep 15 09:56:34 EDT 2020


Hello all!

I'd like to suggest a little change in the "List of networks". Let's put 
"Select any network" option to the top of the list, otherwise, when 
there are many networks I have to scroll all the way to the bottom each 
time.

For now, the only reason I see it is at the end, is because the option 
should only appear if there is more than 1 network. But this is most 
often true.

Here is an example of change:

diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp 
b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
index 9404ab424..ea36ab85b 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -656,6 +656,8 @@ void WpaGui::updateNetworks()
  	networkSelect->clear();
  	networkList->clear();

+    networkSelect->addItem(tr("Select any network"));
+
  	if (ctrl_conn == NULL)
  		return;

@@ -733,9 +735,6 @@ void WpaGui::updateNetworks()
  		start++;
  	}

-	if (networkSelect->count() > 1)
-		networkSelect->addItem(tr("Select any network"));
-
  	if (!current && first_active >= 0)
  		networkSelect->setCurrentIndex(first_active);

I successfully built wpa_supplicant with this patch on my Gentoo, and it 
works. But I feel like this functionality could be useful for others as 
well :)

Cheers,
Victor



More information about the Hostap mailing list