Module: Yast::DrbdGlobalConfInclude

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) ConfigureGlobalDialog



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
137
# File '../../src/include/drbd/global_conf.rb', line 91

def ConfigureGlobalDialog
  global_conf_Read

  my_SetContents("global_conf", global_conf_GetDialog)

  ret = nil
  while true
    Wizard.SelectTreeItem("global_conf")

    ret = UI.UserInput

    if ret == :help
      myHelp("global_conf")
      next
    end

    if ret == :wizardTree
      ret = Convert.to_string(UI.QueryWidget(Id(:wizardTree), :CurrentItem))
    end

    if ret == "DialogRefresh" || ret == "MinorCount" ||
        ret == "DisableIpVerification"
      Drbd.modified = true
      next
    end

    if ret == :abort || ret == :cancel
      if ReallyAbort()
        return deep_copy(ret)
      else
        next
      end
    end

    if ret == :next || ret == :back ||
        Builtins.contains(@DIALOG, Builtins.tostring(ret))
      next if !global_conf_Write

      if ret != :next && ret != :back
        ret = Builtins.symbolof(Builtins.toterm(ret))
      end

      break
    end
  end
  deep_copy(ret)
end

- (Object) global_conf_GetDialog



33
34
35
36
37
38
39
40
41
42
43
44
45
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
# File '../../src/include/drbd/global_conf.rb', line 33

def global_conf_GetDialog
  VBox(
    Frame(
      _("Global Configuration of DRBD"),
      HBox(
        VBox(
          Left(
            IntField(
              Id("MinorCount"),
              _("Minor Count"),
              1,
              20,
              Builtins.tointeger(@mc)
            )
          ),
          Left(
            IntField(
              Id("DialogRefresh"),
              _("Dialog Refresh"),
              0,
              1000,
              Builtins.tointeger(@diagref)
            )
          ),
          Left(
            CheckBox(
              Id("DisableIpVerification"),
              Opt(:notify),
              _("Disable IP Verification"),
              @disipver == "true"
            )
          )
        )
      )
    ),
    VStretch()
  )
end

- (Object) global_conf_Read



21
22
23
24
25
26
27
28
29
30
31
# File '../../src/include/drbd/global_conf.rb', line 21

def global_conf_Read
  @disipver = Ops.get_string(
    Drbd.global_config,
    "disable-ip-verification",
    "false"
  )
  @diagref = Ops.get_string(Drbd.global_config, "dialog-refresh", "1")
  @mc = Ops.get_string(Drbd.global_config, "minor-count", "5")

  nil
end

- (Object) global_conf_Write



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File '../../src/include/drbd/global_conf.rb', line 72

def global_conf_Write
  @disipver = Convert.to_boolean(
    UI.QueryWidget(Id("DisableIpVerification"), :Value)
  ) ? "true" : nil
  @diagref = Builtins.sformat(
    "%1",
    UI.QueryWidget(Id("DialogRefresh"), :Value)
  )
  @mc = Builtins.sformat("%1", UI.QueryWidget(Id("MinorCount"), :Value))

  Ops.set(Drbd.global_config, "disable-ip-verification", @disipver)
  Ops.set(Drbd.global_config, "dialog-refresh", @diagref)
  Ops.set(Drbd.global_config, "minor-count", @mc)

  Drbd.modified = true

  true
end

- (Object) initialize_drbd_global_conf(include_target)



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File '../../src/include/drbd/global_conf.rb', line 5

def initialize_drbd_global_conf(include_target)
  Yast.import "UI"
  textdomain "drbd"
  Yast.import "Label"
  Yast.import "Wizard"
  Yast.import "Drbd"

  Yast.include include_target, "drbd/helps.rb"
  Yast.include include_target, "drbd/common.rb"

  @disipver = "false"
  @disiohin = "false"
  @diagref = "0"
  @mc = "0"
end