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.
This commit is contained in:
parent
012783f1ab
commit
8038591be2
4 changed files with 13 additions and 1 deletions
5
wpa_supplicant/wpa_gui-qt4/icons_png.qrc
Normal file
5
wpa_supplicant/wpa_gui-qt4/icons_png.qrc
Normal file
|
@ -0,0 +1,5 @@
|
|||
<RCC>
|
||||
<qresource prefix="/icons" >
|
||||
<file alias="wpa_gui.png">icons/hicolor/16x16/apps/wpa_gui.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <cstdio>
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
#include <QImageReader>
|
||||
|
||||
#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");
|
||||
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)),
|
||||
|
|
Loading…
Reference in a new issue