Class: Yast::NetworkClient
- Inherits:
-
Client
- Object
- Client
- Yast::NetworkClient
- Defined in:
- src/clients/network.rb
Instance Method Summary collapse
Instance Method Details
#main ⇒ Object
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 |
# File 'src/clients/network.rb', line 32 def main Yast.import "UI" textdomain "network" # The main () Builtins.y2milestone("----------------------------------------") Builtins.y2milestone("Network module started") Yast.import "Label" Yast.import "Wizard" Yast.import "CommandLine" # is this proposal or not? @propose = false @args = WFM.Args if Ops.greater_than(Builtins.size(@args), 0) if Ops.is_path?(WFM.Args(0)) && WFM.Args(0) == path(".propose") Builtins.y2milestone("Using PROPOSE mode") @propose = true end end @cmdline_description = { "id" => "network", # translators: command line help for network module "help" => _( "Configuration of network.\n" \ "This is only a delegator to network sub-modules.\n" \ "You can run these network modules:\n" \ "\n" \ "lan\t" ) + _("Network Card"), "guihandler" => fun_ref(method(:startDialog), "any ()"), "options" => {}, "mapping" => {} } # main ui function @ret = if @propose startDialog else CommandLine.Run(@cmdline_description) end Builtins.y2debug("ret=%1", @ret) :next # EOF end |
#startDialog ⇒ Object
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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'src/clients/network.rb', line 84 def startDialog # Network dialog caption caption = _("Network Configuration") # Network dialog help help = _( "<p>Choose one of the available network modules to configure\n" \ " the corresponding devices and press <b>Launch</b>.</p>" ) # Network dialog contents contents = HBox( HSpacing(8), # Frame label VBox( VSpacing(3), # Selection box label SelectionBox( Id(:modules), Opt(:notify), _("&Available Network Modules:"), [ # Selection box item Item(Id("lan"), _("Network Card"), true) ] ), VSpacing(3) ), HSpacing(8) ) Wizard.CreateDialog Wizard.SetDesktopTitleAndIcon("network") Wizard.SetContentsButtons( caption, contents, help, Label.BackButton, _("&Launch") ) UI.SetFocus(Id(:modules)) ret = nil loop do ret = UI.UserInput # abort? case ret when :abort, :cancel break # next when :next, :modules # check_* ret = :next break # back when :back break else Builtins.y2error("unexpected retcode: %1", ret) next end end launch = "lan" if ret == :next launch = Convert.to_string(UI.QueryWidget(Id(:modules), :CurrentItem)) Builtins.y2debug("launch=%1", launch) end UI.CloseDialog # Finish Builtins.y2milestone("Network module finished") Builtins.y2milestone("----------------------------------------") (ret == :next) ? WFM.CallFunction(launch, WFM.Args) : :back end |