def __init__(self, main_window_builder, main_window): self.main_window: CozyUI = main_window self.main_window_builder = main_window_builder inject.configure_once(self.configure_inject) reporter.info("main", "startup") self.whats_new_window: WhatsNewWindow = WhatsNewWindow() self.library_view: LibraryView = LibraryView(main_window_builder) self.search_view: SearchView = SearchView() self.book_detail_view: BookDetailView = BookDetailView( main_window_builder) self.headerbar: Headerbar = Headerbar(main_window_builder) self.library_view_model = inject.instance(LibraryViewModel) self.search_view_model = inject.instance(SearchViewModel) self.book_detail_view_model = inject.instance(BookDetailViewModel) self.playback_control_view_model = inject.instance( PlaybackControlViewModel) self.sleep_timer_view_model = inject.instance(SleepTimerViewModel) self.player = inject.instance(Player) self._connect_popovers() self.search_view_model.add_listener(self._on_open_view) self.book_detail_view_model.add_listener(self._on_open_view) self.library_view_model.add_listener(self._on_open_view) self.library_view_model.add_listener(self._on_library_view_event) self.playback_control_view_model.add_listener(self._on_open_view) self.main_window.add_listener(self._on_main_window_event)
def __init__(self, main_window_builder, main_window): self.main_window: CozyUI = main_window self.main_window_builder = main_window_builder inject.configure_once(self.configure_inject) reporter.info("main", "startup") self.whats_new_window: WhatsNewWindow = WhatsNewWindow() self.library_view: LibraryView = LibraryView(main_window_builder) self.search_view: SearchView = SearchView(main_window_builder) self.book_detail_view: BookDetailView = BookDetailView( main_window_builder) self.library_view_model = inject.instance(LibraryViewModel) self.search_view_model = inject.instance(SearchViewModel) self.book_detail_view_model = inject.instance(BookDetailViewModel) self.search_view_model.add_listener(self._on_open_view) self.book_detail_view_model.add_listener(self._on_open_view) self.library_view_model.add_listener(self._on_open_view) self.library_view_model.add_listener(self._on_library_view_event) self.main_window.add_listener(self._on_main_window_event)
def startup(self): self.__init_resources() self.__init_css() self.__init_actions() report.info("main", "startup") self.__init_window()