Move source code to src/leek
This makes the package work again
This commit is contained in:
parent
1a626fddff
commit
6061590270
9 changed files with 16 additions and 10 deletions
36
src/leek/leek_app.py
Normal file
36
src/leek/leek_app.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import signal
|
||||
from PySide6.QtGui import QGuiApplication
|
||||
from PySide6.QtCore import QUrl
|
||||
from PySide6.QtQml import QQmlApplicationEngine
|
||||
|
||||
|
||||
def main():
|
||||
"""Initializes and manages the application execution"""
|
||||
app: QGuiApplication = QGuiApplication(sys.argv)
|
||||
app.setDesktopFileName("xyz.toast003.leek")
|
||||
app.setApplicationName("Leek")
|
||||
engine = QQmlApplicationEngine()
|
||||
|
||||
"""Needed to close the app with Ctrl+C"""
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
|
||||
"""Needed to get proper KDE style outside of Plasma"""
|
||||
if not os.environ.get("QT_QUICK_CONTROLS_STYLE"):
|
||||
os.environ["QT_QUICK_CONTROLS_STYLE"] = "org.kde.desktop"
|
||||
|
||||
base_path = os.path.abspath(os.path.dirname(__file__))
|
||||
url = QUrl(f"file://{base_path}/Main.qml")
|
||||
engine.load(url)
|
||||
|
||||
if len(engine.rootObjects()) == 0:
|
||||
quit()
|
||||
|
||||
app.exec()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue