Class: Yast::InstModeClient

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

Instance Method Summary collapse

Instance Method Details

#InstOptionsDialogContentObject

see bugzilla #156529


161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'src/lib/installation/clients/inst_installation_options.rb', line 161

def InstOptionsDialogContent
  HBox(
    HStretch(),
    VBox(
      if @show_online_repositories
        Left(
          CheckBox(
            Id(:productsources),
            Opt(:notify),
            # check box
            _("&Add Online Repositories Before Installation"),
            Installation.productsources_selected
          )
        )
      else
        Empty()
      end,
      Left(
        CheckBox(
          Id(:add_on),
          Opt(:notify),
          # check box
          _("In&clude Add-on Products from Separate Media"),
          Installation.add_on_selected
        )
      )
    ),
    HStretch()
  )
end

#InstOptionsDialogHelpObject


192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'src/lib/installation/clients/inst_installation_options.rb', line 192

def InstOptionsDialogHelp
  # help text for installation method
  _("<p><big><b>Installation Options</b></big></p>") +
    # help text for installation option
    (if @show_online_repositories
       _("<p>\nTo use suggested remote repositories during installation or update, select\n" \
         "<b>Add Online Repositories Before Installation</b>.</p>")
     else
       ""
     end) +
    # help text for installation method
    _("<p>\nTo install an add-on product from separate media together with &product;, " \
      "select\n<b>Include Add-on Products from Separate Media</b>.</p>\n") +
    # help text: additional help for installation
    _("<p>If you need specific hardware drivers for installation, see " \
      "<i>http://drivers.suse.com</i> site.</p>")
end

#mainObject


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'src/lib/installation/clients/inst_installation_options.rb', line 29

def main
  Yast.import "UI"

  textdomain "installation"

  Yast.import "AddOnProduct"
  Yast.import "Installation"
  Yast.import "InstData"
  Yast.import "Linuxrc"
  Yast.import "Mode"
  Yast.import "PackageCallbacks"
  Yast.import "Popup"
  Yast.import "ProductControl"
  Yast.import "Stage"
  Yast.import "Wizard"
  Yast.import "ProductFeatures"
  Yast.import "PackagesProposal"

  Yast.include self, "packager/storage_include.rb"
  Yast.include self, "installation/misc.rb"

  InstData.start_mode = Mode.mode

  # always check whether user wants to continue
  AddOnProduct.skip_add_ons = false

  # bugzilla #208222
  # Release disk used as the installation source
  ReleaseHDDUsedAsInstallationSource()

  if Mode.autoinst
    Builtins.y2milestone("Autoinst -> returning `auto")
    return :auto
  end

  @show_online_repositories = ProductFeatures.GetBooleanFeature(
    "globals",
    "show_online_repositories"
  )
  # if not visible, internally disabled as well
  Installation.productsources_selected = false if @show_online_repositories != true

  # nothing to display, simply continue
  return :auto unless @show_online_repositories

  Wizard.SetContents(
    # dialog caption
    _("Installation Options"),
    InstOptionsDialogContent(),
    InstOptionsDialogHelp(),
    true,
    true
  )

  Builtins.y2milestone(
    "Umount result: %1, inst mode: %2",
    Linuxrc.InstallInf("umount_result"),
    Linuxrc.InstallInf("InstMode")
  )

  AdjustStepsAccordingToInstallationSettings()

  loop do
    @ret = UI.UserInput
    Builtins.y2milestone("ret: %1", @ret)

    # Use-Add-On-Product status changed
    case @ret
    when :add_on
      if UI.WidgetExists(Id(:add_on))
        Installation.add_on_selected = UI.QueryWidget(Id(:add_on), :Value)
        Builtins.y2milestone("add_on_selected: %1", Installation.add_on_selected)
        AdjustStepsAccordingToInstallationSettings()
      end
    # Use-Community-Repositories status changed
    when :productsources
      if UI.WidgetExists(Id(:productsources))
        Installation.productsources_selected = UI.QueryWidget(Id(:productsources), :Value)
        Builtins.y2milestone(
          "productsources_selected: %1",
          Installation.productsources_selected
        )
        AdjustStepsAccordingToInstallationSettings()
      end
    # Abort button
    when :abort
      return :abort if Popup.ConfirmAbort(Stage.initial ? :painless : :incomplete)
    end
    break if [:back, :next].include?(@ret)
  end

  # <-- Handling User Input in Installation Mode

  case @ret
  when :next
    Builtins.y2milestone(
      "Disabled modules: %1",
      ProductControl.GetDisabledModules
    )
  when :back, :finish
    Builtins.y2milestone("Returning: %1", @ret)
    return @ret
  end

  # bugzilla #293808
  # Check (and setup) the network only when needed
  if Installation.add_on_selected || Installation.productsources_selected
    # Check and setup network
    @inc_ret = Convert.to_symbol(WFM.CallFunction("inst_network_check", []))
    Builtins.y2milestone("inst_network_check ret: %1", @inc_ret)
    return @inc_ret if [:back, :abort].include?(@inc_ret)
  end

  # bug #302384
  Wizard.SetContents(
    _("Initializing"),
    # TRANSLATORS: progress message
    Label(_("Initializing...")),
    "",
    false,
    false
  )

  UpdateWizardSteps()
  @ret = ProductControl.RunFrom(ProductControl.CurrentStep + 1, false)

  @ret = :finish if @ret == :next

  @ret
end