Module: Yast::NetworkSummaryInclude

Defined in:
../../src/include/network/summary.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) BuildTypesList(types, cur)

Create list of Table items

Parameters:

  • types (Array<String>)

    list of types

  • cur (String)

    current type

Returns:

  • Table items



46
47
48
49
50
51
# File '../../src/include/network/summary.rb', line 46

def BuildTypesList(types, cur)
  types = deep_copy(types)
  Builtins.maplist(types) do |t|
    Item(Id(t), NetworkInterfaces.GetDevTypeDescription(t, false), t == cur)
  end
end

- (Object) initialize_network_summary(include_target)



35
36
37
38
39
40
# File '../../src/include/network/summary.rb', line 35

def initialize_network_summary(include_target)
  textdomain "network"

  Yast.import "String"
  Yast.import "NetworkInterfaces"
end

- (Object) OverviewTable(header, contents)

Create table widget for the overview screens

Parameters:

  • header (Yast::Term)

    table header

  • contents (Array)

    table contents

Returns:

  • table widget



99
100
101
102
103
# File '../../src/include/network/summary.rb', line 99

def OverviewTable(header, contents)
  header = deep_copy(header)
  contents = deep_copy(contents)
  VBox(VSpacing(0.5), OverviewTableContents("", header, contents, true))
end

- (Object) OverviewTableContents(caption, header, contents, first)

Create table widget for the overview screens with correct spacings

Parameters:

  • caption (String)

    table caption

  • header (Yast::Term)

    table header

  • contents (Array)

    table contents

  • first (Boolean)

    table is first of the two tables

Returns:

  • table widget



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
# File '../../src/include/network/summary.rb', line 59

def OverviewTableContents(caption, header, contents, first)
  header = deep_copy(header)
  contents = deep_copy(contents)
  addbutton = nil
  editbutton = nil
  deletebutton = nil
  if first
    # Pushbutton label
    addbutton = PushButton(Id(:add), Opt(:key_F3), _("A&dd"))
    # Pushbutton label
    editbutton = PushButton(Id(:edit), Opt(:key_F4), _("&Edit"))
    # Pushbutton label
    deletebutton = PushButton(Id(:delete), Opt(:key_F5), _("De&lete"))
  else
    # Pushbutton label (different shortcut)
    addbutton = PushButton(Id(:Add), _("&Add"))
    # Pushbutton label (different shortcut)
    editbutton = PushButton(Id(:Edit), _("Ed&it"))
    # Pushbutton label (different shortcut)
    deletebutton = PushButton(Id(:Delete), _("Dele&te"))
  end

  HBox(
    HSpacing(1.5),
    VBox(
      VSpacing(0.0),
      caption != "" ? Left(Heading(caption)) : VSpacing(0.0),
      Table(Id(first ? :table : :Table), Opt(:notify), header, contents),
      VSpacing(0.4),
      HBox(Opt(:hstretch), addbutton, editbutton, deletebutton),
      VSpacing(0.5)
    ),
    HSpacing(1.5)
  )
end

- (Object) OverviewTableDouble(caption1, header1, contents1, caption2, header2, contents2)

Create two table widgets for the overview screens

Parameters:

  • caption1 (String)

    first table caption

  • header1 (Yast::Term)

    first table header

  • contents1 (Array)

    first table contents

  • caption2 (String)

    second table caption

  • header2 (Yast::Term)

    second table header

  • contents2 (Array)

    second table contents

Returns:

  • table widget



113
114
115
116
117
118
119
120
121
122
123
# File '../../src/include/network/summary.rb', line 113

def OverviewTableDouble(caption1, header1, contents1, caption2, header2, contents2)
  header1 = deep_copy(header1)
  contents1 = deep_copy(contents1)
  header2 = deep_copy(header2)
  contents2 = deep_copy(contents2)
  VBox(
    VSpacing(0.5),
    OverviewTableContents(caption1, header1, contents1, true),
    OverviewTableContents(caption2, header2, contents2, false)
  )
end