UserInterface: fixed an issue introduced during the last changes.

Sun, 03 Jan 2021 18:02:19 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 03 Jan 2021 18:02:19 +0100
changeset 7948
6cbd0c086887
parent 7947
e609e65bbcfd
child 7949
17c0a4ec3cf0

UserInterface: fixed an issue introduced during the last changes.

eric6/UI/UserInterface.py file | annotate | diff | comparison | revisions
--- a/eric6/UI/UserInterface.py	Sun Jan 03 17:58:37 2021 +0100
+++ b/eric6/UI/UserInterface.py	Sun Jan 03 18:02:19 2021 +0100
@@ -7005,65 +7005,56 @@
         @param alternative index of server to download from (integer)
         @param showVersions flag indicating the show versions mode (boolean)
         """
-        if self.isOnline():
-            if not manual:
-                if VersionOnly.startswith("@@"):
+        if not manual:
+            if VersionOnly.startswith("@@"):
+                return
+            else:
+                period = Preferences.getUI("PerformVersionCheck")
+                if period == 0:
                     return
-                else:
-                    period = Preferences.getUI("PerformVersionCheck")
-                    if period == 0:
-                        return
-                    elif period in [2, 3, 4]:
-                        lastCheck = Preferences.Prefs.settings.value(
-                            "Updates/LastCheckDate", QDate(1970, 1, 1))
-                        if lastCheck.isValid():
-                            now = QDate.currentDate()
-                            if period == 2 and lastCheck.day() == now.day():
-                                # daily
-                                return
-                            elif period == 3 and lastCheck.daysTo(now) < 7:
-                                # weekly
-                                return
-                            elif period == 4 and (lastCheck.daysTo(now) <
-                                                  lastCheck.daysInMonth()):
-                                # monthly
-                                return
-            
-            self.__inVersionCheck = True
-            self.manualUpdatesCheck = manual
-            self.showAvailableVersions = showVersions
-            self.httpAlternative = alternative
-            url = QUrl(self.__httpAlternatives[alternative])
-            self.__versionCheckCanceled = False
-            if manual:
-                if self.__versionCheckProgress is None:
-                    self.__versionCheckProgress = E5ProgressDialog(
-                        "", self.tr("&Cancel"),
-                        0, len(self.__httpAlternatives),
-                        self.tr("%v/%m"), self)
-                    self.__versionCheckProgress.setWindowTitle(
-                        self.tr("Version Check"))
-                    self.__versionCheckProgress.setMinimumDuration(0)
-                    self.__versionCheckProgress.canceled.connect(
-                        self.__versionsDownloadCanceled)
-                self.__versionCheckProgress.setLabelText(
-                    self.tr("Trying host {0}").format(url.host()))
-                self.__versionCheckProgress.setValue(alternative)
-            request = QNetworkRequest(url)
-            request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
-                                 QNetworkRequest.AlwaysNetwork)
-            reply = self.__networkManager.get(request)
-            reply.finished.connect(lambda: self.__versionsDownloadDone(reply))
-            self.__replies.append(reply)
-        else:
-            if manual:
-                E5MessageBox.warning(
-                    self,
-                    self.tr("Error getting versions information"),
-                    self.tr("""The versions information cannot not be"""
-                            """ downloaded because you are <b>offline</b>."""
-                            """ Please go online and try again."""))
-        
+                elif period in [2, 3, 4]:
+                    lastCheck = Preferences.Prefs.settings.value(
+                        "Updates/LastCheckDate", QDate(1970, 1, 1))
+                    if lastCheck.isValid():
+                        now = QDate.currentDate()
+                        if period == 2 and lastCheck.day() == now.day():
+                            # daily
+                            return
+                        elif period == 3 and lastCheck.daysTo(now) < 7:
+                            # weekly
+                            return
+                        elif period == 4 and (lastCheck.daysTo(now) <
+                                              lastCheck.daysInMonth()):
+                            # monthly
+                            return
+        
+        self.__inVersionCheck = True
+        self.manualUpdatesCheck = manual
+        self.showAvailableVersions = showVersions
+        self.httpAlternative = alternative
+        url = QUrl(self.__httpAlternatives[alternative])
+        self.__versionCheckCanceled = False
+        if manual:
+            if self.__versionCheckProgress is None:
+                self.__versionCheckProgress = E5ProgressDialog(
+                    "", self.tr("&Cancel"),
+                    0, len(self.__httpAlternatives),
+                    self.tr("%v/%m"), self)
+                self.__versionCheckProgress.setWindowTitle(
+                    self.tr("Version Check"))
+                self.__versionCheckProgress.setMinimumDuration(0)
+                self.__versionCheckProgress.canceled.connect(
+                    self.__versionsDownloadCanceled)
+            self.__versionCheckProgress.setLabelText(
+                self.tr("Trying host {0}").format(url.host()))
+            self.__versionCheckProgress.setValue(alternative)
+        request = QNetworkRequest(url)
+        request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
+                             QNetworkRequest.AlwaysNetwork)
+        reply = self.__networkManager.get(request)
+        reply.finished.connect(lambda: self.__versionsDownloadDone(reply))
+        self.__replies.append(reply)
+    
     @pyqtSlot()
     def __versionsDownloadDone(self, reply):
         """

eric ide

mercurial