diff --git a/gotify_tray/gui/designs/widget_settings.py b/gotify_tray/gui/designs/widget_settings.py
index 92adc27..36f8568 100644
--- a/gotify_tray/gui/designs/widget_settings.py
+++ b/gotify_tray/gui/designs/widget_settings.py
@@ -19,7 +19,7 @@ class Ui_Dialog(object):
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Apply|QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox")
- self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
+ self.gridLayout.addWidget(self.buttonBox, 1, 4, 1, 1)
self.tabWidget = QtWidgets.QTabWidget(parent=Dialog)
self.tabWidget.setObjectName("tabWidget")
self.tab_general = QtWidgets.QWidget()
@@ -227,7 +227,23 @@ class Ui_Dialog(object):
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.verticalLayout.addItem(spacerItem8)
self.tabWidget.addTab(self.tab_advanced, "")
- self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
+ self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 5)
+ self.label_qt_icon = QtWidgets.QLabel(parent=Dialog)
+ self.label_qt_icon.setText("")
+ self.label_qt_icon.setObjectName("label_qt_icon")
+ self.gridLayout.addWidget(self.label_qt_icon, 1, 2, 1, 1)
+ self.label_app_version = QtWidgets.QLabel(parent=Dialog)
+ self.label_app_version.setText("")
+ self.label_app_version.setObjectName("label_app_version")
+ self.gridLayout.addWidget(self.label_app_version, 1, 1, 1, 1)
+ self.label_app_icon = QtWidgets.QLabel(parent=Dialog)
+ self.label_app_icon.setText("")
+ self.label_app_icon.setObjectName("label_app_icon")
+ self.gridLayout.addWidget(self.label_app_icon, 1, 0, 1, 1)
+ self.label_qt_version = QtWidgets.QLabel(parent=Dialog)
+ self.label_qt_version.setText("")
+ self.label_qt_version.setObjectName("label_qt_version")
+ self.gridLayout.addWidget(self.label_qt_version, 1, 3, 1, 1)
self.retranslateUi(Dialog)
self.tabWidget.setCurrentIndex(0)
diff --git a/gotify_tray/gui/designs/widget_settings.ui b/gotify_tray/gui/designs/widget_settings.ui
index 9cec302..2850ce7 100644
--- a/gotify_tray/gui/designs/widget_settings.ui
+++ b/gotify_tray/gui/designs/widget_settings.ui
@@ -14,7 +14,7 @@
Dialog
- -
+
-
Qt::Horizontal
@@ -24,7 +24,7 @@
- -
+
-
0
@@ -559,6 +559,34 @@
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
diff --git a/gotify_tray/gui/images/qt.png b/gotify_tray/gui/images/qt.png
new file mode 100644
index 0000000..2e0d97f
Binary files /dev/null and b/gotify_tray/gui/images/qt.png differ
diff --git a/gotify_tray/gui/widgets/MessageWidget.py b/gotify_tray/gui/widgets/MessageWidget.py
index 8d5afa9..ee550ff 100644
--- a/gotify_tray/gui/widgets/MessageWidget.py
+++ b/gotify_tray/gui/widgets/MessageWidget.py
@@ -6,7 +6,7 @@ from ..models.MessagesModel import MessageItemDataRole, MessagesModelItem
from ..designs.widget_message import Ui_Form
from gotify_tray.database import Downloader
from gotify_tray.database import Settings
-from gotify_tray.utils import convert_links, get_image, update_widget_property
+from gotify_tray.utils import convert_links, extract_image, update_widget_property
from gotify_tray.gui.themes import get_theme_file
from gotify_tray.gotify.models import GotifyMessageModel
@@ -50,7 +50,7 @@ class MessageWidget(QtWidgets.QWidget, Ui_Form):
# If the message is only an image URL, then instead of showing the message,
# download the image and show it in the message label
- if image_url := get_image(message.message):
+ if image_url := extract_image(message.message):
downloader = Downloader()
filename = downloader.get_filename(image_url)
self.set_message_image(filename)
diff --git a/gotify_tray/gui/widgets/SettingsDialog.py b/gotify_tray/gui/widgets/SettingsDialog.py
index 70173a3..1c0555d 100644
--- a/gotify_tray/gui/widgets/SettingsDialog.py
+++ b/gotify_tray/gui/widgets/SettingsDialog.py
@@ -2,11 +2,12 @@ import logging
import platform
import os
+from gotify_tray.__version__ import __version__
from gotify_tray.database import Cache, Settings
from gotify_tray.gotify import GotifyMessageModel
from gotify_tray.gui.models import MessagesModelItem
from . import MessageWidget
-from gotify_tray.utils import get_icon, verify_server, open_file
+from gotify_tray.utils import get_image, get_icon, verify_server, open_file
from gotify_tray.tasks import (
ExportSettingsTask,
ImportSettingsTask,
@@ -87,6 +88,11 @@ class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
self.groupbox_watchdog.setChecked(settings.value("watchdog/enabled", type=bool))
self.spin_watchdog_interval.setValue(settings.value("watchdog/interval/s", type=int))
+ self.label_app_version.setText(__version__)
+ self.label_qt_version.setText(QtCore.QT_VERSION_STR)
+ self.label_app_icon.setPixmap(QtGui.QIcon(get_image("logo.ico")).pixmap(22,22))
+ self.label_qt_icon.setPixmap(QtGui.QIcon(get_image("qt.png")).pixmap(22,22))
+
def add_message_widget(self):
self.message_widget = MessageWidget(
self,
diff --git a/gotify_tray/utils.py b/gotify_tray/utils.py
index 9a6e7d7..40d5fa3 100644
--- a/gotify_tray/utils.py
+++ b/gotify_tray/utils.py
@@ -35,7 +35,7 @@ def verify_server(force_new: bool = False, enable_import: bool = True) -> bool:
def process_messages(messages: list[gotify.GotifyMessageModel]) -> Iterator[gotify.GotifyMessageModel]:
downloader = Downloader()
for message in messages:
- if image_url := get_image(message.message):
+ if image_url := extract_image(message.message):
downloader.get_filename(image_url)
yield message
@@ -57,7 +57,7 @@ def convert_links(text):
return _link.sub(replace, text)
-def get_image(s: str) -> str | None:
+def extract_image(s: str) -> str | None:
"""If `s` contains only an image URL, this function returns that URL.
This function also extracts a URL in the `![]()` markdown image format.
"""
@@ -91,6 +91,10 @@ def open_file(filename: str):
subprocess.call(["open", filename])
+def get_image(name: str) -> str:
+ return get_abs_path(f"gotify_tray/gui/images/{name}")
+
+
def get_icon(name: str) -> str:
if platform.system() == "Darwin":
name += "-macos"