[PATCH]: wpa_gui-qt4: use "ENABLE_NETWORK all" and "DISABLE_NETWORK all" ctrl iface commands

Kel Modderman kel
Sun Jan 13 03:31:57 PST 2008


Add two new menu items to File menu to take advantage of the
"ENABLE_NETWORK all" and "DISABLE_NETWORK all" ctrl iface commands offered
by previously submitted patches.

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
@@ -48,6 +48,10 @@
 		SLOT(editNetwork()));
 	connect(fileAdd_NetworkAction, SIGNAL(triggered()), this,
 		SLOT(addNetwork()));
+	connect(fileEnableALLNetworksAction, SIGNAL(triggered()), this,
+		SLOT(enableAllNetworks()));
+	connect(fileDisableALLNetworksAction, SIGNAL(triggered()), this,
+		SLOT(disableAllNetworks()));
 	connect(adapterSelect, SIGNAL(activated(const QString&)), this,
 		SLOT(selectAdapter(const QString&)));
 
@@ -786,6 +790,22 @@
 }
 
 
+void WpaGui::enableAllNetworks()
+{
+	char reply[10];
+	size_t reply_len = sizeof(reply);
+	ctrlRequest("ENABLE_NETWORK all", reply, &reply_len);
+}
+
+
+void WpaGui::disableAllNetworks()
+{
+	char reply[10];
+	size_t reply_len = sizeof(reply);
+	ctrlRequest("DISABLE_NETWORK all", reply, &reply_len);
+}
+
+
 void WpaGui::selectAdapter( const QString & sel )
 {
 	if (openCtrlConnection(sel.toAscii().constData()) < 0)
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.ui
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.ui
@@ -195,6 +195,8 @@
         <addaction name="fileEventHistoryAction" />
         <addaction name="fileAdd_NetworkAction" />
         <addaction name="fileEdit_networkAction" />
+        <addaction name="fileEnableALLNetworksAction" />
+        <addaction name="fileDisableALLNetworksAction" />
         <addaction name="separator" />
         <addaction name="fileExitAction" />
       </widget>
@@ -305,6 +307,28 @@
         <string>&Edit Network</string>
       </property>
     </action>
+    <action name="fileEnableALLNetworksAction" >
+      <property name="name" stdset="0" >
+        <string>fileEnableALLNetworksAction</string>
+      </property>
+      <property name="iconText" >
+        <string>Enable All Networks</string>
+      </property>
+      <property name="text" >
+        <string>E&nable All Networks</string>
+      </property>
+    </action>
+    <action name="fileDisableALLNetworksAction" >
+      <property name="name" stdset="0" >
+        <string>fileDisableALLNetworksAction</string>
+      </property>
+      <property name="iconText" >
+        <string>Disable All Networks</string>
+      </property>
+      <property name="text" >
+        <string>&Disable All Networks</string>
+      </property>
+    </action>
   </widget>
   <layoutdefault spacing="6" margin="11" />
   <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.h
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.h
@@ -51,6 +51,8 @@
 	virtual void selectNetwork(const QString &sel);
 	virtual void editNetwork();
 	virtual void addNetwork();
+	virtual void enableAllNetworks();
+	virtual void disableAllNetworks();
 	virtual void selectAdapter(const QString &sel);
 	virtual void exitApp();
 
---



More information about the Hostap mailing list