-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.py
51 lines (41 loc) · 1.35 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
46
47
48
49
50
51
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import uuid
import platform
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2 import QtCore
from qframer import FSplashScreen, QSingleApplication
from gui import MainWindow
from gui.uiconfig import windowsoptions
from log import logger
if __name__ == '__main__':
if sys.platform == "linux2":
if platform.architecture()[0] == "32bit":
QApplication.addLibraryPath(
'/usr/lib/%s-linux-gnu/qt5/plugins/' % 'i386')
else:
QApplication.addLibraryPath(
'/usr/lib/%s-linux-gnu/qt5/plugins/' % platform.machine())
applicationName = 'PFramer'
app = QSingleApplication(applicationName, sys.argv)
app.setApplicationVersion("1.0")
app.setOrganizationName("dragondjf.github.io")
app.setApplicationName(applicationName)
if app.isRunning():
sys.exit(0)
if windowsoptions['splashflag']:
splash = FSplashScreen(1, windowsoptions['splashimg'])
mainwindow = MainWindow()
mainwindow.show()
splash.finish(mainwindow)
else:
mainwindow = MainWindow()
mainwindow.show()
app.setActivationWindow(mainwindow)
mainwindow.guimanger.globals = globals()
mainwindow.guimanger.locals = locals()
exitCode = app.exec_()
sys.exit(exitCode)