Class: Y2Network::Dialogs::EditInterface
- Inherits:
-
CWM::Dialog
- Object
- CWM::Dialog
- Y2Network::Dialogs::EditInterface
- Defined in:
- src/lib/y2network/dialogs/edit_interface.rb
Overview
Dialog to Edit Interface. Content of the dialog heavily depends on the interface type and change of type is not allowed after dialog creation.
Instance Method Summary collapse
-
#abort_button ⇒ Object
abort is just cancel as this is a sub dialog.
-
#back_button ⇒ Object
removes back button when editing device, but keep it when this dialog follows adding new interface.
- #contents ⇒ Object
-
#initialize(settings) ⇒ EditInterface
constructor
A new instance of EditInterface.
- #title ⇒ Object
Constructor Details
#initialize(settings) ⇒ EditInterface
Returns a new instance of EditInterface.
38 39 40 41 42 |
# File 'src/lib/y2network/dialogs/edit_interface.rb', line 38 def initialize(settings) @settings = settings textdomain "network" end |
Instance Method Details
#abort_button ⇒ Object
abort is just cancel as this is a sub dialog
76 77 78 |
# File 'src/lib/y2network/dialogs/edit_interface.rb', line 76 def Yast::Label.CancelButton end |
#back_button ⇒ Object
removes back button when editing device, but keep it when this dialog follows adding new interface
82 83 84 |
# File 'src/lib/y2network/dialogs/edit_interface.rb', line 82 def @settings.newly_added? ? Yast::Label.BackButton : "" end |
#contents ⇒ Object
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 |
# File 'src/lib/y2network/dialogs/edit_interface.rb', line 48 def contents # if there is addr, make it initial unless for wifi, where first one should be wifi specific # configs addr_tab = Widgets::AddressTab.new(@settings) addr_tab.initial = true unless @settings.type.wireless? tabs = case @settings.type.short_name when "vlan", "dummy" [Widgets::GeneralTab.new(@settings), addr_tab] when "tun", "tap" [addr_tab] when "br" [Widgets::GeneralTab.new(@settings), addr_tab, Widgets::BridgePorts.new(@settings)] when "bond" [Widgets::GeneralTab.new(@settings), addr_tab, Widgets::BondPortsTab.new(@settings)] when "wlan" wireless = Widgets::WirelessTab.new(@settings) wireless.initial = true [Widgets::GeneralTab.new(@settings), wireless, addr_tab, Widgets::HardwareTab.new(@settings)] else [Widgets::GeneralTab.new(@settings), addr_tab, Widgets::HardwareTab.new(@settings)] end VBox(CWM::Tabs.new(*tabs)) end |
#title ⇒ Object
44 45 46 |
# File 'src/lib/y2network/dialogs/edit_interface.rb', line 44 def title _("Network Card Setup") end |