Class: Y2Packager::Widgets::ProductLicenseContent

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

Overview

Widget to show a product's license content

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product, language) ⇒ ProductLicenseContent

Returns a new instance of ProductLicenseContent

Parameters:

  • product (Y2Packager::Product)

    Product

  • language (String)

    Default language (en_US, es_ES, etc.).


29
30
31
32
33
# File 'src/lib/y2packager/widgets/product_license_content.rb', line 29

def initialize(product, language)
  textdomain "packager"
  @product = product
  @language = language
end

Instance Attribute Details

#languageString

Returns Language code (en_US, es_ES, etc.).

Returns:

  • (String)

    Language code (en_US, es_ES, etc.).


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

def language
  @language
end

#productY2Packager::Product (readonly)

Returns Product

Returns:


23
24
25
# File 'src/lib/y2packager/widgets/product_license_content.rb', line 23

def product
  @product
end

Instance Method Details

#contentsYast::Term

Return the UI for the widget

Returns:

  • (Yast::Term)

    widget's UI


45
46
47
# File 'src/lib/y2packager/widgets/product_license_content.rb', line 45

def contents
  @contents ||= MinWidth(80, license_content)
end

#helpObject

Help text for license content


59
60
61
# File 'src/lib/y2packager/widgets/product_license_content.rb', line 59

def help
  Yast::ProductLicense.GetLicenseDialogHelp
end

#initObject

Implement #init content

See Also:

  • CWM::AbstractWidget#init

38
39
40
# File 'src/lib/y2packager/widgets/product_license_content.rb', line 38

def init
  update_license_text
end

#translate(new_language) ⇒ Object

Translate license content

Parameters:

  • new_language (String)

    New language code


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

def translate(new_language)
  return if language == new_language
  self.language = new_language
  update_license_text
end