forked from mgrady3/pLEASE-legacy
/
main.py
45 lines (36 loc) · 1.01 KB
/
main.py
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
import gui
import os
import sys
import time
import qdarkstyle
from PyQt4 import QtGui, QtCore
def main():
"""
:return:
"""
app = QtGui.QApplication(sys.argv)
# SplashScreen
source_path = os.path.dirname(gui.__file__)
# print(source_path)
graphics_path = os.path.join(source_path, 'icons')
# print(graphics_path)
splash_picture = QtGui.QPixmap(os.path.join(graphics_path, 'pLEASE.png'))
# print(os.path.join(graphics_path, 'pLEASE.png'))
splash = QtGui.QSplashScreen(splash_picture, QtCore.Qt.WindowStaysOnTopHint)
splash.setMask(splash_picture.mask())
splash.show()
time.sleep(3.5)
# Start UI
view = gui.Viewer()
splash.finish(view)
max_ht = view.max_height
max_wd = view.max_width
# Small screens
if max_ht <= 800 and max_wd <= 1280:
view.showMaximized()
view.raise_()
if view.Style:
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
sys.exit(app.exec_())
if __name__ == '__main__':
main()