Small tweaks

This commit is contained in:
oitsjustjose 2025-03-30 08:35:39 -05:00
commit d8414dbfee

View file

@ -1,8 +1,10 @@
import platform
import sys import sys
from pathlib import Path from pathlib import Path
from typing import Callable from typing import Callable
from PySide6.QtCore import QThread from PySide6.QtCore import QThread
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import ( from PySide6.QtWidgets import (
QApplication, QApplication,
QComboBox, QComboBox,
@ -20,11 +22,15 @@ from src.messaging import MessageInterface
from src.music_file import MODEL_CHOICES from src.music_file import MODEL_CHOICES
from src.processor import FolderProcessor from src.processor import FolderProcessor
APP_ID = "com.oitsjustjose.drum-track-converter"
class MainWindow(QMainWindow): class MainWindow(QMainWindow):
def __init__(self): def __init__(self, icon: QIcon):
super().__init__() super().__init__()
self.setWindowIcon(icon)
# Widgets that we'll want to set throughout the runtime # Widgets that we'll want to set throughout the runtime
self.start_button: QPushButton = None self.start_button: QPushButton = None
self.logging_region: QTextEdit = None self.logging_region: QTextEdit = None
@ -287,7 +293,13 @@ def main() -> None:
in the meantime the off-thread processing (if any) is stopped. in the meantime the off-thread processing (if any) is stopped.
""" """
app = QApplication(sys.argv) app = QApplication(sys.argv)
window = MainWindow()
icon = QIcon()
icon.addFile("assets/icon.png")
icon.addFile("assets/icon.ico")
app.setWindowIcon(icon)
window = MainWindow(icon)
window.show() window.show()
exit_code = app.exec() exit_code = app.exec()
window.stop_thread() window.stop_thread()
@ -295,4 +307,10 @@ def main() -> None:
if __name__ == "__main__": if __name__ == "__main__":
# Set the AppUserModelId so that the proper taskbar icon renders
if platform.system() == "Windows":
import ctypes
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(APP_ID)
main() main()