-
Notifications
You must be signed in to change notification settings - Fork 13
/
launch.pyw
60 lines (49 loc) · 1.74 KB
/
launch.pyw
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
59
60
#! /usr/bin/python3
from UI import launch_dialog
import sys
import ctypes
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QDialog, QApplication
myappid = 'VodBox.pyWinContext.1.0'
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
if not hasattr(sys, "_MEIPASS"):
sys._MEIPASS = "."
class LaunchDialog(QDialog, launch_dialog.Ui_Dialog):
def __init__(self):
super(self.__class__, self).__init__()
self.setupUi(self)
import wincontext
self.win = wincontext.WinContextApp(False)
self.initUI()
def initUI(self):
app_icon = QtGui.QIcon()
app_icon.addFile(
sys._MEIPASS + '/' + 'images/icon_16.png', QtCore.QSize(16, 16))
app_icon.addFile(
sys._MEIPASS + '/' + 'images/icon_24.png', QtCore.QSize(24, 24))
app_icon.addFile(
sys._MEIPASS + '/' + 'images/icon_32.png', QtCore.QSize(32, 32))
app_icon.addFile(
sys._MEIPASS + '/' + 'images/icon_48.png', QtCore.QSize(48, 48))
app_icon.addFile(
sys._MEIPASS + '/' + 'images/icon.png', QtCore.QSize(256, 256))
self.setWindowIcon(app_icon)
self.setWindowFlags(
QtCore.Qt.Dialog | QtCore.Qt.CustomizeWindowHint
| QtCore.Qt.WindowTitleHint)
self.pushButton.clicked.connect(self.launch)
def launch(self):
if self.radioButton.isChecked():
self.hide()
self.win.show()
else:
self.hide()
self.win.show()
self.win.direct = True
def main():
app = QApplication(sys.argv)
ui = LaunchDialog()
ui.show()
app.exec_()
if __name__ == '__main__':
main()