Class: Y2Packager::Dialogs::AddonSelector

Inherits:
UI::InstallationDialog
  • Object
show all
Includes:
Yast::Logger
Defined in:
src/lib/y2packager/dialogs/addon_selector.rb,
src/lib/y2packager/dialogs/addon_selector.rb

Overview

Dialog which shows the user available products on the medium

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(products) ⇒ AddonSelector

Constructor


33
34
35
36
37
38
39
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 33

def initialize(products)
  super()
  textdomain "packager"

  @products = products
  @selected_products = []
end

Instance Attribute Details

#productsArray<Y2Packager::ProductLocation> (readonly)


26
27
28
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 26

def products
  @products
end

#selected_productsArray<Y2Packager::ProductLocation>


28
29
30
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 28

def selected_products
  @selected_products
end

Instance Method Details

#abort_handlerObject

Handler for the :abort action Confirm abort when running in the initial stage (inst-sys)


51
52
53
54
55
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 51

def abort_handler
  return if Yast::Stage.initial && !Yast::Popup.ConfirmAbort(:painless)

  finish_dialog(:abort)
end

#create_dialogObject

overwrite dialog creation to always enable back/next by default


86
87
88
89
90
91
92
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 86

def create_dialog
  res = super
  Yast::Wizard.EnableNextButton
  Yast::Wizard.EnableBackButton

  res
end

#help_textString

Text to display when the help button is pressed


60
61
62
63
64
65
66
67
68
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 60

def help_text
  # TRANSLATORS: help text (1/2)
  _("<p>The selected repository contains several products in independent " \
  "subdirectories. Select which products you want to install.</p>") +
    # TRANSLATORS: help text (2/2)
    _("<p>Note: If there are dependencies between the products you have " \
    "to manually select the dependent products. The product dependencies "\
    "cannot be automatically detected and checked.</p>")
end

#next_handlerObject

Handler for the :next action

This action happens when the user clicks the 'Next' button


44
45
46
47
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 44

def next_handler
  read_user_selection
  finish_dialog(:next)
end

#runObject

Display the the dialog title on the left side at installation (in the first stage) to have the same layout as in the registration addons dialog.


78
79
80
81
82
83
# File 'src/lib/y2packager/dialogs/addon_selector.rb', line 78

def run
  Yast::Wizard.OpenLeftTitleNextBackDialog if Yast::Stage.initial
  super()
ensure
  Yast::Wizard.CloseDialog if Yast::Stage.initial
end