Class: Y2Network::Widgets::IfplugdPriority

Inherits:
CWM::IntField
  • Object
show all
Defined in:
src/lib/y2network/widgets/ifplugd_priority.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ IfplugdPriority

Returns a new instance of IfplugdPriority.


25
26
27
28
29
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 25

def initialize(config)
  textdomain "network"

  @config = config
end

Instance Method Details

#helpObject


37
38
39
40
41
42
43
44
45
46
47
48
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 37

def help
  # TRANSLATORS: help text for Ifplugd priority widget
  _(
    "<p><b><big>IFPLUGD PRIORITY</big></b></p> \n" \
      "<p> All interfaces configured with <b>On Cable Connection</b> " \
      "and with IFPLUGD_PRIORITY != 0 will be\n" \
      " used mutually exclusive. If more then one of these interfaces " \
      "is <b>On Cable Connection</b>\n" \
      " then we need a way to decide which interface to take up. Therefore we have to\n" \
      " set the priority of each interface.  </p>\n"
  )
end

#initObject


58
59
60
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 58

def init
  self.value = @config.ifplugd_priority
end

#labelObject


31
32
33
34
35
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 31

def label
  _(
    "Ifplugd Priority"
  )
end

#maximumObject


54
55
56
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 54

def maximum
  100
end

#minimumObject


50
51
52
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 50

def minimum
  0
end

#storeObject


62
63
64
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 62

def store
  @config.ifplugd_priority = value.to_i if enabled?
end