12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
|
# File 'src/clients/add-on_proposal.rb', line 12
def main
Yast.import "UI"
Yast.import "Pkg"
textdomain "add-on"
Yast.import "Label"
Yast.import "Wizard"
Yast.import "AddOnProduct"
Yast.import "WorkflowManager"
Yast.include self, "add-on/add-on-workflow.rb"
@func = Convert.to_string(WFM.Args(0))
@param = Convert.to_map(WFM.Args(1))
@ret = {}
if @func == "MakeProposal"
@force_reset = Ops.get_boolean(@param, "force_reset", false)
@language_changed = Ops.get_boolean(@param, "language_changed", false)
@items = Builtins.maplist(AddOnProduct.add_on_products) do |product|
data = Pkg.SourceGeneralData(Ops.get_integer(product, "media", -1))
dir = Ops.get_locale(data, "product_dir", _("Unknown"))
dir = "/" if dir == ""
Builtins.sformat(
"%1 (Media %2, directory %3)",
Ops.get_string(product, "product", ""),
Ops.get_locale(data, "url", _("Unknown")),
dir
)
end
if Builtins.size(@items) == 0
@items = [_("No add-on product selected for installation")]
end
WorkflowManager.RedrawWizardSteps
@ret = { "raw_proposal" => @items }
elsif @func == "AskUser"
Wizard.CreateDialog
@result = RunAddOnMainDialog(
false,
true,
true,
Label.BackButton,
Label.OKButton,
Label.CancelButton,
false
)
UI.CloseDialog
@ret = { "workflow_sequence" => @result, "mode_changed" => false }
elsif @func == "Description"
@ret = {
"rich_text_title" => _("Add-On Products"),
"menu_title" => _("Add-&on Products"),
"id" => "add_on"
}
end
deep_copy(@ret)
end
|