Class: Installation::Dialogs::ComplexWelcome

Inherits:
CWM::Dialog
  • Object
show all
Defined in:
src/lib/installation/dialogs/complex_welcome.rb

Overview

This class implements a welcome dialog for the installer

The dialog contains:

  • A language/keyboard selector
  • If only 1 product is available, it shows the product's license.
  • If more than 1 product is available, it shows the product selector.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(products, disable_buttons: []) ⇒ ComplexWelcome

Constructor

Parameters:

  • products (Array<Y2Packager::Product>)

    List of available products

  • disable_buttons (Array<Symbol>) (defaults to: [])

    List of buttons to disable



47
48
49
50
51
52
53
54
# File 'src/lib/installation/dialogs/complex_welcome.rb', line 47

def initialize(products, disable_buttons: [])
  super()
  textdomain "installation"

  @products = products
  @disable_buttons = disable_buttons.map { |b| "#{b}_button" }
  @language_selection = Y2Country::Widgets::LanguageSelection.new(emit_event: true)
end

Instance Attribute Details

#disable_buttonsArray<Symbol> (readonly)

Returns list of buttons to disable (:next, :abort, :back).

Returns:

  • (Array<Symbol>)

    list of buttons to disable (:next, :abort, :back)



41
42
43
# File 'src/lib/installation/dialogs/complex_welcome.rb', line 41

def disable_buttons
  @disable_buttons
end

#productsArray<Y2Packager::Product> (readonly)

Returns List of available products.

Returns:

  • (Array<Y2Packager::Product>)

    List of available products



38
39
40
# File 'src/lib/installation/dialogs/complex_welcome.rb', line 38

def products
  @products
end

Instance Method Details

#contentsYast::Term

Dialog content

Returns:

  • (Yast::Term)

    Dialog's content



75
76
77
78
79
80
81
82
83
# File 'src/lib/installation/dialogs/complex_welcome.rb', line 75

def contents
  VBox(
    filling,
    console_button,
    locale_settings,
    license_or_product_content,
    filling
  )
end

#runObject



89
90
91
92
93
94
95
96
97
98
99
100
# File 'src/lib/installation/dialogs/complex_welcome.rb', line 89

def run
  res = nil

  loop do
    res = super
    Yast::Wizard.RetranslateButtons
    Yast::ProductControl.RetranslateWizardSteps
    break if res != :redraw
  end

  res
end

#skip_store_forObject



85
86
87
# File 'src/lib/installation/dialogs/complex_welcome.rb', line 85

def skip_store_for
  [:redraw]
end

#titleString

Returns the dialog title

The title can vary depending if the license agreement or the product selection is shown.

Returns:

  • (String)

    Dialog's title



62
63
64
65
66
67
68
69
70
# File 'src/lib/installation/dialogs/complex_welcome.rb', line 62

def title
  if products.size > 1
    _("Language, Keyboard and Product Selection")
  elsif show_license?
    _("Language, Keyboard and License Agreement")
  else
    _("Language and Keyboard Selection")
  end
end