Extended the version information to include the desktop and session type (although these are not versions). eric7

Sun, 27 Feb 2022 11:43:28 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 27 Feb 2022 11:43:28 +0100
branch
eric7
changeset 8958
ba80dceeb560
parent 8957
968b29ad7207
child 8960
6417be832fca

Extended the version information to include the desktop and session type (although these are not versions).

eric7/Globals/__init__.py file | annotate | diff | comparison | revisions
eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
eric7/Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/eric7/Globals/__init__.py	Sun Feb 27 11:10:22 2022 +0100
+++ b/eric7/Globals/__init__.py	Sun Feb 27 11:43:28 2022 +0100
@@ -101,6 +101,9 @@
     
     currDesktop = os.environ.get("KDE_FULL_SESSION", "")
     if currDesktop:
+        if currDesktop == "true":
+            return "KDE"
+        
         return currDesktop
     
     currDesktop = os.environ.get("DESKTOP_SESSION", "")
--- a/eric7/UI/UserInterface.py	Sun Feb 27 11:10:22 2022 +0100
+++ b/eric7/UI/UserInterface.py	Sun Feb 27 11:43:28 2022 +0100
@@ -4028,12 +4028,18 @@
         versionText = self.tr(
             """<h2>Version Numbers</h2>"""
             """<table>""")
+        
+        # Python version
         versionText += (
             """<tr><td><b>Python</b></td><td>{0}, {1}</td></tr>"""
         ).format(sys.version.split()[0], sizeStr)
+        
+        # Qt version
         versionText += (
             """<tr><td><b>Qt</b></td><td>{0}</td></tr>"""
         ).format(qVersion())
+        
+        # PyQt versions
         versionText += (
             """<tr><td><b>PyQt6</b></td><td>{0}</td></tr>"""
         ).format(PYQT_VERSION_STR)
@@ -4053,14 +4059,33 @@
         versionText += (
             """<tr><td><b>sip</b></td><td>{0}</td></tr>"""
         ).format(sip_version_str)
+        
+        # webengine (chromium) version
         with contextlib.suppress(ImportError):
             from WebBrowser.Tools import WebBrowserTools
             chromeVersion = WebBrowserTools.getWebEngineVersions()[0]
             versionText += (
                 """<tr><td><b>WebEngine</b></td><td>{0}</td></tr>"""
             ).format(chromeVersion)
+        
+        # eric7 version
         versionText += ("""<tr><td><b>{0}</b></td><td>{1}</td></tr>"""
                         ).format(Program, Version)
+        
+        # desktop and session type
+        desktop = Globals.desktopName()
+        session = Globals.sessionType()
+        if desktop or session:
+            versionText += "<tr><td></td><td></td></tr>"
+            if desktop:
+                versionText += (
+                    "<tr><td><b>Desktop</b></td><td>{0}</td></tr>"
+                ).format(desktop)
+            if session:
+                versionText += (
+                    "<tr><td><b>Session Type</b></td><td>{0}</td></tr>"
+                ).format(session)
+        
         versionText += self.tr("""</table>""")
         
         EricMessageBox.about(self, Program, versionText)
--- a/eric7/Utilities/__init__.py	Sun Feb 27 11:10:22 2022 +0100
+++ b/eric7/Utilities/__init__.py	Sun Feb 27 11:43:28 2022 +0100
@@ -53,9 +53,10 @@
 # import these methods into the Utilities namespace
 from Globals import (  # __IGNORE_WARNING__
     isWindowsPlatform, isLinuxPlatform, isMacPlatform, desktopName,
-    getConfigDir, setConfigDir, getPythonLibraryDirectory,
+    sessionType, getConfigDir, setConfigDir, getPythonLibraryDirectory,
     getPyQt6ModulesDirectory, getQtBinariesPath, getPyQtToolsPath,
-    qVersionTuple)
+    qVersionTuple
+)
 
 from EricWidgets.EricApplication import ericApp
 
@@ -1896,6 +1897,10 @@
     if desktop:
         info.append("")
         info.append("Desktop: {0}".format(desktop))
+    session = sessionType()
+    if session:
+        info.append("")
+        info.append("Session Type: {0}".format(session))
     
     return linesep.join(info)
 

eric ide

mercurial