|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2018 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to enter the data for the 'sendtestemail' command. |
|
8 """ |
|
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 from PyQt5.QtWidgets import QDialog |
|
13 |
|
14 from .Ui_DjangoSendTestEmailDataDialog import Ui_DjangoSendTestEmailDataDialog |
|
15 |
|
16 |
|
17 class DjangoSendTestEmailDataDialog(QDialog, Ui_DjangoSendTestEmailDataDialog): |
|
18 """ |
|
19 Class implementing a dialog to enter the data for the 'sendtestemail' |
|
20 command. |
|
21 """ |
|
22 def __init__(self, parent=None): |
|
23 """ |
|
24 Constructor |
|
25 |
|
26 @param parent reference to the parent widget |
|
27 @type QWidget |
|
28 """ |
|
29 super(DjangoSendTestEmailDataDialog, self).__init__(parent) |
|
30 self.setupUi(self) |
|
31 |
|
32 def getData(self): |
|
33 """ |
|
34 Public method to get the dialog data. |
|
35 |
|
36 @return tuple containing a flag indicating to send to the defined |
|
37 managers, a flag indicating to send to the defined administrators |
|
38 and a list of recipients |
|
39 @rtype tuple of (bool, bool, list of str) |
|
40 """ |
|
41 recipientsStr = self.recipientsEdit.toPlainText() |
|
42 recipients = [r.strip() |
|
43 for r in recipientsStr.splitlines() |
|
44 if r.strip()] |
|
45 |
|
46 return ( |
|
47 self.managersCheckBox.isChecked(), |
|
48 self.adminsCheckBox.isChecked(), |
|
49 recipients, |
|
50 ) |