Class: Installation::URLDialog
- Inherits:
-
UI::Dialog
- Object
- UI::Dialog
- Installation::URLDialog
- Includes:
- Yast::I18n, Yast::UIShortcuts
- Defined in:
- src/lib/installation/dialogs/url_dialog.rb
Overview
A subclass of UI::Dialog which provides a common dialog to edit an url. It is composed by two buttons to confirm and cancel the edition, a dialog heading and a help text.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#cancel_handler ⇒ Symbol
Handler for the :cancel button wich finishes the dialog and returns :cancel.
- #cancel_label ⇒ Object
-
#dialog_content ⇒ String
Shows a dialog when the given url is wrong.
-
#dialog_title ⇒ String
Heading title for the dialog.
-
#entry_label ⇒ String
Text label for the url entry.
-
#help_text ⇒ String
Help text that will be displayed above the url entry.
-
#initialize(url) ⇒ URLDialog
constructor
Constructor.
-
#ok_handler ⇒ String
Handler for the :ok button which queries the value of the URL entry and finish the dialog returning the value of it.
- #ok_label ⇒ Object
Constructor Details
#initialize(url) ⇒ URLDialog
Constructor
The dialog text entry will be filled with the url given
46 47 48 49 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 46 def initialize(url) super() @url = url end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
39 40 41 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 39 def url @url end |
Instance Method Details
#cancel_handler ⇒ Symbol
Handler for the :cancel button wich finishes the dialog and returns :cancel
83 84 85 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 83 def cancel_handler finish_dialog(:cancel) end |
#cancel_label ⇒ Object
91 92 93 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 91 def cancel_label Yast::Label.CancelButton end |
#dialog_content ⇒ String
Shows a dialog when the given url is wrong
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 54 def dialog_content VBox( show_heading? ? Heading(dialog_title) : Empty(), show_help? ? RichText(help_text) : Empty(), VSpacing(1), VStretch(), MinWidth(60, Left(TextEntry(Id(:uri), entry_label, @url))), VSpacing(1), VStretch(), HBox( PushButton(Id(:ok), Opt(:default), ok_label), PushButton(Id(:cancel), cancel_label) ) ) end |
#dialog_title ⇒ String
Heading title for the dialog
105 106 107 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 105 def dialog_title "" end |
#entry_label ⇒ String
Text label for the url entry
112 113 114 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 112 def entry_label "" end |
#help_text ⇒ String
Help text that will be displayed above the url entry
98 99 100 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 98 def help_text "" end |
#ok_handler ⇒ String
Handler for the :ok button which queries the value of the URL entry and finish the dialog returning the value of it
75 76 77 78 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 75 def ok_handler @url = Yast::UI.QueryWidget(Id(:uri), :Value) finish_dialog(@url) end |
#ok_label ⇒ Object
87 88 89 |
# File 'src/lib/installation/dialogs/url_dialog.rb', line 87 def ok_label Yast::Label.OKButton end |