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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
# File 'src/lib/installation/clients/inst_congratulate.rb', line 30
def main
Yast.import "Pkg"
Yast.import "UI"
textdomain "installation"
Yast.import "Mode"
Yast.import "Wizard"
Yast.import "Popup"
Yast.import "Label"
Yast.import "ProductFeatures"
Yast.import "GetInstArgs"
Yast.import "Call"
Yast.import "Package"
Yast.import "ProductControl"
Yast.import "Stage"
Yast.import "AddOnProduct"
Yast.import "Service"
@argmap = GetInstArgs.argmap
@show_clone_checkbox = !(Stage.firstboot || Mode.live_installation)
@clone_checkbox_active = ProductFeatures.GetBooleanFeature(
"globals",
"enable_clone"
)
@clone_enabled = Package.Installed("autoyast2")
@zmd_service_name = "novell-zmd"
@zmd_package_name = "zmd"
@check_box_turnoff_zmd = Empty()
@turnoff_zmd_help = ""
@show_zmd_turnoff_checkbox = Ops.get_string(
@argmap,
"show_zmd_turnoff_checkbox",
"no"
) == "yes"
@turnoff_zmd_default_state = Ops.get_string(
@argmap,
"zmd_turnoff_default_state",
"no"
) == "yes"
@zmd_installed = Package.Installed(@zmd_package_name)
@zmd_enabled_or_running = @zmd_installed &&
(Service.Enabled(@zmd_service_name) ||
Service.Status(@zmd_service_name) == 0)
Builtins.y2milestone(
"ZMD Installed: %1, Enabled/Running: %2",
@zmd_installed,
@zmd_enabled_or_running
)
Builtins.y2milestone(
"Show TurnOffZMD checkbox: %1, default state: %2",
@show_zmd_turnoff_checkbox,
@turnoff_zmd_default_state
)
if @show_zmd_turnoff_checkbox && @zmd_installed && @zmd_enabled_or_running
@check_box_turnoff_zmd = CheckBox(
Id(:turnoff_zmd),
_("&Disable ZMD Service"),
@turnoff_zmd_default_state
)
@turnoff_zmd_help = _(
"<p>Select <b>Disable ZMD Service</b> to stop and disable\n" \
"the ZMD service during system start.</p>\n"
)
else
Builtins.y2milestone("ZMD Turnoff check-box will be invisible")
end
@display = UI.GetDisplayInfo
@space = Ops.get_boolean(@display, "TextMode", true) ? 1 : 3
@vendor_url_tmp = ProductFeatures.GetStringFeature(
"globals",
"vendor_url"
)
@vendor_url = "http://www.suse.com/"
@vendor_url = "http://www.openSUSE.org" if ProductFeatures.GetStringFeature("globals",
"ui_mode") == "simple"
Builtins.y2milestone(
"UI mode: %1",
ProductFeatures.GetStringFeature("globals", "ui_mode")
)
@vendor_url = @vendor_url_tmp if !@vendor_url_tmp.nil? && @vendor_url_tmp != ""
@check_box_do_clone = Empty()
if @show_clone_checkbox
@check_box_do_clone = CheckBox(
Id(:do_clone),
_("&Clone This System for AutoYaST"),
@clone_checkbox_active
)
end
@caption = _("Installation Completed")
@text = ProductControl.GetTranslatedText("congratulate")
@text = if @text == ""
Ops.add(
Ops.add(
_("<p><b>Congratulations!</b></p>") +
_(
"<p>The installation of &product; on your machine is complete.\n" \
"After clicking <b>Finish</b>, you can log in to the system.</p>\n"
),
Builtins.sformat(_("<p>Visit us at %1.</p>"), @vendor_url)
),
_("<p>Have a lot of fun!<br>Your SUSE Development Team</p>")
)
else
Builtins.sformat(@text, @vendor_url)
end
@contents = VBox(
VSpacing(@space),
HBox(
HSpacing(Ops.multiply(2, @space)),
VBox(
RichText(Id(:text), @text),
VSpacing(Ops.divide(@space, 2)),
Left(@check_box_turnoff_zmd),
Left(@check_box_do_clone)
),
HSpacing(Ops.multiply(2, @space))
),
VSpacing(@space),
VSpacing(2)
)
@help_file = ""
@help = _("<p>Your system is ready for use.</p>") +
_(
"<p><b>Finish</b> will close the YaST installation and take you\n" \
"to the login screen.</p>\n"
) +
(if DisplayKDEHelp()
_(
"<p>If you choose the default graphical desktop KDE, you can\n" \
"adjust some KDE settings to your hardware. Also notice\n" \
"our SUSE Welcome Dialog.</p>\n"
)
else
""
end)
if @show_clone_checkbox
@help = Ops.add(
@help,
_(
"<p>Use <b>Clone</b> if you want to create an AutoYaST profile.\n" \
"AutoYaST is a way to do a complete SUSE Linux installation without user " \
"interaction. AutoYaST\n" \
"needs a profile to know what the installed system should look like. " \
"If this option is\n" \
"selected, a profile of the current system is stored in " \
"<tt>/root/autoinst.xml</tt>.</p>"
)
)
end
@help = Ops.add(@help, @turnoff_zmd_help) if @show_zmd_turnoff_checkbox
Wizard.SetContents(
@caption,
@contents,
@help,
GetInstArgs.enable_back,
GetInstArgs.enable_next
)
Wizard.SetNextButton(:next, Label.FinishButton)
Wizard.RestoreAbortButton
Wizard.HideAbortButton if Stage.firstboot
Wizard.SetFocusToNextButton
UI.ChangeWidget(Id(:do_clone), :Enabled, @clone_enabled) if UI.WidgetExists(Id(:do_clone))
@ret = nil
loop do
@ret = Wizard.UserInput
case @ret
when :abort
break if Popup.ConfirmAbort(:incomplete)
when :help
Wizard.ShowHelp(@help)
end
break if [:next, :back].include?(@ret)
end
case @ret
when :back
Wizard.RestoreNextButton
when :next
@zmd = UI.WidgetExists(Id(:turnoff_zmd)) &&
Convert.to_boolean(UI.QueryWidget(Id(:turnoff_zmd), :Value))
@clone = UI.WidgetExists(Id(:do_clone)) &&
Convert.to_boolean(UI.QueryWidget(Id(:do_clone), :Value))
Wizard.SetContents(
@caption,
Label(_("Finishing the installation...")),
@help,
GetInstArgs.enable_back,
GetInstArgs.enable_next
)
StopAndDisableZMD() if @zmd
CallCloning() if @clone
end
Pkg.SourceSaveAll
Pkg.TargetFinish
deep_copy(@ret)
end
|