[pkg-wpa-devel] r1259 - in /wpasupplicant/trunk/debian: changelog patches/19_fix_wpa_gui_close_event.patch patches/20_wpa_gui_menu_exec_path.patch patches/21_wpa_gui_tray_start.patch patches/series

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Wed Oct 1 07:13:13 UTC 2008


Author: kelmo-guest
Date: Wed Oct  1 07:13:13 2008
New Revision: 1259

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1259
Log:
  sending the wpa_gui application to the system tray.
* Add 19_fix_wpa_gui_close_event.patch to cleanup handling of application
  window/widget closing, and fix problem of wpa_gui refusing to quit on
  window manager logout.
* Add 21_wpa_gui_tray_start.patch to add support for starting wpa_gui in
  the system tray only.
* Modify 20_wpa_gui_menu_exec_path.patch to use the new -t command line
  option and start wpa_gui in the system tray and avoid desktop startup
  notifications.

Added:
    wpasupplicant/trunk/debian/patches/19_fix_wpa_gui_close_event.patch
    wpasupplicant/trunk/debian/patches/21_wpa_gui_tray_start.patch
Modified:
    wpasupplicant/trunk/debian/changelog
    wpasupplicant/trunk/debian/patches/20_wpa_gui_menu_exec_path.patch
    wpasupplicant/trunk/debian/patches/series

Modified: wpasupplicant/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/changelog?rev=1259&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/changelog (original)
+++ wpasupplicant/trunk/debian/changelog Wed Oct  1 07:13:13 2008
@@ -5,9 +5,17 @@
     may be launched independently from the main status window via the system
     tray icon.
   * Add 18_improve_first_tray_message.patch to make less noise when
-    sending the application to the system tray.
-
- -- Kel Modderman <kel at otaku42.de>  Fri, 26 Sep 2008 05:05:32 +1000
+    sending the wpa_gui application to the system tray.
+  * Add 19_fix_wpa_gui_close_event.patch to cleanup handling of application
+    window/widget closing, and fix problem of wpa_gui refusing to quit on
+    window manager logout.
+  * Add 21_wpa_gui_tray_start.patch to add support for starting wpa_gui in
+    the system tray only.
+  * Modify 20_wpa_gui_menu_exec_path.patch to use the new -t command line
+    option and start wpa_gui in the system tray and avoid desktop startup
+    notifications.
+
+ -- Kel Modderman <kel at otaku42.de>  Wed, 01 Oct 2008 11:55:37 +1000
 
 wpasupplicant (0.6.4-3) experimental; urgency=low
 

Added: wpasupplicant/trunk/debian/patches/19_fix_wpa_gui_close_event.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/19_fix_wpa_gui_close_event.patch?rev=1259&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/19_fix_wpa_gui_close_event.patch (added)
+++ wpasupplicant/trunk/debian/patches/19_fix_wpa_gui_close_event.patch Wed Oct  1 07:13:13 2008
@@ -1,0 +1,76 @@
+When the system tray icon is created, qApp's setQuitOnLastWindowClosed
+property is set to false, therefore do _not_ ignore widget close events, or
+else wpa_gui will refuse to exit when the window manager is logging out.
+
+While at it, remove WpaGui::fileExit() and connect fileExitAction to close().
+
+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
+@@ -37,7 +37,7 @@
+ 		SLOT(eventHistory()));
+ 	connect(fileSaveConfigAction, SIGNAL(triggered()), this,
+ 		SLOT(saveConfig()));
+-	connect(fileExitAction, SIGNAL(triggered()), this, SLOT(fileExit()));
++	connect(fileExitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ 	connect(networkAddAction, SIGNAL(triggered()), this,
+ 		SLOT(addNetwork()));
+ 	connect(networkEditAction, SIGNAL(triggered()), this,
+@@ -1214,11 +1222,6 @@
+ 		showTrayMessage(QSystemTrayIcon::Information, 10, msg);
+ }
+ 
+-void WpaGui::fileExit()
+-{
+-	qApp->quit();
+-}
+-
+ 
+ void WpaGui::closeEvent(QCloseEvent *event)
+ {
+@@ -1240,29 +1243,21 @@
+ 		udr = NULL;
+ 	}
+ 
+-	if (tray_icon && tray_icon->isVisible()) {
++	if (tray_icon && !ackTrayIcon) {
+ 		/* give user a visual hint that the tray icon exists */
+-		if (!ackTrayIcon && QSystemTrayIcon::supportsMessages()) {
++		if (QSystemTrayIcon::supportsMessages()) {
+ 			hide();
+ 			showTrayMessage(QSystemTrayIcon::Information, 3,
+ 					qAppName() + " will keep running in "
+ 					"the system tray.");
+-		} else if (!ackTrayIcon) {
++		} else {
+ 			QMessageBox::information(this, qAppName() + " systray",
+ 						 "The program will keep "
+ 						 "running in the system "
+ 						 "tray.");
+-			hide();
+ 		}
+-
+-		if (ackTrayIcon)
+-			hide();
+-		else
+-			ackTrayIcon = true;
+-
+-		event->ignore();
+-		return;
++		ackTrayIcon = true;
+ 	}
+ 
+-	qApp->quit();
++	event->accept();
+ }
+--- a/wpa_supplicant/wpa_gui-qt4/wpagui.h
++++ b/wpa_supplicant/wpa_gui-qt4/wpagui.h
+@@ -43,7 +43,6 @@
+ 	virtual void parse_argv();
+ 	virtual void updateStatus();
+ 	virtual void updateNetworks();
+-	virtual void fileExit();
+ 	virtual void helpIndex();
+ 	virtual void helpContents();
+ 	virtual void helpAbout();

Modified: wpasupplicant/trunk/debian/patches/20_wpa_gui_menu_exec_path.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/20_wpa_gui_menu_exec_path.patch?rev=1259&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/20_wpa_gui_menu_exec_path.patch (original)
+++ wpasupplicant/trunk/debian/patches/20_wpa_gui_menu_exec_path.patch Wed Oct  1 07:13:13 2008
@@ -1,14 +1,19 @@
 Debian specific patch to desktop meny entry, so that we may exec wpa_gui
 with best estimated privilege level via /usr/share/netdev_wrapper.
+
+Also start directly in the system tray.
 ---
 --- a/wpa_supplicant/wpa_gui-qt4/wpa_gui.desktop
 +++ b/wpa_supplicant/wpa_gui-qt4/wpa_gui.desktop
-@@ -2,7 +2,7 @@
+@@ -2,9 +2,10 @@
  Version=1.0
  Name=wpa_gui
  Comment=Graphical user interface for wpa_supplicant
 -Exec=wpa_gui
-+Exec=/usr/share/wpagui/netdev_wrapper
++Exec=/usr/share/wpagui/netdev_wrapper -t
  Icon=wpa_gui
  GenericName=wpa_supplicant user interface
  Terminal=false
+ Type=Application
+ Categories=Qt;Network;
++StartupNotify=false

Added: wpasupplicant/trunk/debian/patches/21_wpa_gui_tray_start.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/21_wpa_gui_tray_start.patch?rev=1259&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/21_wpa_gui_tray_start.patch (added)
+++ wpasupplicant/trunk/debian/patches/21_wpa_gui_tray_start.patch Wed Oct  1 07:13:13 2008
@@ -1,0 +1,129 @@
+Allow application to be started in the system tray only when started with
+the `-t' command line argument.
+
+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
+@@ -80,17 +80,20 @@
+ 	scanres = NULL;
+ 	udr = NULL;
+ 	tray_icon = NULL;
++	startInTray = false;
+ 	ctrl_iface = NULL;
+ 	ctrl_conn = NULL;
+ 	monitor_conn = NULL;
+ 	msgNotifier = NULL;
+ 	ctrl_iface_dir = strdup("/var/run/wpa_supplicant");
+ 
+-	if (QSystemTrayIcon::isSystemTrayAvailable())
+-		createTrayIcon();
+-
+ 	parse_argv();
+ 
++	if (QSystemTrayIcon::isSystemTrayAvailable())
++		createTrayIcon(startInTray);
++	else
++		show();
++
+ 	textStatus->setText("connecting to wpa_supplicant");
+ 	timer = new QTimer(this);
+ 	connect(timer, SIGNAL(timeout()), SLOT(ping()));
+@@ -105,9 +108,6 @@
+ 	updateStatus();
+ 	networkMayHaveChanged = true;
+ 	updateNetworks();
+-
+-	if (tray_icon)
+-		tray_icon->show();
+ }
+ 
+ 
+@@ -161,7 +161,7 @@
+ {
+ 	int c;
+ 	for (;;) {
+-		c = getopt(qApp->argc(), qApp->argv(), "i:p:");
++		c = getopt(qApp->argc(), qApp->argv(), "i:p:t");
+ 		if (c < 0)
+ 			break;
+ 		switch (c) {
+@@ -173,6 +173,9 @@
+ 			free(ctrl_iface_dir);
+ 			ctrl_iface_dir = strdup(optarg);
+ 			break;
++		case 't':
++			startInTray = true;
++			break;
+ 		}
+ 	}
+ }
+@@ -1085,7 +1088,7 @@
+ }
+ 
+ 
+-void WpaGui::createTrayIcon()
++void WpaGui::createTrayIcon(bool trayOnly)
+ {
+ 	QApplication::setQuitOnLastWindowClosed(false);
+ 
+@@ -1134,6 +1137,11 @@
+ 	tray_menu->addAction(quitAction);
+ 
+ 	tray_icon->setContextMenu(tray_menu);
++
++	tray_icon->show();
++
++	if (!trayOnly)
++		show();
+ }
+ 
+ 
+--- a/wpa_supplicant/wpa_gui-qt4/wpagui.h
++++ b/wpa_supplicant/wpa_gui-qt4/wpagui.h
+@@ -100,8 +100,9 @@
+ 	QAction *quitAction;
+ 	QMenu *tray_menu;
+ 	QSystemTrayIcon *tray_icon;
+-	void createTrayIcon();
++	void createTrayIcon(bool);
+ 	bool ackTrayIcon;
++	bool startInTray;
+ 
+ 	int openCtrlConnection(const char *ifname);
+ };
+--- a/wpa_supplicant/wpa_gui-qt4/main.cpp
++++ b/wpa_supplicant/wpa_gui-qt4/main.cpp
+@@ -32,7 +32,6 @@
+ 	}
+ #endif /* CONFIG_NATIVE_WINDOWS */
+ 
+-	w.show();
+ 	ret = app.exec();
+ 
+ #ifdef CONFIG_NATIVE_WINDOWS
+--- a/wpa_supplicant/doc/docbook/wpa_gui.sgml
++++ b/wpa_supplicant/doc/docbook/wpa_gui.sgml
+@@ -16,6 +16,7 @@
+       <command>wpa_gui</command>
+       <arg>-p <replaceable>path to ctrl sockets</replaceable></arg>
+       <arg>-i <replaceable>ifname</replaceable></arg>
++      <arg>-t</arg>
+     </cmdsynopsis>
+   </refsynopsisdiv>
+ 
+@@ -48,6 +49,14 @@
+ 	configured. By default, choose the first interface found with
+ 	a control socket in the socket path.</para></listitem>
+       </varlistentry>
++
++      <varlistentry>
++	<term>-t</term>
++
++        <listitem><para>Start program in the system tray only (if the window
++	manager supports it). By default the main status window is
++	shown.</para></listitem>
++      </varlistentry>
+     </variablelist>
+   </refsect1>
+   <refsect1>

Modified: wpasupplicant/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/series?rev=1259&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/series (original)
+++ wpasupplicant/trunk/debian/patches/series Wed Oct  1 07:13:13 2008
@@ -15,4 +15,6 @@
 16_wpa_gui_icon_touchup.patch
 17_handle_last_window_closed.patch
 18_improve_first_tray_message.patch
+19_fix_wpa_gui_close_event.patch
 20_wpa_gui_menu_exec_path.patch
+21_wpa_gui_tray_start.patch




More information about the Pkg-wpa-devel mailing list