Module: Yast::DnsServerDialogsInclude

Defined in:
../../src/include/dns-server/dialogs.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) initialize_dns_server_dialogs(include_target)



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File '../../src/include/dns-server/dialogs.rb', line 14

def initialize_dns_server_dialogs(include_target)
  textdomain "dns-server"

  Yast.import "DnsServer"

  Yast.import "Popup"
  Yast.import "Label"
  Yast.import "CWM"
  Yast.import "Wizard"
  Yast.import "Message"
  Yast.import "SuSEFirewall"
  Yast.import "Punycode"
  Yast.import "Confirm"
end

- (Object) ReadDialog

Read settings dialog

Returns:

  • abort if aborted andnext otherwise



52
53
54
55
56
57
58
59
60
# File '../../src/include/dns-server/dialogs.rb', line 52

def ReadDialog
  Wizard.RestoreHelp(Ops.get_string(@HELPS, "read", ""))

  # checking for root permissions
  return :abort if !Confirm.MustBeRoot

  ret = DnsServer.Read
  ret ? :next : :abort
end

- (Object) ReallyAbort

If modified, ask for confirmation

Returns:

  • true if abort is confirmed



39
40
41
42
# File '../../src/include/dns-server/dialogs.rb', line 39

def ReallyAbort
  return true if !DnsServer.WasModified
  Popup.ReallyAbort(true)
end

- (Object) ReallyAbortAlways

Ask for confirmation (always)

Returns:

  • true if abort is confirmed



46
47
48
# File '../../src/include/dns-server/dialogs.rb', line 46

def ReallyAbortAlways
  Popup.ReallyAbort(true)
end

- (Boolean) ReallyExit

Ask user if exit without saving

Returns:

  • (Boolean)

    true if exit



31
32
33
34
35
# File '../../src/include/dns-server/dialogs.rb', line 31

def ReallyExit
  return true if !DnsServer.WasModified
  # yes-no popup
  Popup.YesNo(_("All changes will be lost.\nReally exit?"))
end

- (Object) runZoneTypeSwitch



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File '../../src/include/dns-server/dialogs.rb', line 62

def runZoneTypeSwitch
  type = Ops.get_string(@current_zone, "type", "master")
  name = Ops.get_string(@current_zone, "zone", "unknown")
  Builtins.y2milestone(
    "Editing zone %1 (%2), type %3",
    name,
    Punycode.DecodeDomainName(name),
    type
  )
  if type == "master"
    return :master
  elsif type == "slave"
    return :slave
  elsif type == "stub"
    return :stub
  elsif type == "forward"
    return :forward
  else
    # message popup
    Popup.Message(_("A zone of this type cannot be edited with this tool."))
    return :back
  end
end