[PATCH 1/2] wpa_gui-qt4: add status fields to tray message
Kel Modderman
kel
Thu Sep 25 12:22:45 PDT 2008
Hi Jouni,
Thanks for applying these patches.
On Friday 26 September 2008 04:15:17 Jouni Malinen wrote:
> On Thu, Sep 25, 2008 at 12:42:57AM +1000, Kel Modderman wrote:
> > Add extra state status fields to the tray icon message bubble. Do not display
> > an empty message.
>
> Thanks! Applied.
>
> By the way, in which cases is this status message expected to show up? I
> understand the case where it is shown for a new connection. However, I'm
> also seeing it when the main wpa_gui window is closed. Is that on
> purpose?
It is a visible hint to the user that the tray icon exists, and the program
is still running. Rather than some bland text I thought maybe it was better
just to display a status bubble.
> Since the status was likely on the screen at the moment and
> user wanted to close the window, I don't see why we should pop up the
> information immediately as a message bubble..
Okay, I understand how my idea was a little counter-intuitive, please consider
the attached patch.
Don't bother showing a status message when returning to the system tray,
but still show a one time tray message to indicate to the user that the
program is still running in the tray if they triggered the window manager
close button.
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
@@ -1156,6 +1156,7 @@
/* use close() here instead of hide() and allow the
* custom closeEvent handler take care of children */
case QSystemTrayIcon::Trigger:
+ ackTrayIcon = true;
if (isVisible())
close();
else
@@ -1241,21 +1242,24 @@
if (tray_icon && tray_icon->isVisible()) {
/* give user a visual hint that the tray icon exists */
- if (QSystemTrayIcon::supportsMessages()) {
+ if (!ackTrayIcon && QSystemTrayIcon::supportsMessages()) {
hide();
- QTimer::singleShot(1 * 1000, this,
- SLOT(showTrayStatus()));
+ showTrayMessage(QSystemTrayIcon::Information, 3,
+ qAppName() + " will keep running in "
+ "the system tray.");
} else if (!ackTrayIcon) {
QMessageBox::information(this, qAppName() + " systray",
"The program will keep "
- "running in the system tray."
- " To terminate the program, "
- "choose <b>Quit</b> in the "
- "context menu of the system "
- "tray icon.");
- ackTrayIcon = true;
+ "running in the system "
+ "tray.");
hide();
}
+
+ if (ackTrayIcon)
+ hide();
+ else
+ ackTrayIcon = true;
+
event->ignore();
return;
}
---
More information about the Hostap
mailing list