12 import os |
12 import os |
13 import mimetypes |
13 import mimetypes |
14 import smtplib |
14 import smtplib |
15 import socket |
15 import socket |
16 |
16 |
17 from PyQt5.QtCore import Qt, pyqtSlot, qVersion |
17 from PyQt5.QtCore import Qt, pyqtSlot |
18 from PyQt5.QtGui import QCursor |
18 from PyQt5.QtGui import QCursor |
19 from PyQt5.QtWidgets import QHeaderView, QLineEdit, QDialog, QInputDialog, \ |
19 from PyQt5.QtWidgets import QHeaderView, QLineEdit, QDialog, QInputDialog, \ |
20 QApplication, QDialogButtonBox, QTreeWidgetItem |
20 QApplication, QDialogButtonBox, QTreeWidgetItem |
21 |
21 |
22 from E5Gui import E5MessageBox, E5FileDialog |
22 from E5Gui import E5MessageBox, E5FileDialog |
33 from email.mime.image import MIMEImage |
33 from email.mime.image import MIMEImage |
34 from email.mime.audio import MIMEAudio |
34 from email.mime.audio import MIMEAudio |
35 from email.mime.application import MIMEApplication |
35 from email.mime.application import MIMEApplication |
36 from email.mime.multipart import MIMEMultipart |
36 from email.mime.multipart import MIMEMultipart |
37 from email.header import Header |
37 from email.header import Header |
|
38 |
|
39 from Globals import qVersionTuple |
38 |
40 |
39 |
41 |
40 ############################################################ |
42 ############################################################ |
41 ## This code is to work around a bug in the Python email ## |
43 ## This code is to work around a bug in the Python email ## |
42 ## package for Image and Audio mime messages. ## |
44 ## package for Image and Audio mime messages. ## |
97 height = self.height() |
99 height = self.height() |
98 self.mainSplitter.setSizes([int(0.7 * height), int(0.3 * height)]) |
100 self.mainSplitter.setSizes([int(0.7 * height), int(0.3 * height)]) |
99 |
101 |
100 self.attachments.headerItem().setText( |
102 self.attachments.headerItem().setText( |
101 self.attachments.columnCount(), "") |
103 self.attachments.columnCount(), "") |
102 if qVersion() >= "5.0.0": |
104 if qVersionTuple() >= (5, 0, 0): |
103 self.attachments.header().setSectionResizeMode( |
105 self.attachments.header().setSectionResizeMode( |
104 QHeaderView.Interactive) |
106 QHeaderView.Interactive) |
105 else: |
107 else: |
106 self.attachments.header().setResizeMode(QHeaderView.Interactive) |
108 self.attachments.header().setResizeMode(QHeaderView.Interactive) |
107 |
109 |