[PATCH 1/14]: wpa_gui-qt4: restructure top menu items

Kel Modderman kel at otaku42.de
Tue Jan 29 02:08:54 EST 2008


Restructure the File and Help menus, removing unused properties attributes
and using uniform action names. Update the signal/slot pairs in backend
accordingly.

Add a Network menu and move "Enable All Networks" and "Disable All Networks"
to it. Add new "Add" and "Edit" actions (edit operates on the currently
selected network).

Add a Ctrl+S shortcut to the save configuration action in file menu.

Signed-off-by: Kel Modderman <kel at otaku42.de>
---
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.ui
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.ui
@@ -196,16 +196,21 @@
     <property name="title" >
      <string>&amp;File</string>
     </property>
-    <addaction name="separator" />
     <addaction name="fileEventHistoryAction" />
-    <addaction name="fileAdd_NetworkAction" />
-    <addaction name="fileEdit_networkAction" />
-    <addaction name="fileEnableALLNetworksAction" />
-    <addaction name="fileDisableALLNetworksAction" />
-    <addaction name="fileSaveConfig" />
+    <addaction name="fileSaveConfigAction" />
     <addaction name="separator" />
     <addaction name="fileExitAction" />
    </widget>
+   <widget class="QMenu" name="networkMenu" >
+    <property name="title" >
+     <string>&amp;Network</string>
+    </property>
+    <addaction name="networkAddAction" />
+    <addaction name="networkEditAction" />
+    <addaction name="separator" />
+    <addaction name="networkEnableAllAction" />
+    <addaction name="networkDisableAllAction" />
+   </widget>
    <widget class="QMenu" name="helpMenu" >
     <property name="title" >
      <string>&amp;Help</string>
@@ -216,134 +221,69 @@
     <addaction name="helpAboutAction" />
    </widget>
    <addaction name="fileMenu" />
+   <addaction name="networkMenu" />
    <addaction name="helpMenu" />
   </widget>
-  <action name="fileExitAction" >
+  <action name="fileEventHistoryAction" >
    <property name="text" >
-    <string>E&amp;xit</string>
-   </property>
-   <property name="iconText" >
-    <string>Exit</string>
-   </property>
-   <property name="shortcut" >
-    <string>Ctrl+Q</string>
-   </property>
-   <property name="name" stdset="0" >
-    <string>fileExitAction</string>
+    <string>Event &amp;History</string>
    </property>
   </action>
-  <action name="helpContentsAction" >
-   <property name="enabled" >
-    <bool>false</bool>
-   </property>
+  <action name="fileSaveConfigAction" >
    <property name="text" >
-    <string>&amp;Contents...</string>
-   </property>
-   <property name="iconText" >
-    <string>Contents</string>
+    <string>&amp;Save Configuration</string>
    </property>
    <property name="shortcut" >
-    <string/>
-   </property>
-   <property name="name" stdset="0" >
-    <string>helpContentsAction</string>
+    <string>Ctrl+S</string>
    </property>
   </action>
-  <action name="helpIndexAction" >
-   <property name="enabled" >
-    <bool>false</bool>
-   </property>
+  <action name="fileExitAction" >
    <property name="text" >
-    <string>&amp;Index...</string>
-   </property>
-   <property name="iconText" >
-    <string>Index</string>
+    <string>E&amp;xit</string>
    </property>
    <property name="shortcut" >
-    <string/>
-   </property>
-   <property name="name" stdset="0" >
-    <string>helpIndexAction</string>
+    <string>Ctrl+Q</string>
    </property>
   </action>
-  <action name="helpAboutAction" >
+  <action name="networkAddAction" >
    <property name="text" >
-    <string>&amp;About</string>
-   </property>
-   <property name="iconText" >
-    <string>About</string>
-   </property>
-   <property name="shortcut" >
-    <string/>
-   </property>
-   <property name="name" stdset="0" >
-    <string>helpAboutAction</string>
+    <string>&amp;Add</string>
    </property>
   </action>
-  <action name="fileEventHistoryAction" >
+  <action name="networkEditAction" >
    <property name="text" >
-    <string>Event &amp;History</string>
-   </property>
-   <property name="iconText" >
-    <string>Event History</string>
-   </property>
-   <property name="name" stdset="0" >
-    <string>fileEventHistoryAction</string>
+    <string>&amp;Edit</string>
    </property>
   </action>
-  <action name="fileAdd_NetworkAction" >
+  <action name="networkEnableAllAction" >
    <property name="text" >
-    <string>&amp;Add Network</string>
-   </property>
-   <property name="iconText" >
-    <string>Add Network</string>
-   </property>
-   <property name="name" stdset="0" >
-    <string>fileAdd_NetworkAction</string>
+    <string>E&amp;nable All</string>
    </property>
   </action>
-  <action name="fileEdit_networkAction" >
+  <action name="networkDisableAllAction" >
    <property name="text" >
-    <string>&amp;Edit Network</string>
-   </property>
-   <property name="iconText" >
-    <string>Edit Network</string>
-   </property>
-   <property name="name" stdset="0" >
-    <string>fileEdit_networkAction</string>
+    <string>&amp;Disable All</string>
    </property>
   </action>
-  <action name="fileEnableALLNetworksAction" >
-   <property name="text" >
-    <string>E&amp;nable All Networks</string>
-   </property>
-   <property name="iconText" >
-    <string>Enable All Networks</string>
-   </property>
-   <property name="name" stdset="0" >
-    <string>fileEnableALLNetworksAction</string>
+  <action name="helpContentsAction" >
+   <property name="enabled" >
+    <bool>false</bool>
    </property>
-  </action>
-  <action name="fileDisableALLNetworksAction" >
    <property name="text" >
-    <string>&amp;Disable All Networks</string>
+    <string>&amp;Contents...</string>
    </property>
-   <property name="iconText" >
-    <string>Disable All Networks</string>
+  </action>
+  <action name="helpIndexAction" >
+   <property name="enabled" >
+    <bool>false</bool>
    </property>
-   <property name="name" stdset="0" >
-    <string>fileDisableALLNetworksAction</string>
+   <property name="text" >
+    <string>&amp;Index...</string>
    </property>
   </action>
-  <action name="fileSaveConfig" >
+  <action name="helpAboutAction" >
    <property name="text" >
-    <string>&amp;Save Configuration</string>
-   </property>
-   <property name="iconText" >
-    <string>Save Configuration</string>
-   </property>
-   <property name="name" stdset="0" >
-    <string>fileSaveConfig</string>
+    <string>&amp;About</string>
    </property>
   </action>
  </widget>
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -33,29 +33,30 @@
 
 	(void) statusBar();
 
+	connect(fileEventHistoryAction, SIGNAL(triggered()), this,
+		SLOT(eventHistory()));
+	connect(fileSaveConfigAction, SIGNAL(triggered()), this,
+		SLOT(saveConfig()));
+	connect(fileExitAction, SIGNAL(triggered()), this, SLOT(close()));
+	connect(networkAddAction, SIGNAL(triggered()), this,
+		SLOT(addNetwork()));
+	connect(networkEditAction, SIGNAL(triggered()), this,
+		SLOT(editNetwork()));
+	connect(networkEnableAllAction, SIGNAL(triggered()), this,
+		SLOT(enableAllNetworks()));
+	connect(networkDisableAllAction, SIGNAL(triggered()), this,
+		SLOT(disableAllNetworks()));
 	connect(helpIndexAction, SIGNAL(triggered()), this, SLOT(helpIndex()));
 	connect(helpContentsAction, SIGNAL(triggered()), this,
 		SLOT(helpContents()));
 	connect(helpAboutAction, SIGNAL(triggered()), this, SLOT(helpAbout()));
-	connect(fileExitAction, SIGNAL(triggered()), this, SLOT(close()));
 	connect(disconnectButton, SIGNAL(clicked()), this, SLOT(disconnect()));
 	connect(scanButton, SIGNAL(clicked()), this, SLOT(scan()));
 	connect(connectButton, SIGNAL(clicked()), this, SLOT(connectB()));
-	connect(fileEventHistoryAction, SIGNAL(triggered()), this,
-		SLOT(eventHistory()));
-	connect(networkSelect, SIGNAL(activated(const QString&)), this,
-		SLOT(selectNetwork(const QString&)));
-	connect(fileEdit_networkAction, SIGNAL(triggered()), this,
-		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(fileSaveConfig, SIGNAL(triggered()), this, SLOT(saveConfig()));
 	connect(adapterSelect, SIGNAL(activated(const QString&)), this,
 		SLOT(selectAdapter(const QString&)));
+	connect(networkSelect, SIGNAL(activated(const QString&)), this,
+		SLOT(selectNetwork(const QString&)));
 
 	eh = NULL;
 	scanres = NULL;
---


More information about the HostAP mailing list