Module: Yast::MailMailServerComplexInclude

Defined in:
../../src/include/mail/mail-server_complex.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) initialize_mail_mail_server_complex(include_target)



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File '../../src/include/mail/mail-server_complex.rb', line 11

def initialize_mail_mail_server_complex(include_target)
  Yast.import "UI"

  textdomain "mail"

  Yast.import "Label"
  Yast.import "Popup"
  Yast.import "Wizard"
  Yast.import "MailServer"
  Yast.import "Progress"

  Yast.include include_target, "mail/mail-server_helps.rb"
  Yast.include include_target, "mail/mail-server_dialogs.rb"
end

- (Object) Modified

Return a modification status

Returns:

  • true if data was modified



28
29
30
# File '../../src/include/mail/mail-server_complex.rb', line 28

def Modified
  MailServer.Modified
end

- (Object) PollAbort



32
33
34
# File '../../src/include/mail/mail-server_complex.rb', line 32

def PollAbort
  UI.PollInput == :abort
end

- (Object) ReadDialog

Read settings dialog

Returns:

  • abort if aborted andnext otherwise



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File '../../src/include/mail/mail-server_complex.rb', line 89

def ReadDialog
  #    after merging yast2-mail and yast2-mail-server we have to be
  #    carefull not to corrupt the configuration of the other modul
  if !MailServer.setup &&
      SCR.Read(path(".sysconfig.mail.MAIL_CREATE_CONFIG")) == "yes"
    if !Popup.AnyQuestionRichText(
        Label.WarningMsg,
        _("You have configured your MTA without LDAP support.<br>") +
          _("This modul will configure your MTA with LDAP support.<br>") +
          _("This will corrupt your current configuration."),
        80,
        10,
        Label.ContinueButton,
        Label.CancelButton,
        :focus_no
      )
      return :abort
    end
  end

  Wizard.RestoreHelp(Ops.get_string(@HELPS, "read", ""))
  ret = MailServer.Read
  ret ? :next : :abort
end

- (Object) SetupDialog

Read settings dialog

Returns:

  • abort if aborted andnext otherwise



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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File '../../src/include/mail/mail-server_complex.rb', line 38

def SetupDialog
  Wizard.RestoreHelp(Ops.get_string(@HELPS, "setup", ""))
  caption = _("Set up the mail server")
  steps = 3
  sl = 3

  Builtins.y2milestone("----- Start MailServer::Setup -----")

  # We do not set help text here, because it was set outside
  Progress.New(
    caption,
    "",
    steps,
    [
      # Progress stage 0/3
      _("Read needed packages"),
      # Progress stage 1/3
      _("Read LDAP settings"),
      # Progress stage 2/3
      _("Choose LDAP and CA settings"),
      # Progress stage 3/3
      _("Configure LDAP server and CA management")
    ],
    [
      # Progress stage 0/7
      _("Reading packages..."),
      # Progress stage 1/3
      _("Reading LDAP settings..."),
      # Progress stage 2/3
      _("Choosing LDAP and CA settings..."),
      # Progress stage 3/3
      _("Configuring LDAP server and CA management..."),
      # Progress finished
      _("Finished")
    ],
    ""
  )

  # read  packages
  Progress.NextStage
  return :abort if !MailServer.CheckPackages
  Builtins.sleep(sl)
  # read  packages
  Progress.NextStage
  return :abort if CheckLDAPDialog() != :ok
  Builtins.sleep(sl)
  :next
end

- (Object) WriteDialog

Write settings dialog

Returns:

  • abort if aborted andnext otherwise



116
117
118
119
120
121
122
# File '../../src/include/mail/mail-server_complex.rb', line 116

def WriteDialog
  Wizard.CreateDialog
  Wizard.SetDesktopIcon("mail")
  Wizard.RestoreHelp(Ops.get_string(@HELPS, "write", ""))
  ret = MailServer.Write
  ret ? :next : :abort
end