Module: Yast::IplbComplexInclude

Defined in:
../../src/include/iplb/complex.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) initialize_iplb_complex(include_target)



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File '../../src/include/iplb/complex.rb', line 30

def initialize_iplb_complex(include_target)
  Yast.import "UI"

  textdomain "iplb"

  Yast.import "Label"
  Yast.import "Popup"
  Yast.import "Wizard"
  #import "Wizard_hw";
  Yast.import "Confirm"
  Yast.import "Iplb"


  Yast.include include_target, "iplb/helps.rb"
end

- (Object) Modified

Return a modification status

Returns:

  • true if data was modified



48
49
50
# File '../../src/include/iplb/complex.rb', line 48

def Modified
  Iplb.Modified
end

- (Object) OverviewDialog

Overview dialog

Returns:

  • dialog result



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File '../../src/include/iplb/complex.rb', line 140

def OverviewDialog
  # Iplb overview dialog caption
  caption = _("IPLB Overview")

  overview = Iplb.Overview

  # FIXME table header
  contents = nil
  #Wizard_hw::ConfiguredContent(
  # Table header
  #	`header(_("Number"), _("IPLB")),
  #	overview, nil, nil, nil, nil );

  contents = nil # Wizard_hw::SpacingAround(contents, 1.5, 1.5, 1.0, 1.0);

  #	Wizard::SetContents("Cluster, contents", "help", true, true);

  Wizard.SetContentsButtons(
    caption,
    contents,
    Ops.get_string(@HELPS, "overview", ""),
    Label.BackButton,
    Label.FinishButton
  )

  Wizard.HideBackButton

  ret = nil
  while true
    ret = UI.UserInput

    # abort?
    if ret == :abort || ret == :cancel
      if ReallyAbort()
        break
      else
        next
      end
    # add
    elsif ret == :add_button
      # FIXME
      ret = :add
      break
    # edit
    elsif ret == :edit_button
      # FIXME
      ret = :edit
      break
    # delete
    elsif ret == :delete_button
      # FIXME
      next
    elsif ret == :next || ret == :back
      break
    else
      Builtins.y2error("unexpected retcode: %1", ret)
      next
    end
  end

  deep_copy(ret)
end

- (Object) PollAbort



56
57
58
# File '../../src/include/iplb/complex.rb', line 56

def PollAbort
  UI.PollInput == :abort
end

- (Object) ReadDialog

Read settings dialog

Returns:

  • abort if aborted andnext otherwise



62
63
64
65
66
67
68
# File '../../src/include/iplb/complex.rb', line 62

def ReadDialog
  Wizard.RestoreHelp(Ops.get_string(@HELPS, "read", ""))
  # Iplb::SetAbortFunction(PollAbort);
  return :abort if !Confirm.MustBeRoot
  ret = Iplb.Read
  ret ? :next : :abort
end

- (Object) ReallyAbort



52
53
54
# File '../../src/include/iplb/complex.rb', line 52

def ReallyAbort
  !Iplb.Modified || Popup.ReallyAbort(true)
end

- (Object) SummaryDialog

Summary dialog

Returns:

  • dialog result



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File '../../src/include/iplb/complex.rb', line 81

def SummaryDialog
  # Iplb summary dialog caption
  caption = _("IPLB Configuration")

  # FIXME
  summary = Iplb.Summary
  unconfigured = Ops.get_list(summary, 1, [])
  configured = Ops.get_string(summary, 0, "")

  # Frame label
  contents = nil # Wizard_hw::DetectedContent(_("IPLB to Configure"),
  #	    unconfigured, false, configured);

  Wizard.SetContentsButtons(
    caption,
    contents,
    Ops.get_string(@HELPS, "summary", ""),
    Label.BackButton,
    Label.FinishButton
  )

  ret = nil
  while true
    ret = UI.UserInput

    # abort?
    if ret == :abort || ret == :cancel || ret == :back
      if ReallyAbort()
        break
      else
        next
      end
    # overview dialog
    elsif ret == :edit_button
      ret = :overview
      break
    # configure the selected device
    elsif ret == :configure_button
      # TODO FIXME: check for change of the configuration
      selected = UI.QueryWidget(Id(:detected_selbox), :CurrentItem)
      if selected == :other
        ret = :other
      else
        ret = :configure
      end
      break
    elsif ret == :next
      break
    else
      Builtins.y2error("unexpected retcode: %1", ret)
      next
    end
  end

  deep_copy(ret)
end

- (Object) WriteDialog

Write settings dialog

Returns:

  • abort if aborted andnext otherwise



72
73
74
75
76
77
# File '../../src/include/iplb/complex.rb', line 72

def WriteDialog
  Wizard.RestoreHelp(Ops.get_string(@HELPS, "write", ""))
  # Iplb::SetAbortFunction(PollAbort);
  ret = Iplb.Write
  ret ? :next : :abort
end