-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.py
59 lines (48 loc) · 2.64 KB
/
controller.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
59
from PyQt6.QtWidgets import QApplication
import sys
import logging
from component.screen import StartScreen,TestScreen,UserInformationScreen,EndScreen,SettingScreen
class Navigator:
def __init__(self,screen_height:int =1200,screen_width:int = 800):
self.app = QApplication(sys.argv)
self.screen_height = screen_height
self.screen_width = screen_width
self.start_screen = StartScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
self.setting_screen = SettingScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
self.user_info_screen = UserInformationScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
self.end_screen = EndScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width,result=None)
self.test_screen = TestScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
def start(self):
self.start_screen.show()
sys.exit(self.app.exec())
def navigate_to_setting_screen(self):
logging.info(" Open the settings screen")
self.close_all()
self.setting_screen = SettingScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
self.setting_screen.show()
def navigate_to_start_screen(self):
self.close_all()
self.start_screen = StartScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
self.start_screen.show()
def navigate_to_user_info_screen(self):
logging.info("Open the user information screen")
self.close_all()
self.user_info_screen= UserInformationScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
self.user_info_screen.show()
def navigate_to_end_screen(self):
logging.info("Open the user end screen")
self.close_all()
self.end_screen= EndScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width,result=None)
self.end_screen.show()
def navigate_to_test_screen(self):
logging.info("Open the test screen")
self.close_all()
self.test_screen = TestScreen(navigator=self,screen_height=self.screen_height,screen_width=self.screen_width)
self.test_screen.show()
def close_all(self):
logging.info("close all")
self.test_screen.close()
self.end_screen.close()
self.user_info_screen.close()
self.start_screen.close()
self.setting_screen.close()