Class: Installation::Widgets::LSMSelector

Inherits:
CWM::ComboBox
  • Object
show all
Defined in:
src/lib/installation/widgets/lsm.rb

Overview

This class is a ComboBox for selecting the desired Linux Security Module to be used after the instalaltion

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ LSMSelector

Constructor

Parameters:

  • settings (Y2Security::LSM::Config)


103
104
105
106
107
108
# File 'src/lib/installation/widgets/lsm.rb', line 103

def initialize(settings)
  super()
  textdomain "installation"

  @settings = settings
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings.



98
99
100
# File 'src/lib/installation/widgets/lsm.rb', line 98

def settings
  @settings
end

Instance Method Details

#helpObject



132
133
134
135
136
137
138
# File 'src/lib/installation/widgets/lsm.rb', line 132

def help
  Yast::HTML.Para(
    # TRANSLATORS: Linux Security Module Selector help.
    _("Allows to choose between available major Linux Security Modules like:") +
    Yast::HTML.List(available_modules.map(&:label))
  )
end

#initObject



110
111
112
113
# File 'src/lib/installation/widgets/lsm.rb', line 110

def init
  self.value = settings.selected&.id.to_s
  disable if items.size <= 1
end

#itemsObject



124
125
126
# File 'src/lib/installation/widgets/lsm.rb', line 124

def items
  available_modules.map { |m| [m.id.to_s, m.label] }
end

#labelObject



119
120
121
122
# File 'src/lib/installation/widgets/lsm.rb', line 119

def label
  # TRANSLATORS: Linux Security Module Selector label.
  _("Selected Module")
end

#optObject



115
116
117
# File 'src/lib/installation/widgets/lsm.rb', line 115

def opt
  [:notify, :hstretch]
end

#storeObject



128
129
130
# File 'src/lib/installation/widgets/lsm.rb', line 128

def store
  settings.select(value)
end