From 8038591be2f49eb3851157f1d043706e761d54ac Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 21 Nov 2008 13:58:12 +0200 Subject: [PATCH] wpa_gui: Add a PNG version of the tray icon for Windows binary build It looks like Qt does not support SVG format by default on Windows and it was not trivial to add the plugin into the build, so for now, build a 16x16 PNG icon file for Windows binary to avoid showing an invisible icon in the tray. --- wpa_supplicant/wpa_gui-qt4/icons_png.qrc | 5 +++++ wpa_supplicant/wpa_gui-qt4/setup-mingw-cross-compiling | 2 ++ wpa_supplicant/wpa_gui-qt4/wpa_gui.pro | 1 + wpa_supplicant/wpa_gui-qt4/wpagui.cpp | 6 +++++- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 wpa_supplicant/wpa_gui-qt4/icons_png.qrc diff --git a/wpa_supplicant/wpa_gui-qt4/icons_png.qrc b/wpa_supplicant/wpa_gui-qt4/icons_png.qrc new file mode 100644 index 000000000..09f3d9620 --- /dev/null +++ b/wpa_supplicant/wpa_gui-qt4/icons_png.qrc @@ -0,0 +1,5 @@ + + + icons/hicolor/16x16/apps/wpa_gui.png + + diff --git a/wpa_supplicant/wpa_gui-qt4/setup-mingw-cross-compiling b/wpa_supplicant/wpa_gui-qt4/setup-mingw-cross-compiling index 07e4a8fb6..b7d57f6a9 100755 --- a/wpa_supplicant/wpa_gui-qt4/setup-mingw-cross-compiling +++ b/wpa_supplicant/wpa_gui-qt4/setup-mingw-cross-compiling @@ -9,3 +9,5 @@ cat Makefile.Release | sed s%/usr/lib/qt4%/q/jm/qt4-win/4.3.3/lib%g | sed s%/usr/include/qt4%/q/jm/qt4-win/4.3.3/include%g > tmp.Makefile.Release && mv -f tmp.Makefile.Release Makefile.Release + +make -C icons diff --git a/wpa_supplicant/wpa_gui-qt4/wpa_gui.pro b/wpa_supplicant/wpa_gui-qt4/wpa_gui.pro index c7dfa05b5..0f94f487b 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpa_gui.pro +++ b/wpa_supplicant/wpa_gui-qt4/wpa_gui.pro @@ -14,6 +14,7 @@ win32 { LIBS += -lws2_32 -static DEFINES += CONFIG_NATIVE_WINDOWS CONFIG_CTRL_IFACE_NAMED_PIPE SOURCES += ../../src/utils/os_win32.c + RESOURCES += icons_png.qrc } else { DEFINES += CONFIG_CTRL_IFACE_UNIX SOURCES += ../../src/utils/os_unix.c diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp index 8f73967e1..f1861e459 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp +++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "wpagui.h" #include "dirent.h" @@ -1095,7 +1096,10 @@ void WpaGui::createTrayIcon(bool trayOnly) tray_icon = new QSystemTrayIcon(this); tray_icon->setToolTip(qAppName() + " - wpa_supplicant user interface"); - tray_icon->setIcon(QIcon(":/icons/wpa_gui.svg")); + if (QImageReader::supportedImageFormats().contains(QByteArray("svg"))) + tray_icon->setIcon(QIcon(":/icons/wpa_gui.svg")); + else + tray_icon->setIcon(QIcon(":/icons/wpa_gui.png")); connect(tray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),