Skip to content

Commit

Permalink
Force loading the UI by default
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Nov 15, 2021
1 parent 58a49bb commit f29e37c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion library/general/src/lib/ui/ui_extension_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ class UIExtensionChecker
# Constructor: Create a UI extension checker for the specified extension.
#
# @param ext_name [String] Short name of the UI extension ("pkg", "graph")
# @param force_ui [Boolean] Enforce creating a UI?
#
def initialize(ext_name)
def initialize(ext_name, force_ui = true)
textdomain "base"
@ext_name = ext_name
@ok = false
ensure_ui_created if force_ui
@ui_plugin_info = UIPluginInfo.new
ensure_ext_installed
end
Expand Down Expand Up @@ -67,6 +69,16 @@ def ensure_ext_installed
@ok
end

# Ensure that the UI is actually created: In CLI mode, that might be
# delayed because normally they should't create a UI at all.
#
def ensure_ui_created
# Just a UI call that doesn't do anything; this is already sufficient to
# load the UI main plug-in completely if it wasn't loaded yet.
# See also bsc#1192650
UI.WidgetExists(:foo)
end

# Check if the UI extension plug-in is installed.
# This also sets @ok.
#
Expand Down

0 comments on commit f29e37c

Please sign in to comment.