eric6/UI/UserInterface.py

branch
maintenance
changeset 8043
0acf98cd089a
parent 7939
0fc1df79965d
parent 7973
e836d196e888
child 8142
43248bafe9b2
diff -r 866adc8c315b -r 0acf98cd089a eric6/UI/UserInterface.py
--- a/eric6/UI/UserInterface.py	Sun Jan 17 13:53:08 2021 +0100
+++ b/eric6/UI/UserInterface.py	Mon Feb 01 10:38:16 2021 +0100
@@ -33,6 +33,7 @@
 
 from .Info import Version, VersionOnly, BugAddress, Program, FeatureAddress
 from . import Config
+from .NotificationWidget import NotificationTypes
 
 from E5Gui.E5SingleApplication import E5SingleApplicationServer
 from E5Gui.E5Action import E5Action, createActionGroup
@@ -50,7 +51,6 @@
 
 import UI.PixmapCache
 
-from E5Network.E5NetworkIcon import E5NetworkIcon
 from E5Network.E5NetworkProxyFactory import (
     E5NetworkProxyFactory, proxyAuthenticationRequired
 )
@@ -137,8 +137,6 @@
         name of the menu and a reference to the menu are given.
     @signal masterPasswordChanged(str, str) emitted after the master
         password has been changed with the old and the new password
-    @signal onlineStateChanged(online) emitted to indicate a change of the
-        network state
     """
     appendStderr = pyqtSignal(str)
     appendStdout = pyqtSignal(str)
@@ -146,7 +144,6 @@
     reloadAPIs = pyqtSignal()
     showMenu = pyqtSignal(str, QMenu)
     masterPasswordChanged = pyqtSignal(str, str)
-    onlineStateChanged = pyqtSignal(bool)
     
     maxFilePathLen = 100
     maxMenuFilePathLen = 75
@@ -432,10 +429,6 @@
         self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI)
         self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI)
         self.debuggerUI.resetUI.connect(self.__debuggingDone)
-        self.debuggerUI.debuggingStarted.connect(
-            self.debugViewer.exceptionLogger.debuggingStarted)
-        self.debuggerUI.debuggingStarted.connect(
-            self.debugViewer.handleDebuggingStarted)
         self.debuggerUI.debuggingStarted.connect(self.__programChange)
         self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted)
         self.debuggerUI.compileForms.connect(
@@ -445,14 +438,6 @@
         self.debuggerUI.executeMake.connect(self.project.executeMake)
         self.debuggerUI.appendStdout.connect(self.appendToStdout)
         
-        debugServer.passiveDebugStarted.connect(
-            self.debugViewer.exceptionLogger.debuggingStarted)
-        debugServer.passiveDebugStarted.connect(
-            self.debugViewer.handleDebuggingStarted)
-        debugServer.clientException.connect(
-            self.debugViewer.exceptionLogger.addException)
-        debugServer.clientLine.connect(
-            self.debugViewer.breakpointViewer.highlightBreakpoint)
         debugServer.clientDisassembly.connect(
             self.debugViewer.disassemblyViewer.showDisassembly)
         debugServer.clientProcessStdout.connect(self.appendToStdout)
@@ -1700,10 +1685,10 @@
             QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
             0, self, 'new_window')
         self.newWindowAct.setStatusTip(self.tr(
-            'Open a new eric6 instance'))
+            'Open a new eric instance'))
         self.newWindowAct.setWhatsThis(self.tr(
             """<b>New Window</b>"""
-            """<p>This opens a new instance of the eric6 IDE.</p>"""
+            """<p>This opens a new instance of the eric IDE.</p>"""
         ))
         self.newWindowAct.triggered.connect(self.__newWindow)
         self.actions.append(self.newWindowAct)
@@ -2146,7 +2131,7 @@
             'Open the helpviewer window'))
         self.helpviewerAct.setWhatsThis(self.tr(
             """<b>Helpviewer</b>"""
-            """<p>Display the eric6 web browser. This window will show"""
+            """<p>Display the eric web browser. This window will show"""
             """ HTML help files and help from Qt help collections. It"""
             """ has the capability to navigate to links, set bookmarks,"""
             """ print the displayed help and some more features. You may"""
@@ -2181,7 +2166,7 @@
         self.checkUpdateAct.setStatusTip(self.tr('Check for Updates'))
         self.checkUpdateAct.setWhatsThis(self.tr(
             """<b>Check for Updates...</b>"""
-            """<p>Checks the internet for updates of eric6.</p>"""
+            """<p>Checks the internet for updates of eric.</p>"""
         ))
         self.checkUpdateAct.triggered.connect(self.performVersionCheck)
         self.actions.append(self.checkUpdateAct)
@@ -2194,7 +2179,7 @@
             self.tr('Show the versions available for download'))
         self.showVersionsAct.setWhatsThis(self.tr(
             """<b>Show downloadable versions...</b>"""
-            """<p>Shows the eric6 versions available for download """
+            """<p>Shows the eric versions available for download """
             """from the internet.</p>"""
         ))
         self.showVersionsAct.triggered.connect(
@@ -2467,30 +2452,28 @@
             self.tr('&Hex Editor...'),
             0, 0, self, 'hex_editor')
         self.hexEditorAct.setStatusTip(self.tr(
-            'Start the eric6 Hex Editor'))
+            'Start the eric Hex Editor'))
         self.hexEditorAct.setWhatsThis(self.tr(
             """<b>Hex Editor</b>"""
-            """<p>Starts the eric6 Hex Editor for viewing or editing"""
+            """<p>Starts the eric Hex Editor for viewing or editing"""
             """ binary files.</p>"""
         ))
         self.hexEditorAct.triggered.connect(self.__openHexEditor)
         self.actions.append(self.hexEditorAct)
 
         self.webBrowserAct = E5Action(
-            self.tr('eric6 Web Browser'),
+            self.tr('eric Web Browser'),
             UI.PixmapCache.getIcon("ericWeb"),
-            self.tr('eric6 &Web Browser...'),
+            self.tr('eric &Web Browser...'),
             0, 0, self, 'web_browser')
         self.webBrowserAct.setStatusTip(self.tr(
-            'Start the eric6 Web Browser'))
+            'Start the eric Web Browser'))
         self.webBrowserAct.setWhatsThis(self.tr(
-            """<b>eric6 Web Browser</b>"""
-            """<p>Browse the Internet with the eric6 Web Browser.</p>"""
+            """<b>eric Web Browser</b>"""
+            """<p>Browse the Internet with the eric Web Browser.</p>"""
         ))
         self.webBrowserAct.triggered.connect(self.__startWebBrowser)
         self.actions.append(self.webBrowserAct)
-##        else:
-##            self.webBrowserAct = None
 
         self.iconEditorAct = E5Action(
             self.tr('Icon Editor'),
@@ -2498,10 +2481,10 @@
             self.tr('&Icon Editor...'),
             0, 0, self, 'icon_editor')
         self.iconEditorAct.setStatusTip(self.tr(
-            'Start the eric6 Icon Editor'))
+            'Start the eric Icon Editor'))
         self.iconEditorAct.setWhatsThis(self.tr(
             """<b>Icon Editor</b>"""
-            """<p>Starts the eric6 Icon Editor for editing simple icons.</p>"""
+            """<p>Starts the eric Icon Editor for editing simple icons.</p>"""
         ))
         self.iconEditorAct.triggered.connect(self.__editPixmap)
         self.actions.append(self.iconEditorAct)
@@ -2588,7 +2571,7 @@
         self.showExternalToolsAct.setWhatsThis(self.tr(
             """<b>Show external tools</b>"""
             """<p>Opens a dialog to show the path and versions of all"""
-            """ extenal tools used by eric6.</p>"""
+            """ extenal tools used by eric.</p>"""
         ))
         self.showExternalToolsAct.triggered.connect(
             self.__showExternalTools)
@@ -2864,7 +2847,7 @@
         """
         self.qt5DocAct = E5Action(
             self.tr('Qt5 Documentation'),
-            self.tr('Qt&5 Documentation'),
+            self.tr('Qt5 Documentation'),
             0, 0, self, 'qt5_documentation')
         self.qt5DocAct.setStatusTip(self.tr('Open Qt5 Documentation'))
         self.qt5DocAct.setWhatsThis(self.tr(
@@ -2874,12 +2857,27 @@
             """ help viewer/web browser, or execute a web browser or Qt"""
             """ Assistant. </p>"""
         ))
-        self.qt5DocAct.triggered.connect(self.__showQt5Doc)
+        self.qt5DocAct.triggered.connect(lambda: self.__showQtDoc(5))
         self.actions.append(self.qt5DocAct)
       
+        self.qt6DocAct = E5Action(
+            self.tr('Qt6 Documentation'),
+            self.tr('Qt6 Documentation'),
+            0, 0, self, 'qt6_documentation')
+        self.qt6DocAct.setStatusTip(self.tr('Open Qt6 Documentation'))
+        self.qt6DocAct.setWhatsThis(self.tr(
+            """<b>Qt6 Documentation</b>"""
+            """<p>Display the Qt6 Documentation. Dependent upon your"""
+            """ settings, this will either show the help in Eric's internal"""
+            """ help viewer/web browser, or execute a web browser or Qt"""
+            """ Assistant. </p>"""
+        ))
+        self.qt6DocAct.triggered.connect(lambda: self.__showQtDoc(6))
+        self.actions.append(self.qt6DocAct)
+      
         self.pyqt5DocAct = E5Action(
             self.tr('PyQt5 Documentation'),
-            self.tr('PyQt&5 Documentation'),
+            self.tr('PyQt5 Documentation'),
             0, 0, self, 'pyqt5_documentation')
         self.pyqt5DocAct.setStatusTip(self.tr(
             'Open PyQt5 Documentation'))
@@ -2890,9 +2888,27 @@
             """ internal help viewer/web browser, or execute a web"""
             """ browser or Qt Assistant. </p>"""
         ))
-        self.pyqt5DocAct.triggered.connect(self.__showPyQt5Doc)
+        self.pyqt5DocAct.triggered.connect(
+            lambda: self.__showPyQtDoc(variant=5))
         self.actions.append(self.pyqt5DocAct)
-        
+      
+        self.pyqt6DocAct = E5Action(
+            self.tr('PyQt6 Documentation'),
+            self.tr('PyQt6 Documentation'),
+            0, 0, self, 'pyqt6_documentation')
+        self.pyqt6DocAct.setStatusTip(self.tr(
+            'Open PyQt6 Documentation'))
+        self.pyqt6DocAct.setWhatsThis(self.tr(
+            """<b>PyQt6 Documentation</b>"""
+            """<p>Display the PyQt6 Documentation. Dependent upon your"""
+            """ settings, this will either show the help in Eric's"""
+            """ internal help viewer/web browser, or execute a web"""
+            """ browser or Qt Assistant. </p>"""
+        ))
+        self.pyqt6DocAct.triggered.connect(
+            lambda: self.__showPyQtDoc(variant=6))
+        self.actions.append(self.pyqt6DocAct)
+    
     def __initPythonDocActions(self):
         """
         Private slot to initialize the actions to show the Python
@@ -2900,7 +2916,7 @@
         """
         self.pythonDocAct = E5Action(
             self.tr('Python 3 Documentation'),
-            self.tr('Python &3 Documentation'),
+            self.tr('Python 3 Documentation'),
             0, 0, self, 'python3_documentation')
         self.pythonDocAct.setStatusTip(self.tr(
             'Open Python 3 Documentation'))
@@ -2918,11 +2934,11 @@
     
     def __initEricDocAction(self):
         """
-        Private slot to initialize the action to show the eric6 documentation.
+        Private slot to initialize the action to show the eric documentation.
         """
         self.ericDocAct = E5Action(
             self.tr("Eric API Documentation"),
-            self.tr('&Eric API Documentation'),
+            self.tr('Eric API Documentation'),
             0, 0, self, 'eric_documentation')
         self.ericDocAct.setStatusTip(self.tr(
             "Open Eric API Documentation"))
@@ -2930,7 +2946,7 @@
             """<b>Eric API Documentation</b>"""
             """<p>Display the Eric API documentation. The location for the"""
             """ documentation is the Documentation/Source subdirectory of"""
-            """ the eric6 installation directory.</p>"""
+            """ the eric installation directory.</p>"""
         ))
         self.ericDocAct.triggered.connect(self.__showEricDoc)
         self.actions.append(self.ericDocAct)
@@ -2940,10 +2956,10 @@
         Private slot to initialize the actions to show the PySide
         documentation.
         """
-        if Utilities.checkPyside():
+        if Utilities.checkPyside(variant=2):
             self.pyside2DocAct = E5Action(
                 self.tr('PySide2 Documentation'),
-                self.tr('PySide&2 Documentation'),
+                self.tr('PySide2 Documentation'),
                 0, 0, self, 'pyside2_documentation')
             self.pyside2DocAct.setStatusTip(self.tr(
                 'Open PySide2 Documentation'))
@@ -2955,10 +2971,30 @@
                 """ browser or Qt Assistant. </p>"""
             ))
             self.pyside2DocAct.triggered.connect(
-                lambda: self.__showPySideDoc("2"))
+                lambda: self.__showPySideDoc(variant=2))
             self.actions.append(self.pyside2DocAct)
         else:
             self.pyside2DocAct = None
+        
+        if Utilities.checkPyside(variant=6):
+            self.pyside6DocAct = E5Action(
+                self.tr('PySide6 Documentation'),
+                self.tr('PySide6 Documentation'),
+                0, 0, self, 'pyside6_documentation')
+            self.pyside6DocAct.setStatusTip(self.tr(
+                'Open PySide6 Documentation'))
+            self.pyside6DocAct.setWhatsThis(self.tr(
+                """<b>PySide6 Documentation</b>"""
+                """<p>Display the PySide6 Documentation. Dependent upon your"""
+                """ settings, this will either show the help in Eric's"""
+                """ internal help viewer/web browser, or execute a web"""
+                """ browser or Qt Assistant. </p>"""
+            ))
+            self.pyside6DocAct.triggered.connect(
+                lambda: self.__showPySideDoc(variant=6))
+            self.actions.append(self.pyside6DocAct)
+        else:
+            self.pyside6DocAct = None
     
     def __initMenus(self):
         """
@@ -3247,10 +3283,13 @@
         self.__menus["help"].addAction(self.ericDocAct)
         self.__menus["help"].addAction(self.pythonDocAct)
         self.__menus["help"].addAction(self.qt5DocAct)
-        if self.pyqt5DocAct is not None:
-            self.__menus["help"].addAction(self.pyqt5DocAct)
+        self.__menus["help"].addAction(self.qt6DocAct)
+        self.__menus["help"].addAction(self.pyqt5DocAct)
+        self.__menus["help"].addAction(self.pyqt6DocAct)
         if self.pyside2DocAct is not None:
             self.__menus["help"].addAction(self.pyside2DocAct)
+        if self.pyside6DocAct is not None:
+            self.__menus["help"].addAction(self.pyside6DocAct)
         self.__menus["help"].addSeparator()
         self.__menus["help"].addAction(self.versionAct)
         self.__menus["help"].addSeparator()
@@ -3542,11 +3581,6 @@
         self.sbVcsMonitorLed = StatusMonitorLedWidget(
             self.project, self.__statusBar)
         self.__statusBar.addPermanentWidget(self.sbVcsMonitorLed)
-        
-        self.networkIcon = E5NetworkIcon(self.__statusBar)
-        self.__statusBar.addPermanentWidget(self.networkIcon)
-        self.networkIcon.onlineStateChanged.connect(self.onlineStateChanged)
-        self.networkIcon.onlineStateChanged.connect(self.__onlineStateChanged)
     
     def __initExternalToolsActions(self):
         """
@@ -3807,7 +3841,7 @@
             address = FeatureAddress
         else:
             address = BugAddress
-        subject = "[eric6] "
+        subject = "[eric] "
         if attachFile is not None:
             with open(attachFile, "r", encoding="utf-8") as f:
                 body = f.read()
@@ -4116,10 +4150,10 @@
         
     def __newWindow(self):
         """
-        Private slot to start a new instance of eric6.
+        Private slot to start a new instance of eric.
         """
         if not Preferences.getUI("SingleApplicationMode"):
-            # start eric6 without any arguments
+            # start eric without any arguments
             program = sys.executable
             eric6 = os.path.join(getConfig("ericDir"), "eric6.py")
             args = [eric6]
@@ -5166,7 +5200,7 @@
     
     def __startWebBrowser(self):
         """
-        Private slot to start the eric6 web browser.
+        Private slot to start the eric web browser.
         """
         self.launchHelpViewer("")
         
@@ -5652,20 +5686,17 @@
             else:
                 self.__customViewer(home)
 
-    def __showQt5Doc(self):
-        """
-        Private slot to show the Qt5 documentation.
-        """
-        self.__showQtDoc(5)
-    
     def __showQtDoc(self, version):
         """
         Private method to show the Qt documentation.
         
-        @param version Qt version to show documentation for (integer)
-        """
-        if version == 5:
-            qtDocDir = Preferences.getQt5DocDir()
+        @param version Qt version to show documentation for
+        @type int
+        """
+        if version in [5, 6]:
+            qtDocDir = Preferences.getQtDocDir(version)
+        else:
+            return
         
         if qtDocDir.startswith("qthelp://"):
             if not os.path.splitext(qtDocDir)[1]:
@@ -5709,40 +5740,44 @@
         else:
             self.__customViewer(home)
         
-    def __showPyQt5Doc(self):
-        """
-        Private slot to show the PyQt5 documentation.
-        """
-        pyqt5DocDir = Preferences.getHelp("PyQt5DocDir")
-        if not pyqt5DocDir:
-            pyqt5DocDir = Utilities.getEnvironmentEntry("PYQT5DOCDIR", None)
-        
-        if not pyqt5DocDir:
+    def __showPyQtDoc(self, variant=5):
+        """
+        Private slot to show the PyQt5/6 documentation.
+        
+        @param variant PyQt variant to show documentation for (5 or 6)
+        @type int or str
+        """
+        pyqtDocDir = Preferences.getHelp("PyQt{0}DocDir".format(variant))
+        if not pyqtDocDir:
+            pyqtDocDir = Utilities.getEnvironmentEntry(
+                "PYQT{0}DOCDIR".format(variant), None)
+        
+        if not pyqtDocDir:
             E5MessageBox.warning(
                 self,
                 self.tr("Documentation"),
-                self.tr("""<p>The PyQt5 documentation starting point"""
-                        """ has not been configured.</p>"""))
+                self.tr("""<p>The PyQt{0} documentation starting point"""
+                        """ has not been configured.</p>""").format(variant))
             return
         
-        if not pyqt5DocDir.startswith(("http://", "https://", "qthelp://")):
+        if not pyqtDocDir.startswith(("http://", "https://", "qthelp://")):
             home = ""
-            if pyqt5DocDir:
-                if pyqt5DocDir.startswith("file://"):
-                    pyqt5DocDir = pyqt5DocDir[7:]
-                if not os.path.splitext(pyqt5DocDir)[1]:
+            if pyqtDocDir:
+                if pyqtDocDir.startswith("file://"):
+                    pyqtDocDir = pyqtDocDir[7:]
+                if not os.path.splitext(pyqtDocDir)[1]:
                     possibleHomes = [
                         Utilities.normjoinpath(
-                            pyqt5DocDir, 'index.html'),
+                            pyqtDocDir, 'index.html'),
                         Utilities.normjoinpath(
-                            pyqt5DocDir, 'class_reference.html'),
+                            pyqtDocDir, 'class_reference.html'),
                     ]
                     for possibleHome in possibleHomes:
                         if os.path.exists(possibleHome):
                             home = possibleHome
                             break
                 else:
-                    home = pyqt5DocDir
+                    home = pyqtDocDir
             
             if not home or not os.path.exists(home):
                 E5MessageBox.warning(
@@ -5758,7 +5793,7 @@
             else:
                 home = "file://" + home
         else:
-            home = pyqt5DocDir
+            home = pyqtDocDir
         
         hvType = Preferences.getWebBrowser("HelpViewerType")
         if hvType == 1:
@@ -5810,17 +5845,17 @@
         else:
             self.__customViewer(home)
     
-    def __showPySideDoc(self, variant="2"):
-        """
-        Private slot to show the PySide2 documentation.
-        
-        @param variant PySide variant (2)
-        @type str
-        """
-        pysideDocDir = Preferences.getHelp("PySide2DocDir")
+    def __showPySideDoc(self, variant=2):
+        """
+        Private slot to show the PySide2/PySide6 documentation.
+        
+        @param variant PySide variant (2 or 6)
+        @type int or str
+        """
+        pysideDocDir = Preferences.getHelp("PySide{0}DocDir".format(variant))
         if not pysideDocDir:
             pysideDocDir = Utilities.getEnvironmentEntry(
-                "PYSIDE2DOCDIR", None)
+                "PYSIDE{0}DOCDIR".format(variant), None)
         
         if not pysideDocDir:
             E5MessageBox.warning(
@@ -5884,9 +5919,9 @@
         
         @param home filename of file to be shown or URL to be opened
         @type str or QUrl
-        @keyparam searchWord word to search for
+        @param searchWord word to search for
         @type str
-        @keyparam useSingle flag indicating to use a single browser window
+        @param useSingle flag indicating to use a single browser window
         @type bool
         """
         if isinstance(home, QUrl):
@@ -5909,7 +5944,7 @@
         
         @param home filename of file to be shown or URL to be opened
         @type str
-        @keyparam searchWord word to search for
+        @param searchWord word to search for
         @type str
         @return flag indicating a successful launch
         @rtype bool
@@ -5939,7 +5974,7 @@
                     E5MessageBox.warning(
                         self,
                         self.tr("Start Web Browser"),
-                        self.tr("""The eric6 web browser could not be"""
+                        self.tr("""The eric web browser could not be"""
                                 """ started."""))
                     return False
                 
@@ -6000,7 +6035,7 @@
             E5MessageBox.warning(
                 self,
                 self.tr("Start Web Browser"),
-                self.tr("""<p>The eric6 web browser is not started.</p>"""
+                self.tr("""<p>The eric web browser is not started.</p>"""
                         """<p>Reason: {0}</p>""").format(
                     webBrowserClient.errstr())
             )
@@ -6034,7 +6069,7 @@
     
     def __webBrowser(self, home=""):
         """
-        Private slot to start the eric6 web browser.
+        Private slot to start the eric web browser.
         
         @param home full pathname of a file to display (string)
         """
@@ -6200,7 +6235,7 @@
     def __showExternalTools(self):
         """
         Private slot to display a dialog show a list of external tools used
-        by eric6.
+        by eric.
         """
         if self.programsDialog is None:
             from Preferences.ProgramsDialog import ProgramsDialog
@@ -6571,7 +6606,7 @@
             self,
             self.tr("Save session"),
             Utilities.getHomeDir(),
-            self.tr("eric6 Session Files (*.e5s)"),
+            self.tr("eric Session Files (*.e5s)"),
             "")
         
         if not sessionFile:
@@ -6593,7 +6628,7 @@
             self,
             self.tr("Load session"),
             Utilities.getHomeDir(),
-            self.tr("eric6 Session Files (*.e5s)"))
+            self.tr("eric Session Files (*.e5s)"))
         
         if not sessionFile:
             return
@@ -6668,9 +6703,9 @@
         """
         Public slot to show the Find In Files dialog.
         
-        @keyparam txt text to search for (string)
-        @keyparam searchDir directory to search in (string)
-        @keyparam openFiles flag indicating to operate on open files (boolean)
+        @param txt text to search for (string)
+        @param searchDir directory to search in (string)
+        @param openFiles flag indicating to operate on open files (boolean)
         """
         if self.findFilesDialog is None:
             from .FindFileDialog import FindFileDialog
@@ -6690,9 +6725,9 @@
         """
         Public slot to show the Find & Replace In Files dialog.
         
-        @keyparam txt text to search for (string)
-        @keyparam searchDir directory to search in (string)
-        @keyparam openFiles flag indicating to operate on open files (boolean)
+        @param txt text to search for (string)
+        @param searchDir directory to search in (string)
+        @param openFiles flag indicating to operate on open files (boolean)
         """
         if self.replaceFilesDialog is None:
             from .FindFileDialog import FindFileDialog
@@ -6786,8 +6821,7 @@
         """
         Public method to check the availability of updates of plug-ins.
         """
-        if self.isOnline():
-            self.pluginManager.checkPluginUpdatesAvailable()
+        self.pluginManager.checkPluginUpdatesAvailable()
     
     #################################################################
     ## Drag and Drop Support
@@ -6948,25 +6982,6 @@
         Preferences.syncPreferences()
         self.shutdownCalled = True
         return True
-    
-    def isOnline(self):
-        """
-        Public method to get the online state.
-        
-        @return online state
-        @rtype bool
-        """
-        return self.networkIcon.isOnline()
-    
-    def __onlineStateChanged(self, online):
-        """
-        Private slot handling changes in online state.
-        
-        @param online flag indicating the online state
-        @type bool
-        """
-        if online:
-            self.performVersionCheck(False)
 
     ##############################################
     ## Below are methods to check for new versions
@@ -6974,7 +6989,7 @@
 
     def showAvailableVersionsInfo(self):
         """
-        Public method to show the eric6 versions available for download.
+        Public method to show the eric versions available for download.
         """
         self.performVersionCheck(manual=True, showVersions=True)
         
@@ -6982,71 +6997,62 @@
     def performVersionCheck(self, manual=True, alternative=0,
                             showVersions=False):
         """
-        Public method to check the internet for an eric6 update.
+        Public method to check the internet for an eric update.
         
         @param manual flag indicating an invocation via the menu (boolean)
         @param alternative index of server to download from (integer)
-        @keyparam showVersions flag indicating the show versions mode (boolean)
-        """
-        if self.isOnline():
-            if not manual:
-                if VersionOnly.startswith("@@"):
+        @param showVersions flag indicating the show versions mode (boolean)
+        """
+        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):
         """
@@ -7157,7 +7163,7 @@
                             self,
                             self.tr("Update available"),
                             self.tr(
-                                """The update to <b>{0}</b> of eric6 is"""
+                                """The update to <b>{0}</b> of eric is"""
                                 """ available at <b>{1}</b>. Would you like"""
                                 """ to get it?""")
                             .format(versions[2], versions[3]),
@@ -7170,7 +7176,7 @@
                             self.tr("Update Check"),
                             self.tr(
                                 """You are using a snapshot release of"""
-                                """ eric6. A more up-to-date stable release"""
+                                """ eric. A more up-to-date stable release"""
                                 """ might be available."""))
             elif VersionOnly.startswith(("rev_", "@@")):
                 # check installation from source
@@ -7191,7 +7197,7 @@
                         self,
                         self.tr("Update available"),
                         self.tr(
-                            """The update to <b>{0}</b> of eric6 is"""
+                            """The update to <b>{0}</b> of eric is"""
                             """ available at <b>{1}</b>. Would you like"""
                             """ to get it?""")
                         .format(versions[0], versions[1]),
@@ -7201,10 +7207,10 @@
                     if self.manualUpdatesCheck:
                         E5MessageBox.information(
                             self,
-                            self.tr("Eric6 is up to date"),
+                            self.tr("eric is up to date"),
                             self.tr(
                                 """You are using the latest version of"""
-                                """ eric6"""))
+                                """ eric"""))
         except (IndexError, TypeError):
             E5MessageBox.warning(
                 self,
@@ -7276,7 +7282,7 @@
 
     def checkConfigurationStatus(self):
         """
-        Public method to check, if eric6 has been configured. If it is not,
+        Public method to check, if eric has been configured. If it is not,
         the configuration dialog is shown.
         """
         if not Preferences.isConfigured():
@@ -7285,7 +7291,7 @@
             E5MessageBox.information(
                 self,
                 self.tr("First time usage"),
-                self.tr("""eric6 has not been configured yet. """
+                self.tr("""eric has not been configured yet. """
                         """The configuration dialog will be started."""))
             self.showPreferences()
     
@@ -7310,7 +7316,7 @@
     
     def versionIsNewer(self, required, snapshot=None):
         """
-        Public method to check, if the eric6 version is good compared to
+        Public method to check, if the eric version is good compared to
         the required version.
         
         @param required required version (string)
@@ -7383,7 +7389,7 @@
     def getOriginalPathString(self):
         """
         Public method to get the original PATH environment variable
-        (i.e. before modifications by eric6 and PyQt5).
+        (i.e. before modifications by eric and PyQt5).
         
         @return original PATH environment variable
         @rtype str
@@ -7409,7 +7415,8 @@
     ## Support for desktop notifications below
     ##########################################
     
-    def showNotification(self, icon, heading, text, timeout=None):
+    def showNotification(self, icon, heading, text,
+                         kind=NotificationTypes.Information, timeout=None):
         """
         Public method to show a desktop notification.
         
@@ -7419,30 +7426,19 @@
         @type str
         @param text text of the notification
         @type str
+        @param kind kind of notification to be shown
+        @type NotificationTypes
         @param timeout time in seconds the notification should be shown
             (None = use configured timeout, 0 = indefinitely)
         @type int
         """
-        if Preferences.getUI("NotificationsEnabled"):
-            if self.__notification is None:
-                from .NotificationWidget import NotificationWidget
-                self.__notification = NotificationWidget(parent=self)
-            self.__notification.setPixmap(icon)
-            self.__notification.setHeading(heading)
-            self.__notification.setText(text)
-            if timeout is None:
-                timeout = Preferences.getUI("NotificationTimeout")
-            self.__notification.setTimeout(timeout)
-            self.__notification.move(Preferences.getUI("NotificationPosition"))
-            self.__notification.show()
-    
-    def notificationsEnabled(self):
-        """
-        Public method to check, if notifications are enabled.
-        
-        @return flag indicating, if notifications are enabled (boolean)
-        """
-        return Preferences.getUI("NotificationsEnabled")
+        if self.__notification is None:
+            from .NotificationWidget import NotificationWidget
+            self.__notification = NotificationWidget(parent=self)
+        if timeout is None:
+            timeout = Preferences.getUI("NotificationTimeout")
+        self.__notification.showNotification(icon, heading, text, kind=kind,
+                                             timeout=timeout)
     
     #########################
     ## Support for IRC  below

eric ide

mercurial