21 QInputDialog, |
21 QInputDialog, |
22 QDialogButtonBox, |
22 QDialogButtonBox, |
23 QTreeWidgetItem, |
23 QTreeWidgetItem, |
24 ) |
24 ) |
25 |
25 |
26 from EricWidgets import EricMessageBox, EricFileDialog |
26 from eric7.EricWidgets import EricMessageBox, EricFileDialog |
27 from EricGui.EricOverrideCursor import EricOverrideCursor |
27 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor |
28 |
28 |
29 from .Ui_EmailDialog import Ui_EmailDialog |
29 from .Ui_EmailDialog import Ui_EmailDialog |
30 |
30 |
31 from .Info import BugAddress, FeatureAddress |
31 from .Info import BugAddress, FeatureAddress |
32 import Preferences |
32 from eric7 import Preferences, Utilities |
33 import Utilities |
|
34 |
33 |
35 from email.mime.text import MIMEText |
34 from email.mime.text import MIMEText |
36 from email.mime.image import MIMEImage |
35 from email.mime.image import MIMEImage |
37 from email.mime.audio import MIMEAudio |
36 from email.mime.audio import MIMEAudio |
38 from email.mime.application import MIMEApplication |
37 from email.mime.application import MIMEApplication |
158 """ |
157 """ |
159 Private slot to show some help text "how to turn on the Gmail API". |
158 Private slot to show some help text "how to turn on the Gmail API". |
160 """ |
159 """ |
161 if self.__helpDialog is None: |
160 if self.__helpDialog is None: |
162 try: |
161 try: |
163 from EricNetwork.EricGoogleMail import GoogleMailHelp |
162 from eric7.EricNetwork.EricGoogleMail import GoogleMailHelp |
164 |
163 |
165 helpStr = GoogleMailHelp() |
164 helpStr = GoogleMailHelp() |
166 except ImportError: |
165 except ImportError: |
167 from EricNetwork.EricGoogleMailHelpers import getInstallCommand |
166 from eric7.EricNetwork.EricGoogleMailHelpers import getInstallCommand |
168 |
167 |
169 helpStr = self.tr( |
168 helpStr = self.tr( |
170 "<p>The Google Mail Client API is not installed." |
169 "<p>The Google Mail Client API is not installed." |
171 " Use <code>{0}</code> to install it.</p>" |
170 " Use <code>{0}</code> to install it.</p>" |
172 ).format(getInstallCommand()) |
171 ).format(getInstallCommand()) |
173 |
172 |
174 from EricWidgets.EricSimpleHelpDialog import EricSimpleHelpDialog |
173 from eric7.EricWidgets.EricSimpleHelpDialog import EricSimpleHelpDialog |
175 |
174 |
176 self.__helpDialog = EricSimpleHelpDialog( |
175 self.__helpDialog = EricSimpleHelpDialog( |
177 title=self.tr("Gmail API Help"), helpStr=helpStr, parent=self |
176 title=self.tr("Gmail API Help"), helpStr=helpStr, parent=self |
178 ) |
177 ) |
179 |
178 |
409 Private method to actually send the message via Google Mail. |
408 Private method to actually send the message via Google Mail. |
410 |
409 |
411 @param msg email message to be sent |
410 @param msg email message to be sent |
412 @type email.mime.text.MIMEBase |
411 @type email.mime.text.MIMEBase |
413 """ |
412 """ |
414 from EricNetwork.EricGoogleMail import EricGoogleMail |
413 from eric7.EricNetwork.EricGoogleMail import EricGoogleMail |
415 |
414 |
416 if self.__googleMail is None: |
415 if self.__googleMail is None: |
417 self.__googleMail = EricGoogleMail(self) |
416 self.__googleMail = EricGoogleMail(self) |
418 self.__googleMail.sendResult.connect(self.__gmailSendResult) |
417 self.__googleMail.sendResult.connect(self.__gmailSendResult) |
419 |
418 |