From da8a216587e2a4822771c77221d6cb1295d5be5d Mon Sep 17 00:00:00 2001
From: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Date: Tue, 20 Oct 2020 17:41:20 +0200
Subject: [PATCH] Systray icons added - Issue #925 (#1040)
---
CompileHowto.md | 2 +-
CrossCompileHowto.md | 4 ++--
bin/compile.sh | 1 +
resources/icons/autorun.svg | 1 +
resources/icons/clear.svg | 1 +
resources/icons/color.svg | 1 +
resources/icons/effects.svg | 1 +
resources/icons/hyperion-icon-32px.png | Bin 1997 -> 1454 bytes
resources/icons/quit.svg | 1 +
resources/icons/settings.svg | 1 +
src/hyperiond/systray.cpp | 18 ++++++++----------
11 files changed, 18 insertions(+), 13 deletions(-)
create mode 100644 resources/icons/autorun.svg
create mode 100644 resources/icons/clear.svg
create mode 100644 resources/icons/color.svg
create mode 100644 resources/icons/effects.svg
create mode 100644 resources/icons/quit.svg
create mode 100644 resources/icons/settings.svg
diff --git a/CompileHowto.md b/CompileHowto.md
index 0917928b..d58f820e 100644
--- a/CompileHowto.md
+++ b/CompileHowto.md
@@ -48,7 +48,7 @@ wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/
```
sudo apt-get update
-sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libssl-dev zlib1g-dev
+sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libssl-dev zlib1g-dev
```
**on RPI you need the videocore IV headers**
diff --git a/CrossCompileHowto.md b/CrossCompileHowto.md
index 8ab9f020..4617370a 100644
--- a/CrossCompileHowto.md
+++ b/CrossCompileHowto.md
@@ -4,14 +4,14 @@ Use a clean Raspbian Stretch Lite (on target) and Ubuntu 18/19 (on host) to exec
## On the Target system (here Raspberry Pi)
Install required additional packages.
```
-sudo apt-get install qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-util0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite aptitude qt5-default rsync libssl-dev zlib1g-dev
+sudo apt-get install qtbase5-dev libqt5serialport5-dev libqt5svg5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-util0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite aptitude qt5-default rsync libssl-dev zlib1g-dev
```
## On the Host system (here Ubuntu)
Update the Ubuntu environment to the latest stage and install required additional packages.
```
sudo apt-get update
sudo apt-get upgrade
-sudo apt-get -qq -y install git rsync cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libssl-dev zlib1g-dev
+sudo apt-get -qq -y install git rsync cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5svg5-dev libqt5sql5-sqlite libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libssl-dev zlib1g-dev
```
Refine the target IP or hostname, plus userID as required and set-up cross-compilation environment:
diff --git a/bin/compile.sh b/bin/compile.sh
index 8005ad46..7843d2b9 100755
--- a/bin/compile.sh
+++ b/bin/compile.sh
@@ -27,6 +27,7 @@ sudo apt-get install \
libssl-dev \
libjpeg-dev \
libqt5sql5-sqlite \
+ libqt5svg5-dev \
zlib1g-dev \
if [ -e /dev/vc-cma -a -e /dev/vc-mem ]
diff --git a/resources/icons/autorun.svg b/resources/icons/autorun.svg
new file mode 100644
index 00000000..f87df240
--- /dev/null
+++ b/resources/icons/autorun.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/resources/icons/clear.svg b/resources/icons/clear.svg
new file mode 100644
index 00000000..2adb79c1
--- /dev/null
+++ b/resources/icons/clear.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/resources/icons/color.svg b/resources/icons/color.svg
new file mode 100644
index 00000000..ebf6936b
--- /dev/null
+++ b/resources/icons/color.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/resources/icons/effects.svg b/resources/icons/effects.svg
new file mode 100644
index 00000000..0c35e7ce
--- /dev/null
+++ b/resources/icons/effects.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/resources/icons/hyperion-icon-32px.png b/resources/icons/hyperion-icon-32px.png
index 550ed55814de592f67233a70eca4fd8e84be49e6..ee60b83b46e4ddeec406fbbd4fc126b753455062 100644
GIT binary patch
delta 1436
zcmV;N1!MZn53UQ4B!2;OQb$4nuFf3k0000)WmrjOO-%qQ0000800D<-00aO400961
z02%-Q00003paB2_0000100961paK8{000010000WpaTE|000010000W00000tcGIq
z000FTNkl6z(_WCn==jff_`Fn=H&J>2|LJg+SkDJiCi5}`O{Qw@SsK6(?&sLF7A)vy7KR|Go(pA>LMn>8+
zle$lYDT;oo@-RUbWg;1+Vm!=EB!cNk*L7b#F0QMlTz~Pfx;mqQ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!^19sHj-8WJQZ5J!V8EtT>O6XEmHg_^JaBLG-eusS13OKS&Qf96LBH
zpk073pj$x8Q#cptlYNe5226pA3}8&d88wfnc}&Gco|n{|Q
\ No newline at end of file
diff --git a/resources/icons/settings.svg b/resources/icons/settings.svg
new file mode 100644
index 00000000..d7ed72b2
--- /dev/null
+++ b/resources/icons/settings.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/hyperiond/systray.cpp b/src/hyperiond/systray.cpp
index c4cdfb27..38e27952 100644
--- a/src/hyperiond/systray.cpp
+++ b/src/hyperiond/systray.cpp
@@ -64,32 +64,29 @@ void SysTray::iconActivated(QSystemTrayIcon::ActivationReason reason)
void SysTray::createTrayIcon()
{
+ QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
quitAction = new QAction(tr("&Quit"), this);
- QIcon quitIcon = QIcon::fromTheme("application-exit");
- quitAction->setIcon(quitIcon);
+ quitAction->setIcon(QPixmap(":/quit.svg"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
colorAction = new QAction(tr("&Color"), this);
- QIcon colorIcon = QIcon::fromTheme("applications-graphics");
- colorAction->setIcon(colorIcon);
+ colorAction->setIcon(QPixmap(":/color.svg"));
connect(colorAction, SIGNAL(triggered()), this, SLOT(showColorDialog()));
settingsAction = new QAction(tr("&Settings"), this);
- QIcon settingsIcon = QIcon::fromTheme("preferences-system");
- settingsAction->setIcon(settingsIcon);
+ settingsAction->setIcon(QPixmap(":/settings.svg"));
connect(settingsAction, SIGNAL(triggered()), this, SLOT(settings()));
clearAction = new QAction(tr("&Clear"), this);
- QIcon clearIcon = QIcon::fromTheme("edit-delete");
- clearAction->setIcon(clearIcon);
+ clearAction->setIcon(QPixmap(":/clear.svg"));
connect(clearAction, SIGNAL(triggered()), this, SLOT(clearEfxColor()));
const std::list efxs = _hyperion->getEffects();
_trayIconMenu = new QMenu(this);
_trayIconEfxMenu = new QMenu(_trayIconMenu);
_trayIconEfxMenu->setTitle(tr("Effects"));
- QIcon efxIcon = QIcon::fromTheme("media-playback-start");
- _trayIconEfxMenu->setIcon(efxIcon);
+ _trayIconEfxMenu->setIcon(QPixmap(":/effects.svg"));
for (auto efx : efxs)
{
QAction *efxAction = new QAction(efx.name, this);
@@ -99,6 +96,7 @@ void SysTray::createTrayIcon()
#ifdef _WIN32
autorunAction = new QAction(tr("&Disable autostart"), this);
+ autorunAction->setIcon(QPixmap(":/autorun.svg"));
connect(autorunAction, SIGNAL(triggered()), this, SLOT(setAutorunState()));
_trayIconMenu->addAction(autorunAction);