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
30
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 25

def initialize(config)
  super()
  textdomain "network"

  @config = config
end

Instance Method Details

#helpObject



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

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



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

def init
  self.value = @config.ifplugd_priority
end

#labelObject



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

def label
  _(
    "Ifplugd Priority"
  )
end

#maximumObject



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

def maximum
  100
end

#minimumObject



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

def minimum
  0
end

#storeObject



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

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