You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.4 KiB
Python
78 lines
2.4 KiB
Python
# -*- coding: iso-8859-1 -*-
|
|
###
|
|
# Importe PyQT5
|
|
###
|
|
from PyQt5 import QtCore as qtc
|
|
from PyQt5 import QtWidgets as qtw
|
|
from PyQt5 import QtGui as qtg
|
|
import qdarkstyle
|
|
|
|
###
|
|
# Allgemeine Import-Notiz:
|
|
# Jeder Import aus Subfoldern heraus wird stehts aus Sicht dieser Datei importiert.
|
|
# Relative importierung (via . & .. ,etc) darf nie bis hoch ins root Verzeichnis laufen sonst Compiler Fehler!
|
|
###
|
|
|
|
from inspect import getsourcefile
|
|
from os import path
|
|
from assets.resources import resources
|
|
|
|
from steamModManager_view import SteamModManager_Dialog
|
|
|
|
class SteamModManager():
|
|
app: qtw.QApplication
|
|
screenStack: qtw.QStackedWidget
|
|
lightMode: str
|
|
testMode: bool
|
|
errorText: str
|
|
dialog: SteamModManager_Dialog
|
|
res: resources
|
|
|
|
def __init__(self, testMode: bool = False, *args, **kwargs):
|
|
"""Initialize of main Controller class"""
|
|
self.app = qtw.QApplication([])
|
|
self.app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api='pyqt5'))
|
|
|
|
self.testMode = testMode
|
|
self.errorText = ""
|
|
|
|
self.screenStack = qtw.QStackedWidget()
|
|
self.screenStack.setObjectName("screenStack")
|
|
self.screenStack.setWindowTitle("SteamModManager")
|
|
self.screenStack.setWindowModality(qtc.Qt.NonModal)
|
|
self.screenStack.resize(752, 582)
|
|
sizePolicy = qtw.QSizePolicy(
|
|
qtw.QSizePolicy.Expanding, qtw.QSizePolicy.Expanding)
|
|
sizePolicy.setHorizontalStretch(0)
|
|
sizePolicy.setVerticalStretch(0)
|
|
sizePolicy.setHeightForWidth(
|
|
self.screenStack.sizePolicy().hasHeightForWidth())
|
|
self.screenStack.setSizePolicy(sizePolicy)
|
|
font = qtg.QFont()
|
|
font.setPointSize(12)
|
|
self.screenStack.setFont(font)
|
|
|
|
self.dialog = SteamModManager_Dialog()
|
|
|
|
self.screenStack.addWidget(self.dialog)
|
|
|
|
if self.testMode:
|
|
print("TestMode active")
|
|
|
|
self.res = resources()
|
|
|
|
def start(self) -> int:
|
|
self.screenStack.show()
|
|
return self.app.exec_()
|
|
|
|
def closeProgramm(self) -> int:
|
|
return self.app.exit()
|
|
|
|
|
|
#############################################################################################
|
|
if __name__ == "__main__":
|
|
app = qtw.QApplication([])
|
|
|
|
modmanager = SteamModManager()
|
|
modmanager.start()
|