Class: Y2Packager::Clients::InstProductUpgradeLicense

Inherits:
InstProductLicense show all
Defined in:
src/lib/y2packager/clients/inst_product_upgrade_license.rb

Overview

This client shows a license confirmation dialog for the upgraded base product

The client will display an error and return :back if not product is found. It returns true if no license is found or if the license was already accepted for the selected product. The license is not displayed when going back in the workflow.

See Also:

Instance Method Summary collapse

Instance Method Details

#mainObject


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'src/lib/y2packager/clients/inst_product_upgrade_license.rb', line 33

def main
  textdomain "packager"

  # do not display the license when going back, skip the dialog
  return :back if Yast::GetInstArgs.going_back

  if !product
    # TRANSLATORS: An error message, the package solver could not find
    # any product to upgrade in the selected partition.
    Yast::Report.Error(_("Error: Cannot find any product to upgrade.\n" \
      "Make sure the selected partition contains an upgradable product."))
    return :back
  end

  return :auto if !available_license? || license_confirmed?

  log.info "Displaying license for product: #{product.inspect}"

  Y2Packager::Dialogs::InstProductLicense.new(product).run
end