-
Notifications
You must be signed in to change notification settings - Fork 1
/
pygobstones.py
58 lines (46 loc) · 1.58 KB
/
pygobstones.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
52
53
54
55
56
57
58
#!/usr/bin/python
import sys
import os
sys.path.append('..')
sys.path.append('lib_gb.')
import platform
from commons.utils import root_path
from PyQt4 import QtGui, QtCore
from gui.mainWindow import *
from time import time, sleep
from PyQt4.QtGui import QApplication, QSplashScreen, QPixmap
from PyQt4.QtCore import QSize
from PyQt4.QtSvg import QSvgWidget
def main():
app = QtGui.QApplication(sys.argv)
# Get the locale settings
locale = unicode(QtCore.QLocale.system().name())
# This is to make Qt use locale configuration; i.e. Standard Buttons
# in your system's language.
qtTranslator = QtCore.QTranslator()
qtTranslator.load("qt_" + locale,
QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath))
app.installTranslator(qtTranslator)
path = os.path.join(root_path(), 'commons')
f = QtGui.QFontDatabase.addApplicationFont(os.path.join(path,'ubuntu.ttf'))
font = QtGui.QFont('Ubuntu Titling')
font.setBold(True)
font.setPixelSize(16)
app.setFont(font)
start = time()
if 'huayra' in platform.uname():
img = QPixmap(os.path.join(path, 'gobstones_huayra.png'))
else:
img = QPixmap(os.path.join(path, 'gobstones.png'))
splash = QSplashScreen(img)
splash.show()
while time() - start < 1:
app.processEvents()
w = MainWindow()
icon = QtGui.QIcon(os.path.join(path, 'logo.png'))
w.setWindowIcon(icon)
splash.finish(w)
w.showMaximized()
sys.exit(app.exec_())
if __name__ == '__main__':
main()