|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.UI.EmailDialog</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.UI.EmailDialog</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a dialog to send bug reports or feature requests. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#EmailDialog">EmailDialog</a></td> |
|
25 <td>Class implementing a dialog to send bug reports or feature requests.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="EmailDialog" ID="EmailDialog"></a> |
|
36 <h2>EmailDialog</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a dialog to send bug reports or feature requests. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 QDialog, Ui_EmailDialog |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#EmailDialog.__init__">EmailDialog</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#EmailDialog.__createMultipartMail">__createMultipartMail</a></td> |
|
63 <td>Private method to create a multipart mail message.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#EmailDialog.__createSimpleMail">__createSimpleMail</a></td> |
|
67 <td>Private method to create a simple mail message.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#EmailDialog.__deleteAttachedFiles">__deleteAttachedFiles</a></td> |
|
71 <td>Private method to delete attached files.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#EmailDialog.__encodedHeader">__encodedHeader</a></td> |
|
75 <td>Private method to create a correctly encoded mail header.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#EmailDialog.__encodedText">__encodedText</a></td> |
|
79 <td>Private method to create a MIMEText message with correct encoding.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#EmailDialog.__gmailSendResult">__gmailSendResult</a></td> |
|
83 <td>Private slot handling the send result reported by the Google Mail interface.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#EmailDialog.__sendmail">__sendmail</a></td> |
|
87 <td>Private method to actually send the message.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#EmailDialog.__sendmailGoogle">__sendmailGoogle</a></td> |
|
91 <td>Private method to actually send the message via Google Mail.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#EmailDialog.attachFile">attachFile</a></td> |
|
95 <td>Public method to add an attachment.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#EmailDialog.keyPressEvent">keyPressEvent</a></td> |
|
99 <td>Protected method to handle the user pressing the escape key.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#EmailDialog.on_addButton_clicked">on_addButton_clicked</a></td> |
|
103 <td>Private slot to handle the Add...</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#EmailDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
107 <td>Private slot called by a button of the button box clicked.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#EmailDialog.on_buttonBox_rejected">on_buttonBox_rejected</a></td> |
|
111 <td>Private slot to handle the rejected signal of the button box.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#EmailDialog.on_deleteButton_clicked">on_deleteButton_clicked</a></td> |
|
115 <td>Private slot to handle the Delete button.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#EmailDialog.on_googleHelpButton_clicked">on_googleHelpButton_clicked</a></td> |
|
119 <td>Private slot to show some help text "how to turn on the Gmail API".</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#EmailDialog.on_message_textChanged">on_message_textChanged</a></td> |
|
123 <td>Private slot to handle the textChanged signal of the message edit.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#EmailDialog.on_sendButton_clicked">on_sendButton_clicked</a></td> |
|
127 <td>Private slot to send the email message.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#EmailDialog.on_subject_textChanged">on_subject_textChanged</a></td> |
|
131 <td>Private slot to handle the textChanged signal of the subject edit.</td> |
|
132 </tr> |
|
133 </table> |
|
134 <h3>Static Methods</h3> |
|
135 |
|
136 <table> |
|
137 <tr><td>None</td></tr> |
|
138 </table> |
|
139 |
|
140 <a NAME="EmailDialog.__init__" ID="EmailDialog.__init__"></a> |
|
141 <h4>EmailDialog (Constructor)</h4> |
|
142 <b>EmailDialog</b>(<i>mode="bug", parent=None</i>) |
|
143 |
|
144 <p> |
|
145 Constructor |
|
146 </p> |
|
147 <dl> |
|
148 |
|
149 <dt><i>mode</i></dt> |
|
150 <dd> |
|
151 mode of this dialog (string, "bug" or "feature") |
|
152 </dd> |
|
153 <dt><i>parent</i></dt> |
|
154 <dd> |
|
155 parent widget of this dialog (QWidget) |
|
156 </dd> |
|
157 </dl> |
|
158 <a NAME="EmailDialog.__createMultipartMail" ID="EmailDialog.__createMultipartMail"></a> |
|
159 <h4>EmailDialog.__createMultipartMail</h4> |
|
160 <b>__createMultipartMail</b>(<i></i>) |
|
161 |
|
162 <p> |
|
163 Private method to create a multipart mail message. |
|
164 </p> |
|
165 <dl> |
|
166 <dt>Return:</dt> |
|
167 <dd> |
|
168 prepared mail message |
|
169 </dd> |
|
170 </dl> |
|
171 <dl> |
|
172 <dt>Return Type:</dt> |
|
173 <dd> |
|
174 email.mime.text.MIMEMultipart |
|
175 </dd> |
|
176 </dl> |
|
177 <a NAME="EmailDialog.__createSimpleMail" ID="EmailDialog.__createSimpleMail"></a> |
|
178 <h4>EmailDialog.__createSimpleMail</h4> |
|
179 <b>__createSimpleMail</b>(<i></i>) |
|
180 |
|
181 <p> |
|
182 Private method to create a simple mail message. |
|
183 </p> |
|
184 <dl> |
|
185 <dt>Return:</dt> |
|
186 <dd> |
|
187 prepared mail message |
|
188 </dd> |
|
189 </dl> |
|
190 <dl> |
|
191 <dt>Return Type:</dt> |
|
192 <dd> |
|
193 email.mime.text.MIMEText |
|
194 </dd> |
|
195 </dl> |
|
196 <a NAME="EmailDialog.__deleteAttachedFiles" ID="EmailDialog.__deleteAttachedFiles"></a> |
|
197 <h4>EmailDialog.__deleteAttachedFiles</h4> |
|
198 <b>__deleteAttachedFiles</b>(<i></i>) |
|
199 |
|
200 <p> |
|
201 Private method to delete attached files. |
|
202 </p> |
|
203 <a NAME="EmailDialog.__encodedHeader" ID="EmailDialog.__encodedHeader"></a> |
|
204 <h4>EmailDialog.__encodedHeader</h4> |
|
205 <b>__encodedHeader</b>(<i>txt</i>) |
|
206 |
|
207 <p> |
|
208 Private method to create a correctly encoded mail header. |
|
209 </p> |
|
210 <dl> |
|
211 |
|
212 <dt><i>txt</i></dt> |
|
213 <dd> |
|
214 header text to encode (string) |
|
215 </dd> |
|
216 </dl> |
|
217 <dl> |
|
218 <dt>Return:</dt> |
|
219 <dd> |
|
220 encoded header (email.header.Header) |
|
221 </dd> |
|
222 </dl> |
|
223 <a NAME="EmailDialog.__encodedText" ID="EmailDialog.__encodedText"></a> |
|
224 <h4>EmailDialog.__encodedText</h4> |
|
225 <b>__encodedText</b>(<i>txt</i>) |
|
226 |
|
227 <p> |
|
228 Private method to create a MIMEText message with correct encoding. |
|
229 </p> |
|
230 <dl> |
|
231 |
|
232 <dt><i>txt</i></dt> |
|
233 <dd> |
|
234 text to be put into the MIMEText object (string) |
|
235 </dd> |
|
236 </dl> |
|
237 <dl> |
|
238 <dt>Return:</dt> |
|
239 <dd> |
|
240 MIMEText object |
|
241 </dd> |
|
242 </dl> |
|
243 <a NAME="EmailDialog.__gmailSendResult" ID="EmailDialog.__gmailSendResult"></a> |
|
244 <h4>EmailDialog.__gmailSendResult</h4> |
|
245 <b>__gmailSendResult</b>(<i>ok, message</i>) |
|
246 |
|
247 <p> |
|
248 Private slot handling the send result reported by the Google Mail |
|
249 interface. |
|
250 </p> |
|
251 <dl> |
|
252 |
|
253 <dt><i>ok</i> (bool)</dt> |
|
254 <dd> |
|
255 flag indicating success |
|
256 </dd> |
|
257 <dt><i>message</i> (str)</dt> |
|
258 <dd> |
|
259 message from the interface |
|
260 </dd> |
|
261 </dl> |
|
262 <a NAME="EmailDialog.__sendmail" ID="EmailDialog.__sendmail"></a> |
|
263 <h4>EmailDialog.__sendmail</h4> |
|
264 <b>__sendmail</b>(<i>msg</i>) |
|
265 |
|
266 <p> |
|
267 Private method to actually send the message. |
|
268 </p> |
|
269 <dl> |
|
270 |
|
271 <dt><i>msg</i></dt> |
|
272 <dd> |
|
273 the message to be sent (string) |
|
274 </dd> |
|
275 </dl> |
|
276 <dl> |
|
277 <dt>Return:</dt> |
|
278 <dd> |
|
279 flag indicating success (boolean) |
|
280 </dd> |
|
281 </dl> |
|
282 <a NAME="EmailDialog.__sendmailGoogle" ID="EmailDialog.__sendmailGoogle"></a> |
|
283 <h4>EmailDialog.__sendmailGoogle</h4> |
|
284 <b>__sendmailGoogle</b>(<i>msg</i>) |
|
285 |
|
286 <p> |
|
287 Private method to actually send the message via Google Mail. |
|
288 </p> |
|
289 <dl> |
|
290 |
|
291 <dt><i>msg</i> (email.mime.text.MIMEBase)</dt> |
|
292 <dd> |
|
293 email message to be sent |
|
294 </dd> |
|
295 </dl> |
|
296 <a NAME="EmailDialog.attachFile" ID="EmailDialog.attachFile"></a> |
|
297 <h4>EmailDialog.attachFile</h4> |
|
298 <b>attachFile</b>(<i>fname, deleteFile</i>) |
|
299 |
|
300 <p> |
|
301 Public method to add an attachment. |
|
302 </p> |
|
303 <dl> |
|
304 |
|
305 <dt><i>fname</i></dt> |
|
306 <dd> |
|
307 name of the file to be attached (string) |
|
308 </dd> |
|
309 <dt><i>deleteFile</i></dt> |
|
310 <dd> |
|
311 flag indicating to delete the file after it has |
|
312 been sent (boolean) |
|
313 </dd> |
|
314 </dl> |
|
315 <a NAME="EmailDialog.keyPressEvent" ID="EmailDialog.keyPressEvent"></a> |
|
316 <h4>EmailDialog.keyPressEvent</h4> |
|
317 <b>keyPressEvent</b>(<i>ev</i>) |
|
318 |
|
319 <p> |
|
320 Protected method to handle the user pressing the escape key. |
|
321 </p> |
|
322 <dl> |
|
323 |
|
324 <dt><i>ev</i></dt> |
|
325 <dd> |
|
326 key event (QKeyEvent) |
|
327 </dd> |
|
328 </dl> |
|
329 <a NAME="EmailDialog.on_addButton_clicked" ID="EmailDialog.on_addButton_clicked"></a> |
|
330 <h4>EmailDialog.on_addButton_clicked</h4> |
|
331 <b>on_addButton_clicked</b>(<i></i>) |
|
332 |
|
333 <p> |
|
334 Private slot to handle the Add... button. |
|
335 </p> |
|
336 <a NAME="EmailDialog.on_buttonBox_clicked" ID="EmailDialog.on_buttonBox_clicked"></a> |
|
337 <h4>EmailDialog.on_buttonBox_clicked</h4> |
|
338 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
339 |
|
340 <p> |
|
341 Private slot called by a button of the button box clicked. |
|
342 </p> |
|
343 <dl> |
|
344 |
|
345 <dt><i>button</i></dt> |
|
346 <dd> |
|
347 button that was clicked (QAbstractButton) |
|
348 </dd> |
|
349 </dl> |
|
350 <a NAME="EmailDialog.on_buttonBox_rejected" ID="EmailDialog.on_buttonBox_rejected"></a> |
|
351 <h4>EmailDialog.on_buttonBox_rejected</h4> |
|
352 <b>on_buttonBox_rejected</b>(<i></i>) |
|
353 |
|
354 <p> |
|
355 Private slot to handle the rejected signal of the button box. |
|
356 </p> |
|
357 <a NAME="EmailDialog.on_deleteButton_clicked" ID="EmailDialog.on_deleteButton_clicked"></a> |
|
358 <h4>EmailDialog.on_deleteButton_clicked</h4> |
|
359 <b>on_deleteButton_clicked</b>(<i></i>) |
|
360 |
|
361 <p> |
|
362 Private slot to handle the Delete button. |
|
363 </p> |
|
364 <a NAME="EmailDialog.on_googleHelpButton_clicked" ID="EmailDialog.on_googleHelpButton_clicked"></a> |
|
365 <h4>EmailDialog.on_googleHelpButton_clicked</h4> |
|
366 <b>on_googleHelpButton_clicked</b>(<i></i>) |
|
367 |
|
368 <p> |
|
369 Private slot to show some help text "how to turn on the Gmail API". |
|
370 </p> |
|
371 <a NAME="EmailDialog.on_message_textChanged" ID="EmailDialog.on_message_textChanged"></a> |
|
372 <h4>EmailDialog.on_message_textChanged</h4> |
|
373 <b>on_message_textChanged</b>(<i></i>) |
|
374 |
|
375 <p> |
|
376 Private slot to handle the textChanged signal of the message edit. |
|
377 </p> |
|
378 <a NAME="EmailDialog.on_sendButton_clicked" ID="EmailDialog.on_sendButton_clicked"></a> |
|
379 <h4>EmailDialog.on_sendButton_clicked</h4> |
|
380 <b>on_sendButton_clicked</b>(<i></i>) |
|
381 |
|
382 <p> |
|
383 Private slot to send the email message. |
|
384 </p> |
|
385 <a NAME="EmailDialog.on_subject_textChanged" ID="EmailDialog.on_subject_textChanged"></a> |
|
386 <h4>EmailDialog.on_subject_textChanged</h4> |
|
387 <b>on_subject_textChanged</b>(<i>txt</i>) |
|
388 |
|
389 <p> |
|
390 Private slot to handle the textChanged signal of the subject edit. |
|
391 </p> |
|
392 <dl> |
|
393 |
|
394 <dt><i>txt</i></dt> |
|
395 <dd> |
|
396 changed text (string) |
|
397 </dd> |
|
398 </dl> |
|
399 <div align="right"><a href="#top">Up</a></div> |
|
400 <hr /> |
|
401 </body></html> |