Fix Linux app icon: Set DesktopFileName and add image debug logs
All checks were successful
Build Linux / Build Linux (push) Successful in 1m30s
Build Windows / Build Windows (push) Successful in 2m52s

This commit is contained in:
2026-01-13 19:15:03 +01:00
parent 48b966f9a8
commit e06fd2c776

View File

@@ -3,7 +3,7 @@ import sys
import os import os
import platform import platform
from PyQt6.QtWidgets import QApplication from PyQt6.QtWidgets import QApplication
from PyQt6.QtGui import QIcon from PyQt6.QtGui import QIcon, QImageReader
from teletext.ui import MainWindow from teletext.ui import MainWindow
def resource_path(relative_path): def resource_path(relative_path):
@@ -24,6 +24,13 @@ def main():
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid) ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
app = QApplication(sys.argv) app = QApplication(sys.argv)
app.setApplicationName("TeletextEditor")
app.setOrganizationName("DanielDybing")
app.setDesktopFileName("TeletextEditor") # Helps Linux DEs group windows
# Debug Image Formats
supported_formats = [str(fmt, 'utf-8') for fmt in QImageReader.supportedImageFormats()]
print(f"DEBUG: Supported Image Formats: {supported_formats}")
# Set App Icon # Set App Icon
icon_path = resource_path("app_icon.png") icon_path = resource_path("app_icon.png")
@@ -33,6 +40,13 @@ def main():
print("DEBUG: Icon file found.") print("DEBUG: Icon file found.")
app_icon = QIcon(icon_path) app_icon = QIcon(icon_path)
app.setWindowIcon(app_icon) app.setWindowIcon(app_icon)
# Verify icon loaded
if app_icon.isNull():
print("DEBUG: QIcon is null (failed to load image data)")
else:
print(f"DEBUG: QIcon loaded. Available sizes: {app_icon.availableSizes()}")
else: else:
print("DEBUG: Icon file NOT found.") print("DEBUG: Icon file NOT found.")