-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrt4d_gui.py
More file actions
44 lines (34 loc) · 1.13 KB
/
Copy pathrt4d_gui.py
File metadata and controls
44 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
"""
RT-4D Desktop GUI Application
Graphical interface for editing RT-4D radio codeplug files
"""
import os
import sys
from pathlib import Path
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication, QStyleFactory
from gui import MainWindow
from gui.theme import apply_theme, get_saved_theme
def main():
"""Main entry point"""
app = QApplication(sys.argv)
app.setApplicationName("RT-4D Editor")
app.setOrganizationName("RT4D Tools")
# Use Fusion style for reliable light/dark palette switching
app.setStyle(QStyleFactory.create("Fusion"))
# Apply saved theme
apply_theme(app, get_saved_theme())
# Set application icon (works for taskbar, title bar, Alt-Tab)
# PyInstaller bundles files next to the exe via sys._MEIPASS
base_path = Path(getattr(sys, '_MEIPASS', Path(__file__).parent))
icon_path = base_path / '4d.png'
if icon_path.exists():
app.setWindowIcon(QIcon(str(icon_path)))
# Create and show main window
window = MainWindow()
window.show()
# Run event loop
sys.exit(app.exec())
if __name__ == '__main__':
main()