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

Kel Modderman kel at otaku42.de
Tue Jan 29 02:23:29 EST 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