Class: Yast::InstDownloadReleaseNotesClient

Inherits:
Client
  • Object
show all
Includes:
Logger
Defined in:
src/lib/installation/clients/inst_download_release_notes.rb

Overview

Client to download and manage release notes button

This client ask for products' release notes and sets UI elements accordingly ("Release Notes" button and dialog).

Instance Method Summary collapse

Instance Method Details

#download_release_notesObject

Download release notes for all selected and installed products

Returns:

  • true when successful



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'src/lib/installation/clients/inst_download_release_notes.rb', line 54

def download_release_notes
  format = UI.TextMode ? :txt : :rtf

  errors = []
  relnotes_map = products.each_with_object({}) do |product, all|
    relnotes = fetch_release_notes(product, Yast::Language.language, format)

    case relnotes
    when :missing
      log.info "No release notes were found for product #{product.short_name}" if relnotes.nil?
    when :error
      errors << product
    else
      all[product.short_name] = relnotes.content
    end
  end

  display_warning(errors) unless errors.empty?
  refresh_ui(relnotes_map)
  InstData.release_notes = relnotes_map
  !relnotes_map.empty?
end

#init_uiObject

Set the UI content to show some progress. FIXME: use a better title (reused existing texts because of text freeze)



79
80
81
82
# File 'src/lib/installation/clients/inst_download_release_notes.rb', line 79

def init_ui
  Wizard.SetContents(_("Initializing"), Label(_("Initializing the installation...")),
    "", false, false)
end

#mainObject



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'src/lib/installation/clients/inst_download_release_notes.rb', line 84

def main
  textdomain "installation"

  # Packages.Init is not called during upgrade
  return :auto if !Packages.init_called && !Stage.initial && !Mode.update

  return :back if GetInstArgs.going_back

  # skip download during AutoYaST
  if Mode.auto
    log.info "Skipping release notes during AutoYaST-driven installation or upgrade"
    return :auto
  end

  init_ui

  download_release_notes
  :auto
end