Class: Yast::UIExtensionChecker

Inherits:
Object
  • Object
show all
Includes:
I18n, Logger
Defined in:
library/general/src/lib/ui/ui_extension_checker.rb

Overview

Class to check if a UI extension plug-in ("pkg", "graph") is installed. If it's not installed, ask the user if the package containing it should be installed and (if the user answers "yes") install it.

Instance Method Summary collapse

Constructor Details

#initialize(ext_name, force_ui = true) ⇒ UIExtensionChecker

Constructor: Create a UI extension checker for the specified extension.

Parameters:

  • ext_name (String)

    Short name of the UI extension ("pkg", "graph")

  • force_ui (Boolean) (defaults to: true)

    Enforce creating a UI?



35
36
37
38
39
40
41
42
# File 'library/general/src/lib/ui/ui_extension_checker.rb', line 35

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

Instance Method Details

#ok?Boolean

Check if the UI extension was either installed to begin with or if the user (after being asked) confirmed to install it, and it was installed successfully.

Returns:

  • (Boolean)

    UI extension is available now



50
51
52
# File 'library/general/src/lib/ui/ui_extension_checker.rb', line 50

def ok?
  @ok
end