Module: Yast::GeoClusterWizardsInclude

Defined in:
../../src/include/geo-cluster/wizards.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) GeoClusterAutoSequence

Whole configuration of geo-cluster but without reading and writing. For use with autoinstallation.

Returns:

  • sequence result



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File '../../src/include/geo-cluster/wizards.rb', line 139

def GeoClusterAutoSequence
  # Initialization dialog caption
  caption = _("Geo Cluster Configuration")
  # Initialization dialog contents
  contents = Label(_("Initializing..."))

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

  ret = MainSequence()

  UI.CloseDialog
  deep_copy(ret)
end

- (Object) GeoClusterSequence

Whole configuration of geo-cluster

Returns:

  • sequence result



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File '../../src/include/geo-cluster/wizards.rb', line 114

def GeoClusterSequence
  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_geo_cluster_wizards(include_target)



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File '../../src/include/geo-cluster/wizards.rb', line 30

def initialize_geo_cluster_wizards(include_target)
  Yast.import "UI"

  textdomain "geo-cluster"

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

  Yast.include include_target, "geo-cluster/complex.rb"
  Yast.include include_target, "geo-cluster/dialogs.rb"

  @DIALOG = ["choose_conf", "firewall"]

  @PARENT = {}

  @NAME = {
    "choose_conf" => _("Geo Cluster Configuration"),
    "authentication_conf" => _("Authentication Configuration"),
    "firewall"    => _("Firewall Configuration"),
  }

end

- (Object) MainSequence

Main workflow of the geo-cluster configuration

Returns:

  • sequence result



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
102
103
104
105
106
107
108
109
110
# File '../../src/include/geo-cluster/wizards.rb', line 55

def MainSequence
  # FIXME: adapt to your needs
  aliases = { "choose_conf" => lambda { ChooseConfigureDialog() },
              "firewall" => lambda  { ServiceDialog() }
  }

  # FIXME: adapt to your needs
  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, "GeoCluster")

  # 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(sequence["ws_start"])

  ret = Sequencer.Run(aliases, sequence)
  Wizard.CloseDialog

  deep_copy(ret)
end