EmailPage: improved explanatory strings and fixed an issue introduced by the last change.

Sat, 27 Oct 2018 11:53:33 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Oct 2018 11:53:33 +0200
changeset 6560
12bf4c8aa165
parent 6559
1265efa7364f
child 6561
ca224a174b4f

EmailPage: improved explanatory strings and fixed an issue introduced by the last change.

Preferences/ConfigurationPages/EmailPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EmailPage.ui file | annotate | diff | comparison | revisions
--- a/Preferences/ConfigurationPages/EmailPage.py	Thu Oct 25 20:06:44 2018 +0200
+++ b/Preferences/ConfigurationPages/EmailPage.py	Sat Oct 27 11:53:33 2018 +0200
@@ -43,6 +43,16 @@
             import googleapiclient      # __IGNORE_WARNING__
             self.googleMailCheckBox.setChecked(
                 Preferences.getUser("UseGoogleMailOAuth2"))
+            
+            from E5Network.E5GoogleMail import isCredentialsFileAvailable
+            if not isCredentialsFileAvailable():
+                # credentials file is not installed
+                self.googleMailCheckBox.setChecked(False)
+                self.googleMailCheckBox.setEnabled(False)
+                self.googleMailInfoLabel.setText(self.tr(
+                    "<p>The credentials file is not present. Has the Gmail API"
+                    " been enabled?</p>"))
+                Preferences.setUser("UseGoogleMailOAuth2", False)
         except ImportError:
             # missing libraries, disable Google Mail
             self.googleMailCheckBox.setChecked(False)
@@ -54,16 +64,6 @@
             self.googleHelpButton.setEnabled(False)
             Preferences.setUser("UseGoogleMailOAuth2", False)
         
-        from E5Network.E5GoogleMail import isCredentialsFileAvailable
-        if not isCredentialsFileAvailable():
-            # credentials file is not installed
-            self.googleMailCheckBox.setChecked(False)
-            self.googleMailCheckBox.setEnabled(False)
-            self.googleMailInfoLabel.setText(self.tr(
-                "<p>The credentials file is not present. Has the Gmail API"
-                " been enabled?</p>"))
-            Preferences.setUser("UseGoogleMailOAuth2", False)
-        
         self.mailServerEdit.setText(Preferences.getUser("MailServer"))
         self.portSpin.setValue(Preferences.getUser("MailServerPort"))
         self.emailEdit.setText(Preferences.getUser("Email"))
--- a/Preferences/ConfigurationPages/EmailPage.ui	Thu Oct 25 20:06:44 2018 +0200
+++ b/Preferences/ConfigurationPages/EmailPage.ui	Sat Oct 27 11:53:33 2018 +0200
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>451</width>
-    <height>782</height>
+    <width>450</width>
+    <height>500</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_3">
@@ -40,14 +40,14 @@
       <item>
        <widget class="QCheckBox" name="googleMailCheckBox">
         <property name="text">
-         <string>Use Google Mail with OAuth2 authentication</string>
+         <string>Use Google Mail with OAuth2 authentication via Gmail API</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QLabel" name="googleMailInfoLabel">
         <property name="text">
-         <string>&lt;b&gt;Note:&lt;/b&gt; Google Mail using SMTP should be configured below.</string>
+         <string>&lt;b&gt;Note:&lt;/b&gt; Google Mail using plain SMTP should be configured below.</string>
         </property>
         <property name="wordWrap">
          <bool>true</bool>

eric ide

mercurial