19from Source.Util.gui_toolkit import APPLICATION, SHARED_MEMORY, check_app_already_open, run_app, config_window, config_app
28def start_application(b_start_app: bool =
True, test_mode: bool =
False) -> tuple[APPLICATION |
None, MainWindow]:
30 @brief Start application
31 @param b_start_app : [True] start application; [False] only app initialization for pytest
32 @param test_mode : status if application run in test mode
33 @return windows and application object
35 log_config =
LogConfig(I_LOG_LEVEL_DEFAULT)
36 log_config.update_log_level(read_verbosity_settings())
37 log.debug(
"Starting application")
38 log.debug(
"Running from %s", os.getcwd())
40 log.warning(
"Test mode is active")
48 my_app = app(sys.argv)
49 config_app(my_app, icon=ICON_APP)
55 from ctypes
import windll
56 app_id = __title__ +
"." + __version__
57 log.debug(
"Setting explicit app user model id: %s", app_id)
58 windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id)
62 splash = create_splash_screen()
64 f_start_time = time.time()
65 config_window(splash, show=
True, thread=
True)
67 if b_start_app
and (my_app
is not None):
68 config_app(my_app, process_events=
True)
74 window =
MainWindow(qt_exception_hook, log_config, test_mode=test_mode, authenticated=authenticated)
76 config_window(window, icon=ICON_APP)
77 qt_exception_hook.set_main_window_controller(window)
79 f_inti_time = time.time() - f_start_time
80 if f_inti_time < F_MIN_SPLASH_SCREEN_TIME:
81 time.sleep(F_MIN_SPLASH_SCREEN_TIME - f_inti_time)
83 config_window(splash, show=
False, thread=
True)
The view-controller for main window.