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


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
# 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


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

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


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

def maximum
  100
end

#minimumObject


48
49
50
# File 'src/lib/y2network/widgets/ifplugd_priority.rb', line 48

def minimum
  0
end

#storeObject


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

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