Class: Y2Network::Widgets::Startmode
- Inherits:
-
CWM::ComboBox
- Object
- CWM::ComboBox
- Y2Network::Widgets::Startmode
- Defined in:
- src/lib/y2network/widgets/startmode.rb
Instance Method Summary collapse
- #handle ⇒ Object
- #help ⇒ Object
- #init ⇒ Object
-
#initialize(config, plug_priority_widget) ⇒ Startmode
constructor
A new instance of Startmode.
- #items ⇒ Object
- #label ⇒ Object
- #opt ⇒ Object
- #store ⇒ Object
Constructor Details
#initialize(config, plug_priority_widget) ⇒ Startmode
Returns a new instance of Startmode.
26 27 28 29 30 31 32 |
# File 'src/lib/y2network/widgets/startmode.rb', line 26 def initialize(config, ) super() textdomain "network" @config = config @plug_priority_widget = end |
Instance Method Details
#handle ⇒ Object
51 52 53 54 55 |
# File 'src/lib/y2network/widgets/startmode.rb', line 51 def handle (value == "ifplugd") ? @plug_priority_widget.enable : @plug_priority_widget.disable nil end |
#help ⇒ Object
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 |
# File 'src/lib/y2network/widgets/startmode.rb', line 57 def help # tricky init only to not break long help text translations items_help = [ # TRANSLATORS: help text for Device Activation _( "<p><b>Manually</b>: You control the interface manually\n" \ "via 'ifup' or 'qinternet' (see 'User Controlled' below).</p>\n" ), # TRANSLATORS: help text for Device Activation _( "<b>On Cable Connection</b>:\n" \ "The interface is watched for whether there is a physical\n" \ "network connection. That means either the cable is connected or the\n" \ "wireless interface can connect to an access point.\n" ), # TRANSLATORS: help text for Device Activation _( "With <b>On Hotplug</b>,\n" \ "the interface is set up as soon as it is available. This is\n" \ "nearly the same as 'At Boot Time', but does not result in an error at\n" \ "boot time if the interface is not present.\n" ), # TRANSLATORS: help text for Device Activation _( "Using <b>On NFSroot</b> is similar to <tt>auto</tt>. " \ "Interfaces with this startmode will never\n" \ "be shut down via <tt>rcnetwork stop</tt>. <tt>ifdown <iface></tt> " \ "is still available.\n" \ "Use this if you have an NFS or iSCSI root filesystem.\n" ) ] # Device activation main help. The individual parts will be # substituted as %1 Yast::Builtins.sformat( _( "<p><b><big>Device Activation</big></b></p> \n" \ "<p>Choose when to bring up the network interface. <b>At Boot Time</b> " \ "activates it during system boot, \n" \ "<b>Never</b> does not start the device.\n" \ "%1</p>\n" ), items_help.join(" ") ) end |
#init ⇒ Object
42 43 44 45 |
# File 'src/lib/y2network/widgets/startmode.rb', line 42 def init self.value = @config.startmode.name handle end |
#items ⇒ Object
104 105 106 107 108 |
# File 'src/lib/y2network/widgets/startmode.rb', line 104 def items Y2Network::Startmode.all.map do |mode| [mode.to_s, mode.to_human_string] end end |
#label ⇒ Object
38 39 40 |
# File 'src/lib/y2network/widgets/startmode.rb', line 38 def label _("Activate &Device") end |
#opt ⇒ Object
34 35 36 |
# File 'src/lib/y2network/widgets/startmode.rb', line 34 def opt [:notify] end |
#store ⇒ Object
47 48 49 |
# File 'src/lib/y2network/widgets/startmode.rb', line 47 def store @config.startmode = value end |