Class: Y2Packager::Widgets::ProductLicense

Inherits:
CWM::CustomWidget
  • Object
show all
Defined in:
src/lib/y2packager/widgets/product_license.rb,
src/lib/y2packager/widgets/product_license.rb

Overview

Widget to show a product's license

This widget relies on Y2Packager::Widgets::ProductLicenseConfirmation to show the license confirmation checkbox.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product, language: nil, skip_validation: false) ⇒ ProductLicense

Constructor


32
33
34
35
36
37
# File 'src/lib/y2packager/widgets/product_license.rb', line 32

def initialize(product, language: nil, skip_validation: false)
  textdomain "packager"
  @product = product
  @language = language || Yast::Language.language
  @skip_validation = skip_validation
end

Instance Attribute Details

#productY2Packager::Product (readonly)


25
26
27
# File 'src/lib/y2packager/widgets/product_license.rb', line 25

def product
  @product
end

#skip_validationBoolean (readonly)


27
28
29
# File 'src/lib/y2packager/widgets/product_license.rb', line 27

def skip_validation
  @skip_validation
end

Instance Method Details

#contentsObject

Widget content

See Also:

  • CWM::CustomWidget#contents

50
51
52
53
54
55
56
# File 'src/lib/y2packager/widgets/product_license.rb', line 50

def contents
  VBox(
    Left(Label(_("License Agreement"))),
    license_content,
    confirmation_checkbox
  )
end

#labelString

Widget label

See Also:

  • CWM::AbstractWidget#label

43
44
45
# File 'src/lib/y2packager/widgets/product_license.rb', line 43

def label
  _("License Agreement")
end

#translate(new_language) ⇒ Object

Translate the license content to the given language


68
69
70
71
# File 'src/lib/y2packager/widgets/product_license.rb', line 68

def translate(new_language)
  self.language = new_language
  product_license_content.translate(language)
end