Module: Yast::DrbdWizardsInclude

Defined in:
../../src/include/drbd/wizards.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) DrbdAutoSequence

Whole configuration of heartbeat but without reading and writing. For use with autoinstallation.

Returns:

  • sequence result



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File '../../src/include/drbd/wizards.rb', line 137

def DrbdAutoSequence
  # Initialization dialog caption
  caption = _("Heartbeat Configuration")
  # Initialization dialog contents
  contents = Label(_("Initializing..."))

  Wizard.CreateDialog
  Wizard.SetContentsButtons(
    caption,
    contents,
    "",
    Label.BackButton,
    Label.NextButton
  )

  ret = TabSequence()

  UI.CloseDialog
  deep_copy(ret)
end

- (Object) DrbdSequence



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File '../../src/include/drbd/wizards.rb', line 112

def DrbdSequence
  aliases = {
    "read"  => [lambda { ReadDialog() }, true],
    "main"  => lambda { MainSequence() },
    "write" => [lambda { WriteDialog() }, true]
  }

  sequence = {
    "ws_start" => "read",
    "read"     => { :abort => :abort, :next => "main" },
    "main"     => { :abort => :abort, :next => "write" },
    "write"    => { :abort => :abort, :next => :next }
  }

  Wizard.CreateDialog

  ret = Sequencer.Run(aliases, sequence)

  UI.CloseDialog
  deep_copy(ret)
end

- (Object) initialize_drbd_wizards(include_target)



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

def initialize_drbd_wizards(include_target)
  Yast.import "UI"

  textdomain "drbd"

  Yast.import "Sequencer"
  Yast.import "Wizard"

  Yast.include include_target, "drbd/complex.rb"
  Yast.include include_target, "drbd/dialogs.rb"
  Yast.include include_target, "drbd/startup_conf.rb"
  Yast.include include_target, "drbd/global_conf.rb"
  Yast.include include_target, "drbd/lvm_conf.rb"
  Yast.include include_target, "drbd/resource_conf.rb"
end

- (Object) MainSequence



103
104
105
106
107
108
109
110
# File '../../src/include/drbd/wizards.rb', line 103

def MainSequence
  #    if (Heartbeat::firstrun) {
  #    return FirstRunSequence();
  #    } else {
  #    return TabSequence();
  #    }
  TabSequence()
end

- (Object) TabSequence



46
47
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File '../../src/include/drbd/wizards.rb', line 46

def TabSequence
  _Aliases = {
    "startup_conf"  => lambda { ConfigureStartUpDialog() },
    "global_conf"   => lambda { ConfigureGlobalDialog() },
    "resource_conf" => lambda { ResourceSequence() },
    "lvm_conf" => lambda { ConfigureLVMDialog() }
  }

  anywhere = { :abort => :abort, :next => :next }
  Builtins.foreach(@DIALOG) do |key|
    anywhere = Builtins.add(
      anywhere,
      Builtins.symbolof(Builtins.toterm(key)),
      key
    )
  end

  sequence = { "ws_start" => Ops.get(@DIALOG, 0, "") }
  Builtins.foreach(@DIALOG) do |key|
    sequence = Builtins.add(sequence, key, anywhere)
  end

  # UI initialization
  Wizard.OpenTreeNextBackDialog

  tree = []
  Builtins.foreach(@DIALOG) do |key|
    tree = Wizard.AddTreeItem(
      tree,
      Ops.get_string(@PARENT, key, ""),
      Ops.get_string(@NAME, key, ""),
      key
    )
  end

  Wizard.CreateTree(tree, "DRBD")
  Wizard.SetDesktopTitleAndIcon("drbd")

  # Buttons redefinition
  Wizard.SetNextButton(:next, Label.FinishButton)

  if UI.WidgetExists(Id(:wizardTree))
    Wizard.SetBackButton(:help_button, Label.HelpButton)
    Wizard.SetAbortButton(:abort, Label.CancelButton)
  else
    UI.WizardCommand(term(:SetNextButtonLabel, Label.FinishButton))
    UI.WizardCommand(term(:SetAbortButtonLabel, Label.CancelButton))
  end
  Wizard.HideBackButton

  Wizard.SelectTreeItem(Ops.get_string(sequence, "ws_start", ""))

  ret = Sequencer.Run(_Aliases, sequence)
  Wizard.CloseDialog
  deep_copy(ret)
end