Module: Yast::BootloaderRoutinesCommonOptionsInclude
- Defined in:
- src/include/bootloader/routines/common_options.rb
Instance Method Summary (collapse)
-
- (Hash{String => Object}) CommonCheckboxWidget(label, help)
Generic widget of a checkbox There is not defined valid function if it is necessary create own definition of widget.
-
- (Hash{String => Object}) CommonInputFieldBrowseWidget(label, help, id)
Generic widget of a inputfield + browse button There is not defined valid function if it is necessary create own definition of widget.
-
- (Hash{String => Object}) CommonInputFieldWidget(label, help)
Generic widget of a inputfield/textentry (widget) There is not defined valid function if it is necessary create own definition of widget.
-
- (Hash{String => Object}) CommonIntFieldWidget(label, help, min, max)
Generic widget of a intfield (widget) There is not defined valid function if it is necessary create own definition of widget.
-
- (Hash{String => map<String,Object>}) CommonOptions
Common widgets of global settings.
-
- (Symbol) HandleGlobalBrowse(widget, _event)
Handle function of a widget (IntField + browse button).
-
- (Object) InitGlobalBool(widget)
Init function for widget value (CheckBox).
-
- (Object) InitGlobalInt(widget)
Init function for widget value (IntField).
-
- (Object) InitGlobalStr(widget)
Init function for widget value (InputField).
- - (Object) initialize_bootloader_routines_common_options(include_target)
-
- (Object) StoreGlobalBool(widget, _event)
Init function for widget value (CheckBox).
-
- (Object) StoreGlobalInt(widget, _event)
Store function of a widget (IntField).
-
- (Object) StoreGlobalStr(widget, _event)
Store function of a widget (InputField).
-
- (Hash{String => Object}) TimeoutWidget
Common widget of a Timeout.
Instance Method Details
- (Hash{String => Object}) CommonCheckboxWidget(label, help)
Generic widget of a checkbox There is not defined valid function if it is necessary create own definition of widget
109 110 111 112 113 114 115 116 117 |
# File 'src/include/bootloader/routines/common_options.rb', line 109 def CommonCheckboxWidget(label, help) { "widget" => :checkbox, "label" => label, "init" => fun_ref(method(:InitGlobalBool), "void (string)"), "store" => fun_ref(method(:StoreGlobalBool), "void (string, map)"), "help" => help } end |
- (Hash{String => Object}) CommonInputFieldBrowseWidget(label, help, id)
Generic widget of a inputfield + browse button There is not defined valid function if it is necessary create own definition of widget
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'src/include/bootloader/routines/common_options.rb', line 142 def CommonInputFieldBrowseWidget(label, help, id) browse = Ops.add("browse", id) { "widget" => :custom, "custom_widget" => HBox( Left(InputField(Id(id), Opt(:hstretch), label)), VBox( Label(""), PushButton(Id(browse), Opt(:notify), Label.BrowseButton) ) ), "init" => fun_ref(method(:InitGlobalStr), "void (string)"), "store" => fun_ref( method(:StoreGlobalStr), "void (string, map)" ), "handle" => fun_ref( method(:HandleGlobalBrowse), "symbol (string, map)" ), "handle_events" => [browse], "help" => help } end |
- (Hash{String => Object}) CommonInputFieldWidget(label, help)
Generic widget of a inputfield/textentry (widget) There is not defined valid function if it is necessary create own definition of widget
125 126 127 128 129 130 131 132 133 |
# File 'src/include/bootloader/routines/common_options.rb', line 125 def CommonInputFieldWidget(label, help) { "widget" => :textentry, "label" => label, "init" => fun_ref(method(:InitGlobalStr), "void (string)"), "store" => fun_ref(method(:StoreGlobalStr), "void (string, map)"), "help" => help } end |
- (Hash{String => Object}) CommonIntFieldWidget(label, help, min, max)
Generic widget of a intfield (widget) There is not defined valid function if it is necessary create own definition of widget
175 176 177 178 179 180 181 182 183 184 185 |
# File 'src/include/bootloader/routines/common_options.rb', line 175 def CommonIntFieldWidget(label, help, min, max) { "widget" => :intfield, "label" => label, "minimum" => min, "maximum" => max, "init" => fun_ref(method(:InitGlobalStr), "void (string)"), "store" => fun_ref(method(:StoreGlobalStr), "void (string, map)"), "help" => help } end |
- (Hash{String => map<String,Object>}) CommonOptions
Common widgets of global settings
202 203 204 |
# File 'src/include/bootloader/routines/common_options.rb', line 202 def CommonOptions { "timeout" => TimeoutWidget() } end |
- (Symbol) HandleGlobalBrowse(widget, _event)
Handle function of a widget (IntField + browse button)
95 96 97 98 99 100 101 |
# File 'src/include/bootloader/routines/common_options.rb', line 95 def HandleGlobalBrowse(, _event) current = Convert.to_string(UI.QueryWidget(Id(), :Value)) # file open popup caption current = UI.AskForExistingFile(current, "*", _("Select File")) UI.ChangeWidget(Id(), :Value, current) if !current.nil? nil end |
- (Object) InitGlobalBool(widget)
Init function for widget value (CheckBox)
56 57 58 59 60 61 |
# File 'src/include/bootloader/routines/common_options.rb', line 56 def InitGlobalBool() value = Ops.get(BootCommon.globals, , "false") == "true" UI.ChangeWidget(Id(), :Value, value) nil end |
- (Object) InitGlobalInt(widget)
Init function for widget value (IntField)
74 75 76 77 78 79 |
# File 'src/include/bootloader/routines/common_options.rb', line 74 def InitGlobalInt() value = Builtins.tointeger(Ops.get(BootCommon.globals, , "0")) UI.ChangeWidget(Id(), :Value, value) nil end |
- (Object) InitGlobalStr(widget)
Init function for widget value (InputField)
31 32 33 34 35 36 37 38 39 |
# File 'src/include/bootloader/routines/common_options.rb', line 31 def InitGlobalStr() UI.ChangeWidget( Id(), :Value, Ops.get(BootCommon.globals, , "") ) nil end |
- (Object) initialize_bootloader_routines_common_options(include_target)
23 24 25 26 27 |
# File 'src/include/bootloader/routines/common_options.rb', line 23 def (include_target) textdomain "bootloader" Yast.include include_target, "bootloader/routines/common_helps.rb" end |
- (Object) StoreGlobalBool(widget, _event)
Init function for widget value (CheckBox)
65 66 67 68 69 70 |
# File 'src/include/bootloader/routines/common_options.rb', line 65 def StoreGlobalBool(, _event) value = Convert.to_boolean(UI.QueryWidget(Id(), :Value)) Ops.set(BootCommon.globals, , value ? "true" : "false") nil end |
- (Object) StoreGlobalInt(widget, _event)
Store function of a widget (IntField)
84 85 86 87 88 89 |
# File 'src/include/bootloader/routines/common_options.rb', line 84 def StoreGlobalInt(, _event) value = Convert.to_integer(UI.QueryWidget(Id(), :Value)) Ops.set(BootCommon.globals, , Builtins.tostring(value)) nil end |
- (Object) StoreGlobalStr(widget, _event)
Store function of a widget (InputField)
44 45 46 47 48 49 50 51 52 |
# File 'src/include/bootloader/routines/common_options.rb', line 44 def StoreGlobalStr(, _event) Ops.set( BootCommon.globals, , Convert.to_string(UI.QueryWidget(Id(), :Value)) ) nil end |
- (Hash{String => Object}) TimeoutWidget
Common widget of a Timeout
189 190 191 192 193 194 195 196 197 198 199 |
# File 'src/include/bootloader/routines/common_options.rb', line 189 def TimeoutWidget { "widget" => :intfield, "label" => Ops.get(@common_descriptions, "timeout", "timeout"), "minimum" => -1, "maximum" => 600, "init" => fun_ref(method(:InitGlobalInt), "void (string)"), "store" => fun_ref(method(:StoreGlobalInt), "void (string, map)"), "help" => Ops.get(@common_help_messages, "timeout", "") } end |