Class: Installation::SelectSystemRole
- Inherits:
-
UI::InstallationDialog
- Object
- UI::InstallationDialog
- Installation::SelectSystemRole
- Includes:
- UI::TextHelpers
- Defined in:
- src/lib/installation/select_system_role.rb
Instance Method Summary collapse
- #create_dialog ⇒ Object
- #dialog_content ⇒ Object
- #dialog_title ⇒ Object
- #help_text ⇒ Object
-
#initialize ⇒ SelectSystemRole
constructor
A new instance of SelectSystemRole.
- #next_handler ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize ⇒ SelectSystemRole
Returns a new instance of SelectSystemRole.
43 44 45 46 47 |
# File 'src/lib/installation/select_system_role.rb', line 43 def initialize super textdomain "installation" end |
Instance Method Details
#create_dialog ⇒ Object
96 97 98 99 100 101 |
# File 'src/lib/installation/select_system_role.rb', line 96 def create_dialog clear_role ok = super Yast::UI.SetFocus(Id(:role_selector)) if ok ok end |
#dialog_content ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'src/lib/installation/select_system_role.rb', line 82 def dialog_content preselected_role_id = SystemRole.current preselected_role_id ||= roles.first&.id if SystemRole.default? VBox( Left(Label(Yast::ProductControl.GetTranslatedText("roles_text"))), VSpacing(2), SingleItemSelector( Id(:role_selector), roles_items(preselected_role_id) ) ) end |
#dialog_title ⇒ Object
74 75 76 |
# File 'src/lib/installation/select_system_role.rb', line 74 def dialog_title Yast::ProductControl.GetTranslatedText("roles_caption") end |
#help_text ⇒ Object
78 79 80 |
# File 'src/lib/installation/select_system_role.rb', line 78 def help_text Yast::ProductControl.GetTranslatedText("roles_help") end |
#next_handler ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'src/lib/installation/select_system_role.rb', line 103 def next_handler result = select_role(selected_role_id) # We show the main role dialog; but the additional clients have # drawn over it, so draw it again and go back to input loop. # create_dialog do not create new dialog if it already exist like in this # case. if result == :back create_dialog nil else finish_dialog(result) end end |
#run ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'src/lib/installation/select_system_role.rb', line 49 def run if roles(refresh: true).empty? log.info "No roles defined, skipping their dialog" return :auto # skip forward or backward end if Yast::GetInstArgs.going_back # If coming back, we have to run the additional dialogs first... clients = additional_clients_for(SystemRole.current) direction = run_clients(clients, going_back: true) # ...and only run the main dialog (super) if there is more than one role (fate#324713) and # we are *still* going back return direction if single_role? || direction != :back end if single_role? # Apply the role and skip the dialog when there is only one (fate#324713) log.info "Only one role available, applying it and skipping the dialog" clear_role return select_role(roles.first.id) end super end |