Class: UI::InstallationDialog
- Defined in:
- library/general/src/lib/ui/installation_dialog.rb
Overview
Subclass of UI::Dialog to be used by installation steps.
When used in YaST normal mode, it opens a one-step wizard to allow manual testing of the dialog
Instance Method Summary collapse
-
#abort_handler ⇒ Object
Handler for the 'abort' event.
-
#accept_handler ⇒ Object
Handler for the 'accept' event.
-
#back_handler ⇒ Object
Handler for the 'back' event.
-
#cancel_handler ⇒ Object
Handler for the 'cancel' event.
- #close_dialog ⇒ Object protected
-
#create_dialog ⇒ Object
protected
Reimplementation of UI::Dialog#create_dialog for the installer.
-
#dialog_title ⇒ String
protected
Headline for the dialog.
-
#help_text ⇒ String
protected
Text to display when the help button is pressed.
-
#initialize ⇒ InstallationDialog
constructor
A new instance of InstallationDialog.
-
#next_handler ⇒ Object
Handler for the 'next' event.
-
#title_icon ⇒ String
protected
Optional title icon.
Methods inherited from Dialog
#dialog_content, #dialog_options, #run, run
Methods included from EventDispatcher
#event_loop, #finish_dialog, #user_input
Constructor Details
permalink #initialize ⇒ InstallationDialog
Returns a new instance of InstallationDialog.
58 59 60 61 62 63 64 65 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 58 def initialize super Yast.import "Mode" Yast.import "Wizard" Yast.import "GetInstArgs" Yast.import "Popup" @_wizard_opened = false end |
Instance Method Details
permalink #abort_handler ⇒ Object
Handler for the 'abort' event
The default implementation ask the user for confirmation
93 94 95 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 93 def abort_handler finish_dialog(:abort) if Yast::Popup.ConfirmAbort(:painless) end |
permalink #accept_handler ⇒ Object
Handler for the 'accept' event
Used when the dialog is called from a proposal, by default it simply calls the handler for 'next'
71 72 73 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 71 def accept_handler next_handler end |
permalink #back_handler ⇒ Object
Handler for the 'back' event
81 82 83 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 81 def back_handler finish_dialog(:back) end |
permalink #cancel_handler ⇒ Object
Handler for the 'cancel' event
86 87 88 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 86 def cancel_handler finish_dialog(:cancel) end |
permalink #close_dialog ⇒ Object (protected)
[View source] [View on GitHub]
140 141 142 143 144 145 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 140 def close_dialog return unless @_wizard_opened @_wizard_opened = false Yast::Wizard.CloseDialog end |
permalink #create_dialog ⇒ Object (protected)
Reimplementation of UI::Dialog#create_dialog for the installer
It ignores UI::Dialog#dialog_options
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 121 def create_dialog log.info "This is an InstallationDialog, ignoring #dialog_options" if # Allow manual testing if !Yast::Wizard.IsWizardDialog @_wizard_opened = true Yast::Wizard.CreateDialog end Yast::Wizard.SetContents( dialog_title, dialog_content, help_text, Yast::GetInstArgs.enable_back, Yast::GetInstArgs.enable_next || Yast::Mode.normal ) true end |
permalink #dialog_title ⇒ String (protected)
Headline for the dialog
107 108 109 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 107 def dialog_title "" end |
permalink #help_text ⇒ String (protected)
Text to display when the help button is pressed
114 115 116 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 114 def help_text "" end |
permalink #next_handler ⇒ Object
Handler for the 'next' event
76 77 78 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 76 def next_handler finish_dialog(:next) end |
permalink #title_icon ⇒ String (protected)
Optional title icon
102 |
# File 'library/general/src/lib/ui/installation_dialog.rb', line 102 def title_icon; end |