Class: Installation::Widgets::SystemRolesRadioButtons

Inherits:
CWM::RadioButtons
  • Object
show all
Includes:
SystemRoleReader
Defined in:
src/lib/installation/widgets/system_roles_radio_buttons.rb

Instance Method Summary collapse

Methods included from SystemRoleReader

#default, #help, #init, #items, #label

Constructor Details

#initializeSystemRolesRadioButtons

Returns a new instance of SystemRolesRadioButtons.



40
41
42
43
44
45
46
47
# File 'src/lib/installation/widgets/system_roles_radio_buttons.rb', line 40

def initialize
  super
  # We need to handle all the events because otherwise the current
  # selection is lost when the widget is redrawn.
  # FIXME: It will not be needed once RadioButtons widget take care of it
  self.handle_all_events = true
  textdomain "installation"
end

Instance Method Details

#handleObject



75
76
77
78
79
# File 'src/lib/installation/widgets/system_roles_radio_buttons.rb', line 75

def handle
  ::Installation::SystemRole.select(value)

  nil
end

#storeObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'src/lib/installation/widgets/system_roles_radio_buttons.rb', line 49

def store
  # set flag to show custom patterns only if custom role selected
  CustomPatterns.show = value == "custom"
  store_orig

  # keep the selected products
  Yast::Packages.Reset([:product])
  if value == "custom"
    # for custom role do not use any desktop
    Yast::DefaultDesktop.SetDesktop(nil)
    # But select patterns which have been defined e.g. in the
    # software/default_patterns section in the control.xml file.
    # (This can be done in the general default_patterns section or in
    # the role specific default_patterns section.)
    # Another possibility to set it are the default pattern settings
    # in each product description defined by the "defaultpattern()"
    # "Provides" dependency (FATE#320199).
    Yast::Packages.SelectSystemPatterns(false)
    Yast::Pkg.PkgSolve(false)
  else
    # force reset of Default Desktop, because it is cached and when going
    # forward and backward, it can be changed
    Yast::DefaultDesktop.ForceReinit
  end
end

#store_origObject



38
# File 'src/lib/installation/widgets/system_roles_radio_buttons.rb', line 38

alias_method :store_orig, :store

#validateObject



81
82
83
84
85
86
87
88
# File 'src/lib/installation/widgets/system_roles_radio_buttons.rb', line 81

def validate
  return true if value

  # TRANSLATORS: Popup error requesting to choose some option.
  Yast::Popup.Error(_("You must choose some option before you continue."))

  false
end

#vspacingObject



90
91
92
# File 'src/lib/installation/widgets/system_roles_radio_buttons.rb', line 90

def vspacing
  1
end