Module: Yast::InstallationInstIncAllInclude

Defined in:
../../src/include/installation/inst_inc_all.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) FinishInstallation(ret)



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
# File '../../src/include/installation/inst_inc_all.rb', line 97

def FinishInstallation(ret)
  Builtins.y2milestone("Finishing the installation...")

  if ret == :reboot || ret == :restart_yast || ret == :restart_same_step ||
      ret == :abort
    # TRANSLATORS: busy message
    UI.OpenDialog(Label(_("Writing YaST configuration..."))) # #2
  else
    # FATE #304395: Disabling (or handling) screensaver during installation
    # Enabling screen-saver on exit
    if WFM.Read(path(".local.size"), "/usr/bin/xset") != -1
      Builtins.y2milestone("Enabling Energy Star (DPMS) features")
      # default DPMS values, enable DPMS, enable screen-saver
      WFM.Execute(
        path(".local.bash"),
        "/usr/bin/xset dpms 1200 1800 2400; /usr/bin/xset +dpms; /usr/bin/xset s on; /usr/bin/xset s default;"
      )
    end

    # TRANSLATORS: busy message
    UI.OpenDialog(Label(_("Finishing the installation..."))) # #2
  end

  UI.CloseDialog # #2

  nil
end

- (Object) initialize_installation_inst_inc_all(include_target)



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File '../../src/include/installation/inst_inc_all.rb', line 31

def initialize_installation_inst_inc_all(include_target)
  Yast.import "UI"

  textdomain "installation"

  Yast.import "ProductControl"
  Yast.import "Label"
  Yast.import "Linuxrc"
  Yast.import "Wizard"
  Yast.import "Arch"
  Yast.import "Report"
  Yast.import "Installation"
  Yast.import "Stage"
  Yast.import "Mode"
  Yast.import "Storage"
end

- (Object) retranslateWizardDialog

Re-translate static part of wizard dialog and other predefined messages after language change



214
215
216
217
218
219
220
221
222
223
224
225
226
# File '../../src/include/installation/inst_inc_all.rb', line 214

def retranslateWizardDialog
  Builtins.y2milestone("Retranslating messages")

  # Make sure the labels for default function keys are retranslated, too.
  # Using Label::DefaultFunctionKeyMap() from Label module.
  UI.SetFunctionKeys(Label.DefaultFunctionKeyMap)

  # Activate language changes on static part of wizard dialog
  ProductControl.RetranslateWizardSteps
  Wizard.RetranslateButtons
  Wizard.SetFocusToNextButton
  nil
end

- (Object) SetAutoinstHandling

Sets autoinstallation behavior.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File '../../src/include/installation/inst_inc_all.rb', line 126

def SetAutoinstHandling
  return if !Mode.autoinst

  reportMap = {
    "errors"         => { "timeout" => 0 },
    "warnings"       => { "timeout" => 10 },
    "yesno_messages" => { "timeout" => 10 }
  }
  Report.Import(reportMap)

  Report.DisplayErrors(true, 0)
  Report.DisplayWarnings(true, 10)
  Report.DisplayMessages(true, 10)

  nil
end

- (Object) SetAutoupgHandling

Sets autoupgrade behavior



144
145
146
147
148
149
150
151
152
153
154
# File '../../src/include/installation/inst_inc_all.rb', line 144

def SetAutoupgHandling
  # if profile is defined, first read it, then probe hardware
  autoinstall = SCR.Read(path(".etc.install_inf.AutoYaST"))
  if autoinstall != nil && Ops.is_string?(autoinstall) &&
      Convert.to_string(autoinstall) != ""
    ProductControl.DisableModule("system_analysis")
    ProductControl.DisableModule("update_partition_auto")
  end

  nil
end

- (Object) SetDiskActivationModule



240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File '../../src/include/installation/inst_inc_all.rb', line 240

def SetDiskActivationModule
  # update the workflow according to current situation
  # disable disks activation if not needed
  iscsi = Linuxrc.InstallInf("WithiSCSI") == "1"
  fcoe = Linuxrc.InstallInf("WithFCoE") == "1"
  no_disk = Builtins.isempty(Storage.GetDetectedDiskPaths)

  if !(Arch.s390 || iscsi || fcoe || no_disk)
    Builtins.y2milestone("Disabling disk activation module")
    ProductControl.DisableModule("disks_activate")
  end

  nil
end

- (Object) SetGlobalInstallationFeatures



82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File '../../src/include/installation/inst_inc_all.rb', line 82

def SetGlobalInstallationFeatures
  # FATE #304395: Disabling (or handling) screensaver during installation
  # Disabling screen-saver on startup
  if WFM.Read(path(".local.size"), "/usr/bin/xset") != -1
    Builtins.y2milestone("Disabling Energy Star (DPMS) features")
    # DPMS off values, disable DPMS, disable screen-saver
    WFM.Execute(
      path(".local.bash"),
      "/usr/bin/xset dpms 0 0 0; /usr/bin/xset -dpms; /usr/bin/xset s 0 0; /usr/bin/xset s off"
    )
  end

  nil
end

- (Object) SetInitializingUI



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
# File '../../src/include/installation/inst_inc_all.rb', line 48

def SetInitializingUI
  # dialog content - busy message
  ui_message = _("Initializing the installation environment...")
  # help for the dialog - busy message
  ui_help = _("<p>Initializing the installation...</p>")

  # another texts for second stage
  if Stage.cont
    # dialog content - busy message
    ui_message = _("Preparing the 1st system configuration...")
    # help for the dialog - busy message
    ui_help = _("<p>Please wait...</p>")
  end

  Wizard.SetContents(
    # dialog caption
    _("Initializing..."),
    Label(ui_message),
    ui_help,
    false,
    false
  )
  Wizard.SetTitleIcon("yast-inst-mode")

  nil
end

- (Object) SetNetworkActivationModule



228
229
230
231
232
233
234
235
236
237
238
# File '../../src/include/installation/inst_inc_all.rb', line 228

def SetNetworkActivationModule
  # update the workflow according to current situation
  # disable lan activation if not needed

  if !(Linuxrc.InstallInf("ConfigureNetwork") == "1")
    Builtins.y2milestone("Disabling network activation module")
    ProductControl.DisableModule("lan")
  end

  nil
end

- (Object) SetUIContent



75
76
77
78
79
80
# File '../../src/include/installation/inst_inc_all.rb', line 75

def SetUIContent
  # Wizard::OpenNextBackStepsDialog();
  SetInitializingUI()

  nil
end

- (Object) ShowTextFallbackMessage



156
157
158
159
160
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File '../../src/include/installation/inst_inc_all.rb', line 156

def ShowTextFallbackMessage
  if (Installation.text_fallback || Installation.no_x11) &&
      Installation.x11_setup_needed && Arch.x11_setup_needed &&
      !Installation.shown_text_mode_warning
    x11_msg = ""
    if (Installation.no_x11 || Installation.text_fallback) && Stage.initial
      # Somehow the graphical frontend failed and we're running in
      # text mode. Inform the user about this fact.
      x11_msg = Builtins.sformat(
        _(
          "Your computer does not fulfill all requirements for\n" +
            "a graphical installation. There is either less than %1 MB\n" +
            "memory or the X server could not be started.\n" +
            "\n" +
            "As fallback, the text front-end of YaST2 will guide you\n" +
            "through the installation. This front-end offers the\n" +
            "same functionality as the graphical one, but the screens\n" +
            "differ from those in the manual.\n"
        ),
        "96"
      )
    elsif (Installation.no_x11 || Installation.text_fallback) && Stage.cont
      # The script YaST2 wants to inform about a problem with the
      # option no_x11 but it's broken.
      # else if (Installation::no_x11 ())

      # Somehow the graphical frontend failed and we're running in
      # text mode. Inform the user about this fact.
      x11_msg = _(
        "The graphical interface could not be started.\n" +
          "\n" +
          "Either the required packages were not installed (minimal installation) \n" +
          "or the graphics card is not properly supported.\n" +
          "\n" +
          "As fallback, the text front-end of YaST2 will guide you\n" +
          "through the installation. This front-end offers the\n" +
          "same functionality as the graphical one, but the screens\n" +
          "differ from those in the manual.\n"
      )
    end

    if x11_msg != ""
      Report.Message(x11_msg)
    else
      Builtins.y2error(
        "There should be a more detailed message displayed here,\nbut something went wrong, that's why it is only in the log"
      )
    end

    # show this warning only once
    Installation.shown_text_mode_warning = true
  end

  nil
end