oxiDE/config/oxiver.qt.py

45 lines
1.4 KiB
Python

class splashWindow(QMainWindow):
def __init__(self,applet,*args,**kwargs):
super().__init__(*args,**kwargs)
with oxiAppletLock:
self.applet = applet
oxiApplets.append(self.applet)
self.applet.windows = [self]
self.cTitle = "About " +oxiDistro
self.setWindowTitle(self.cTitle)
self.cWidth = 414
self.cHeight = 304
self.resize(self.cWidth,self.cHeight)
self.cCreateElements()
def cCreateElements(self):
self.cImageLabel = QLabel(self)
self.cImageLabel.setPixmap(QPixmap(oxiGetConfig("splash.bmp")))
self.cImageLabel.move(0,0)
self.cImageLabel.resize(414,78)
self.cText = QLabel(self)
applets = 0
with oxiAppletLock: applets = len(oxiApplets)
self.cText.setText(oxiDistro + "\n" + "Version 0.0 (Build 0000)" + "\nLicensed under MIT, Copyright (C) 2022\n\n\noxi-applets running: " +str(applets)+ "\nOS: " +platform.system()+ " " +platform.release()+ "\nQt: " +str(QtCore.qVersion()))
self.cText.move(105,78 + 15)
self.cText.resize(414 - 105,304 - (78 + 15) - 31 - 15)
self.cText.setAlignment(QtCore.Qt.AlignLeft)
self.cQuitButton = QPushButton("OK",self)
self.cQuitButton.clicked.connect(self.close)
self.cQuitButton.move(414 - 83,304 - 31)
self.cQuitButton.resize(75,23)
self.show()
def closeEvent(self,event):
with oxiAppletLock:
oxiApplets.remove(self.applet)
applet = oxiApplet()
splashWindow(applet)