-
Notifications
You must be signed in to change notification settings - Fork 19
/
addon_selection_registration_dialog.rb
66 lines (55 loc) · 1.96 KB
/
addon_selection_registration_dialog.rb
1
2
3
4
5
6
7
8
9
10
11
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
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
require "registration/ui/addon_selection_base_dialog"
module Registration
module UI
# this class displays and runs the dialog with addon selection
class AddonSelectionRegistrationDialog < AddonSelectionBaseDialog
# display and run the dialog with addon selection
# @param registration [Registration::Registration] use this Registration object for
# communication with SCC
# @return [Symbol] user input symbol
def self.run(registration)
dialog = AddonSelectionRegistrationDialog.new(registration)
dialog.run
end
# constructor
# @param registration [Registration::Registration] use this Registration object for
# communication with SCC
def initialize(registration)
textdomain "registration"
super(registration)
end
# display the extension selection dialog and wait for a button click
# @return [Symbol] user input
def run
Wizard.SetContents(
# dialog title
_("Extension and Module Selection"),
content,
# help text (1/3)
_("<p>Here you can select available extensions and modules for your"\
"system.</p>") + generic_help_text,
# always enable Back/Next, the dialog cannot be the first in workflow
true,
true
)
@old_selection = Addon.selected.dup
reactivate_dependencies
handle_dialog
end
private
# @return [String] the main dialog label
def heading
_("Available Extensions and Modules")
end
# @return [Boolean] is the addon selected?
def addon_selected?(addon)
addon.selected? || addon.registered?
end
# update the enabled/disabled status in UI for dependent addons
def reactivate_dependencies
Yast::UI.ChangeWidget(Id(:items), :Value, richtext_checkboxes(@addons))
end
end
end
end