From 378aad5d39848c11a6d81467ca3fef5d8add7a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Ka=C5=88kovsk=C3=BD?= Date: Wed, 1 Nov 2023 18:03:15 +0100 Subject: [PATCH] Make possible to start TUI with installed WebUI --- pyanaconda/anaconda.py | 36 ++++++++++++------------------------ pyanaconda/core/constants.py | 2 -- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py index 5da8656430c..17f08c83a4e 100644 --- a/pyanaconda/anaconda.py +++ b/pyanaconda/anaconda.py @@ -147,15 +147,6 @@ def tui_mode(self): """Report if Anaconda should run with the TUI.""" return self._display_mode == DisplayModes.TUI - @property - def webui_mode(self): - """Report if Anaconda should run with WebUI.""" - # this boot option is meant to be temporary, so just check it directly - # from kernel boot command line like this - return self.display_mode == DisplayModes.WEBUI \ - or "webui" in kernel_arguments \ - or os.path.exists("/usr/share/cockpit/anaconda-webui") - def log_display_mode(self): if not self.display_mode: log.error("Display mode is not set!") @@ -208,25 +199,22 @@ def intf(self): def initInterface(self): if self._intf: raise RuntimeError("Second attempt to initialize the InstallInterface") - - if self.webui_mode: - from pyanaconda.ui.webui import CockpitUserInterface - self._intf = CockpitUserInterface( - None, - self.payload, - "webui.remote" in kernel_arguments - ) - - # needs to be refreshed now we know if gui or tui will take place - # FIXME - what about Cockpit based addons ? - addon_paths = [] elif self.gui_mode: from pyanaconda.ui.gui import GraphicalUserInterface # Run the GUI in non-fullscreen mode, so live installs can still # use the window manager - self._intf = GraphicalUserInterface(None, self.payload, - gui_lock=self.gui_initialized, - fullscreen=False) + # Check anaconda-webui package to run correct installer + if os.path.exists("/usr/share/cockpit/anaconda-webui"): + from pyanaconda.ui.webui import CockpitUserInterface + self._intf = CockpitUserInterface( + None, + self.payload, + "webui.remote" in kernel_arguments + ) + else: + self._intf = GraphicalUserInterface(None, self.payload, + gui_lock=self.gui_initialized, + fullscreen=False) # needs to be refreshed now we know if gui or tui will take place addon_paths = collect_addon_ui_paths(ADDON_PATHS, "gui") diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py index b9861ea4f9b..40e9adf171b 100644 --- a/pyanaconda/core/constants.py +++ b/pyanaconda/core/constants.py @@ -303,13 +303,11 @@ class SecretStatus(Enum): class DisplayModes(Enum): GUI = "GUI" TUI = "TUI" - WEBUI = "WEBUI" DISPLAY_MODE_NAME = { DisplayModes.GUI: "graphical mode", DisplayModes.TUI: "text mode", - DisplayModes.WEBUI: "webui mode" } INTERACTIVE_MODE_NAME = {