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
115 116 117 118 119 120 121 122 123 |
# File 'src/include/bootloader/routines/common_options.rb', line 115 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
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'src/include/bootloader/routines/common_options.rb', line 148 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
131 132 133 134 135 136 137 138 139 |
# File 'src/include/bootloader/routines/common_options.rb', line 131 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
181 182 183 184 185 186 187 188 189 190 191 |
# File 'src/include/bootloader/routines/common_options.rb', line 181 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
208 209 210 |
# File 'src/include/bootloader/routines/common_options.rb', line 208 def CommonOptions { "timeout" => TimeoutWidget() } end |
- (Symbol) HandleGlobalBrowse(widget, event)
Handle function of a widget (IntField + browse button)
98 99 100 101 102 103 104 105 |
# File 'src/include/bootloader/routines/common_options.rb', line 98 def HandleGlobalBrowse(, event) event = deep_copy(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)
57 58 59 60 61 62 |
# File 'src/include/bootloader/routines/common_options.rb', line 57 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)
76 77 78 79 80 81 |
# File 'src/include/bootloader/routines/common_options.rb', line 76 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)
66 67 68 69 70 71 72 |
# File 'src/include/bootloader/routines/common_options.rb', line 66 def StoreGlobalBool(, event) event = deep_copy(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)
86 87 88 89 90 91 92 |
# File 'src/include/bootloader/routines/common_options.rb', line 86 def StoreGlobalInt(, event) event = deep_copy(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 53 |
# File 'src/include/bootloader/routines/common_options.rb', line 44 def StoreGlobalStr(, event) event = deep_copy(event) Ops.set( BootCommon.globals, , Convert.to_string(UI.QueryWidget(Id(), :Value)) ) nil end |
- (Hash{String => Object}) TimeoutWidget
Common widget of a Timeout
195 196 197 198 199 200 201 202 203 204 205 |
# File 'src/include/bootloader/routines/common_options.rb', line 195 def TimeoutWidget { "widget" => :intfield, "label" => Ops.get(@common_descriptions, "timeout", "timeout"), "minimum" => 0, "maximum" => 300, "init" => fun_ref(method(:InitGlobalInt), "void (string)"), "store" => fun_ref(method(:StoreGlobalInt), "void (string, map)"), "help" => Ops.get(@common_help_messages, "timeout", "") } end |