Module: Installation::Widgets::SystemRoleReader

Included in:
SystemRolesRadioButtons
Defined in:
src/lib/installation/system_role_reader.rb,
src/lib/installation/widgets/system_role_reader.rb

Overview

Common methods for system roles widgets

See Also:

  • SystemRole

Instance Method Summary collapse

Instance Method Details

#defaultObject



25
26
27
# File 'src/lib/installation/system_role_reader.rb', line 25

def default
  ::Installation::SystemRole.default? ? ::Installation::SystemRole.ids.first : nil
end

#helpObject



43
44
45
# File 'src/lib/installation/system_role_reader.rb', line 43

def help
  Yast::ProductControl.GetTranslatedText("roles_help") + "\n\n" + roles_help_text
end

#initObject



29
30
31
# File 'src/lib/installation/system_role_reader.rb', line 29

def init
  self.value = ::Installation::SystemRole.current || default
end

#itemsObject



37
38
39
40
41
# File 'src/lib/installation/system_role_reader.rb', line 37

def items
  ::Installation::SystemRole.all.map do |role|
    [role.id, role.label]
  end
end

#labelObject



33
34
35
# File 'src/lib/installation/system_role_reader.rb', line 33

def label
  Yast::ProductControl.GetTranslatedText("roles_caption")
end

#storeObject



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

def store
  log.info "Applying system role '#{value}'"
  role = ::Installation::SystemRole.select(value)

  role.overlay_features
  role.adapt_services
end