[PATCH 14/14]: wpa_gui-qt4: show message when attempting to remove/edit network from empty list

Kel Modderman kel
Mon Jan 28 23:23:29 PST 2008


When attempting to remove or edit the currently selected network, and no
network is currently existing or selected, give the user some feedback.

Signed-off-by: Kel Modderman <kel at otaku42.de>
---
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -851,6 +851,11 @@
 
 void WpaGui::editSelectedNetwork()
 {
+	if (networkSelect->count() < 1) {
+		QMessageBox::information(this, "No Networks",
+			                 "There are no networks to edit.\n");
+		return;
+	}
 	QString sel(networkSelect->currentText());
 	editNetwork(sel);
 }
@@ -915,6 +920,11 @@
 
 void WpaGui::removeSelectedNetwork()
 {
+	if (networkSelect->count() < 1) {
+		QMessageBox::information(this, "No Networks",
+			                 "There are no networks to remove.\n");
+		return;
+	}
 	QString sel(networkSelect->currentText());
 	removeNetwork(sel);
 }
---



More information about the Hostap mailing list