Merge branch 'develop'

This commit is contained in:
dries.k
2022-09-25 10:43:06 +02:00
12 changed files with 17 additions and 10 deletions

View File

@@ -4,6 +4,8 @@ import platform
block_cipher = None block_cipher = None
logo = "gotify_tray/gui/images/logo.ico" if platform.system() != "Darwin" else "gotify_tray/gui/images/logo-macos.ico"
a = Analysis(['gotify_tray/__main__.py'], a = Analysis(['gotify_tray/__main__.py'],
pathex=[os.getcwd()], pathex=[os.getcwd()],
binaries=[], binaries=[],
@@ -29,7 +31,7 @@ exe = EXE(pyz,
upx=True, upx=True,
console=False, console=False,
version='version.py', version='version.py',
icon='logo.ico') icon=logo)
coll = COLLECT(exe, coll = COLLECT(exe,
a.binaries, a.binaries,
a.zipfiles, a.zipfiles,
@@ -41,5 +43,5 @@ coll = COLLECT(exe,
if platform.system() == "Darwin": if platform.system() == "Darwin":
app = BUNDLE(coll, app = BUNDLE(coll,
name='Gotify Tray.app', name='Gotify Tray.app',
icon='logo.ico', icon=logo,
bundle_identifier=None) bundle_identifier=None)

View File

@@ -18,7 +18,7 @@ from gotify_tray.tasks import (
GetMessagesTask, GetMessagesTask,
ServerConnectionWatchdogTask, ServerConnectionWatchdogTask,
) )
from gotify_tray.utils import get_abs_path, verify_server from gotify_tray.utils import get_icon, verify_server
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
from ..__version__ import __title__ from ..__version__ import __title__
@@ -410,9 +410,7 @@ def start_gui():
app = MainApplication(sys.argv) app = MainApplication(sys.argv)
app.setApplicationName(title) app.setApplicationName(title)
app.setQuitOnLastWindowClosed(False) app.setQuitOnLastWindowClosed(False)
app.setWindowIcon( app.setWindowIcon(QtGui.QIcon(get_icon("gotify-small")))
QtGui.QIcon(get_abs_path("gotify_tray/gui/images/gotify-small.png"))
)
app.setStyle("fusion") app.setStyle("fusion")
init_logger(logger) init_logger(logger)

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -2,7 +2,7 @@ import logging
from PyQt6 import QtGui, QtWidgets from PyQt6 import QtGui, QtWidgets
from gotify_tray.__version__ import __title__ from gotify_tray.__version__ import __title__
from gotify_tray.utils import get_abs_path from gotify_tray.utils import get_icon
logger = logging.getLogger("gotify-tray") logger = logging.getLogger("gotify-tray")
@@ -44,7 +44,7 @@ class Tray(QtWidgets.QSystemTrayIcon):
self.setContextMenu(menu) self.setContextMenu(menu)
def set_icon_ok(self): def set_icon_ok(self):
self.setIcon(QtGui.QIcon(get_abs_path("gotify_tray/gui/images/gotify-small.png"))) self.setIcon(QtGui.QIcon(get_icon("tray")))
def set_icon_error(self): def set_icon_error(self):
self.setIcon(QtGui.QIcon(get_abs_path("gotify_tray/gui/images/gotify-small-error.png"))) self.setIcon(QtGui.QIcon(get_icon("tray-error")))

View File

@@ -57,3 +57,10 @@ def open_file(filename: str):
os.startfile(filename) os.startfile(filename)
elif platform.system() == "Darwin": elif platform.system() == "Darwin":
subprocess.call(["open", filename]) subprocess.call(["open", filename])
def get_icon(name: str) -> str:
if platform.system() == "Darwin":
name += "-macos"
return get_abs_path(f"gotify_tray/gui/images/{name}.png")

View File

@@ -1,4 +1,4 @@
requests==2.28.1 requests==2.28.1
websocket-client==1.4.0 websocket-client==1.3.3
pyqt6==6.3.1 pyqt6==6.3.1
python-dateutil==2.8.2 python-dateutil==2.8.2