-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·52 lines (42 loc) · 1.14 KB
/
main.py
File metadata and controls
executable file
·52 lines (42 loc) · 1.14 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
45
46
47
48
49
50
51
52
#!/usr/bin/python
import sys
import signal
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import QTimer
from gui.MainWindow import MainWindow
def main():
# Create the Qt Application
app = QApplication(sys.argv)
app.setOrganizationDomain("com")
app.setOrganizationName("ahl")
app.setApplicationName("PiStreamer")
app.setDesktopFileName("pistreamer")
app.setDesktopSettingsAware(True)
# Set global style (touch-friendly)
app.setStyleSheet("""
* {
font-size: 18px;
}
QPushButton {
font-size: 18px;
min-width: 60px;
min-height: 60px;
}
""")
app.aboutToQuit.connect(lambda: print("Exiting..."))
def on_sigint(signum, frame):
print()
print("SIGINT received")
app.quit()
# Handle Keyboard Interrupts
signal.signal(signal.SIGINT, on_sigint)
timer = QTimer()
timer.start(100)
timer.timeout.connect(lambda: None)
# Create and show the main window
window = MainWindow()
window.show()
# Run the main Qt loop
sys.exit(app.exec())
if __name__ == "__main__":
main()