Class: Yast::BootloaderClient
- Inherits:
-
Client
- Object
- Client
- Yast::BootloaderClient
- Defined in:
- src/clients/bootloader.rb
Instance Method Summary (collapse)
-
- (Boolean) BootloaderDeleteHandler(options)
Delete specified option.
-
- (Boolean) BootloaderModify(key, value)
Modify the boot loader global option.
-
- (Boolean) BootloaderPrintHandler(options)
Print the value of specified option.
-
- (Boolean) BootloaderSetHandler(options)
Set specified option in global options.
-
- (Boolean) BootloaderSummaryHandler(options)
Print summary of basic options.
-
- (Boolean) GuiHandler
CommandLine handler for running GUI.
- - (Object) main
Instance Method Details
- (Boolean) BootloaderDeleteHandler(options)
Delete specified option
163 164 165 166 |
# File 'src/clients/bootloader.rb', line 163 def BootloaderDeleteHandler() option = ["option"] BootloaderModifySection(option, nil) end |
- (Boolean) BootloaderModify(key, value)
Modify the boot loader global option
141 142 143 144 |
# File 'src/clients/bootloader.rb', line 141 def BootloaderModify(key, value) BootCommon.globals[key] = value return true end |
- (Boolean) BootloaderPrintHandler(options)
Print the value of specified option
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'src/clients/bootloader.rb', line 171 def BootloaderPrintHandler() = deep_copy() option = ["option"] if option.nil? # command line error report CommandLine.Print(_("Option was not specified.")) return false end value = BootCommon.globals[option] if value # command line, %1 is the value of bootloader option CommandLine.Print(_("Value: %s") % value) else # command line error report CommandLine.Print(_("Specified option does not exist.")) end false end |
- (Boolean) BootloaderSetHandler(options)
Set specified option in global options
149 150 151 152 153 154 155 156 157 158 |
# File 'src/clients/bootloader.rb', line 149 def BootloaderSetHandler() option = ["option"] value = ["value"] if value.nil? # command line error report CommandLine.Print(_("Value was not specified.")) return false end BootloaderModify(option, value.to_s) end |
- (Boolean) BootloaderSummaryHandler(options)
Print summary of basic options
126 127 128 129 130 131 132 133 134 |
# File 'src/clients/bootloader.rb', line 126 def BootloaderSummaryHandler() = deep_copy() CommandLine.Print( RichText.Rich2Plain( Ops.add("<br>", Builtins.mergestring(Bootloader.Summary, "<br>")) ) ) false # do not call Write... end |
- (Boolean) GuiHandler
CommandLine handler for running GUI
116 117 118 119 120 121 |
# File 'src/clients/bootloader.rb', line 116 def GuiHandler ret = BootloaderSequence() return false if ret == :abort || ret == :back || ret == :nil true end |
- (Object) main
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'src/clients/bootloader.rb', line 19 def main Yast.import "UI" textdomain "bootloader" Yast.import "BootCommon" Yast.import "Bootloader" Yast.import "CommandLine" Yast.import "Mode" Yast.import "RichText" Yast.include self, "bootloader/routines/wizards.rb" # the command line description map cmdline = { "id" => "bootloader", # command line help text for Bootloader module "help" => _( "Boot loader configuration module" ), "guihandler" => fun_ref(method(:GuiHandler), "boolean ()"), "initialize" => fun_ref(Bootloader.method(:Read), "boolean ()"), "finish" => fun_ref(Bootloader.method(:Write), "boolean ()"), "actions" => { "summary" => { "handler" => fun_ref( method(:BootloaderSummaryHandler), "boolean (map)" ), # command line help text for summary action "help" => _( "Configuration summary of boot loader" ) }, "delete" => { "handler" => fun_ref( method(:BootloaderDeleteHandler), "boolean (map)" ), # command line help text for delete action "help" => _( "Delete a global option" ) }, "set" => { "handler" => fun_ref(method(:BootloaderSetHandler), "boolean (map)"), # command line help text for set action "help" => _( "Set a global option" ) }, "print" => { "handler" => fun_ref( method(:BootloaderPrintHandler), "boolean (map)" ), # command line help text for print action "help" => _( "Print value of specified option" ) } }, "options" => { "option" => { # command line help text for an option "help" => _( "The key of the option" ), "type" => "string" }, "value" => { # command line help text for an option "help" => _( "The value of the option" ), "type" => "string" } }, "mappings" => { "summary" => [], "delete" => ["option"], "set" => ["option", "value"], "print" => ["option"] } } Builtins.y2milestone("Starting bootloader configuration module") ret = CommandLine.Run(cmdline) Builtins.y2milestone("Finishing bootloader configuration module") ret end |