161 try: |
161 try: |
162 from eric7.EricNetwork.EricGoogleMail import GoogleMailHelp |
162 from eric7.EricNetwork.EricGoogleMail import GoogleMailHelp |
163 |
163 |
164 helpStr = GoogleMailHelp() |
164 helpStr = GoogleMailHelp() |
165 except ImportError: |
165 except ImportError: |
166 from eric7.EricNetwork.EricGoogleMailHelpers import getInstallCommand |
|
167 |
|
168 helpStr = self.tr( |
166 helpStr = self.tr( |
169 "<p>The Google Mail Client API is not installed." |
167 "<p>The Google Mail Client API is not installed." |
170 " Use <code>{0}</code> to install it.</p>" |
168 " Change to the Email configuration page for more.</p>" |
171 ).format(getInstallCommand()) |
169 ) |
172 |
170 |
173 from eric7.EricWidgets.EricSimpleHelpDialog import EricSimpleHelpDialog |
171 from eric7.EricWidgets.EricSimpleHelpDialog import EricSimpleHelpDialog |
174 |
172 |
175 self.__helpDialog = EricSimpleHelpDialog( |
173 self.__helpDialog = EricSimpleHelpDialog( |
176 title=self.tr("Gmail API Help"), helpStr=helpStr, parent=self |
174 title=self.tr("Gmail API Help"), helpStr=helpStr, parent=self |
408 Private method to actually send the message via Google Mail. |
406 Private method to actually send the message via Google Mail. |
409 |
407 |
410 @param msg email message to be sent |
408 @param msg email message to be sent |
411 @type email.mime.text.MIMEBase |
409 @type email.mime.text.MIMEBase |
412 """ |
410 """ |
413 from eric7.EricNetwork.EricGoogleMail import EricGoogleMail |
411 try: |
414 |
412 from eric7.EricNetwork.EricGoogleMail import EricGoogleMail |
415 if self.__googleMail is None: |
413 |
416 self.__googleMail = EricGoogleMail(self) |
414 if self.__googleMail is None: |
417 self.__googleMail.sendResult.connect(self.__gmailSendResult) |
415 self.__googleMail = EricGoogleMail(self) |
418 |
416 self.__googleMail.sendResult.connect(self.__gmailSendResult) |
419 self.__googleMail.sendMessage(msg) |
417 |
|
418 self.__googleMail.sendMessage(msg) |
|
419 except ImportError: |
|
420 EricMessageBox.critical( |
|
421 self, |
|
422 self.tr("Send Message"), |
|
423 self.tr( |
|
424 "The Google Mail Client API is not installed. The message cannot be" |
|
425 " sent." |
|
426 ), |
|
427 ) |
420 |
428 |
421 @pyqtSlot(bool, str) |
429 @pyqtSlot(bool, str) |
422 def __gmailSendResult(self, ok, message): |
430 def __gmailSendResult(self, ok, message): |
423 """ |
431 """ |
424 Private slot handling the send result reported by the Google Mail |
432 Private slot handling the send result reported by the Google Mail |