Skip to content

Commit

Permalink
Make possible to start TUI with installed WebUI
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkankovsky committed Nov 1, 2023
1 parent a70ac7c commit 378aad5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
36 changes: 12 additions & 24 deletions pyanaconda/anaconda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 0 additions & 2 deletions pyanaconda/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 378aad5

Please sign in to comment.