forked from CNR-Engineering/PyTelTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_interface.py
More file actions
49 lines (39 loc) · 1.23 KB
/
Copy pathmain_interface.py
File metadata and controls
49 lines (39 loc) · 1.23 KB
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
from PyQt5.QtWidgets import *
import sys
from gui.MainWindow import MyMainWindow as GUIWindow
from workflow.interface import ProjectWelcome
class HelloWorld(QDialog):
def __init__(self):
super().__init__()
self.choice = None
left_button = QPushButton('Classic\nInterface')
right_button = QPushButton('Workflow\nInterface')
for bt in [left_button, right_button]:
bt.setFixedSize(150, 200)
left_button.clicked.connect(self.choose_left)
right_button.clicked.connect(self.choose_right)
vlayout = QHBoxLayout()
vlayout.addWidget(left_button)
vlayout.addWidget(right_button)
self.setLayout(vlayout)
self.setWindowTitle('PyTelTools')
def choose_left(self):
self.choice = 1
self.accept()
def choose_right(self):
self.choice = 2
self.accept()
if __name__ == '__main__':
app = QApplication(sys.argv)
dlg = HelloWorld()
value = dlg.exec_()
if value == QDialog.Accepted:
if dlg.choice == 1:
widget = GUIWindow()
widget.showMaximized()
else:
widget = ProjectWelcome()
widget.show()
else:
sys.exit(0)
app.exec_()