Some changes to the Qt Help tools detection.

Sun, 20 Jan 2019 19:38:51 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 20 Jan 2019 19:38:51 +0100
changeset 6665
adb59475e671
parent 6664
50c9c1c9cf30
child 6666
06f6e0f24e89

Some changes to the Qt Help tools detection.

DocumentationTools/QtHelpGenerator.py file | annotate | diff | comparison | revisions
Plugins/PluginEricdoc.py file | annotate | diff | comparison | revisions
Preferences/ProgramsDialog.py file | annotate | diff | comparison | revisions
--- a/DocumentationTools/QtHelpGenerator.py	Sun Jan 20 14:41:07 2019 +0100
+++ b/DocumentationTools/QtHelpGenerator.py	Sun Jan 20 19:38:51 2019 +0100
@@ -17,6 +17,7 @@
 
 from Utilities import joinext, relpath, html_encode, getQtBinariesPath, \
     generateQtToolName
+from Globals import qVersionTuple
 
 HelpCollection = r"""<?xml version="1.0" encoding="utf-8" ?>
 <QHelpCollectionProject version="1.0">
@@ -279,7 +280,8 @@
             HelpProjectFile, "-o", os.path.join(self.outputDir, HelpHelpFile)])
         os.remove(HelpProjectFile)
         
-        if self.createCollection:
+        # TODO: do this with qhelpgenerator >= 5.12.0
+        if qVersionTuple() < (5, 12, 0) and self.createCollection:
             sys.stdout.write("Generating QtHelp collection...\n")
             sys.stdout.flush()
             sys.stderr.flush()
--- a/Plugins/PluginEricdoc.py	Sun Jan 20 14:41:07 2019 +0100
+++ b/Plugins/PluginEricdoc.py	Sun Jan 20 19:38:51 2019 +0100
@@ -18,6 +18,7 @@
 
 from E5Gui.E5Action import E5Action
 
+from Globals import qVersionTuple
 import Utilities
 import UI.Info
 
@@ -87,21 +88,22 @@
         "versionCleanup": (0, -1),
     })
     
-    # 3. Qt Collection Generator
-    exe = os.path.join(Utilities.getQtBinariesPath(), 'qcollectiongenerator')
-    if Utilities.isWindowsPlatform():
-        exe += '.exe'
-    dataList.append({
-        "programEntry": True,
-        "header": QCoreApplication.translate(
-            "EricdocPlugin", "Qt Help Tools"),
-        "exe": exe,
-        "versionCommand": '-v',
-        "versionStartsWith": 'Qt',
-        "versionPosition": -1,
-        "version": "",
-        "versionCleanup": (0, -1),
-    })
+    if qVersionTuple() < (5, 12, 0):
+        # 3. Qt Collection Generator
+        exe = os.path.join(Utilities.getQtBinariesPath(), 'qcollectiongenerator')
+        if Utilities.isWindowsPlatform():
+            exe += '.exe'
+        dataList.append({
+            "programEntry": True,
+            "header": QCoreApplication.translate(
+                "EricdocPlugin", "Qt Help Tools"),
+            "exe": exe,
+            "versionCommand": '-v',
+            "versionStartsWith": 'Qt',
+            "versionPosition": -1,
+            "version": "",
+            "versionCleanup": (0, -1),
+        })
     
     return dataList
 
--- a/Preferences/ProgramsDialog.py	Sun Jan 20 14:41:07 2019 +0100
+++ b/Preferences/ProgramsDialog.py	Sun Jan 20 19:38:51 2019 +0100
@@ -340,6 +340,7 @@
         font = itm.font(0)
         font.setBold(True)
         itm.setFont(0, font)
+        rememberedExe = exe
         if not exe:
             itm.setText(1, self.tr("(not configured)"))
         else:
@@ -398,7 +399,12 @@
                     QTreeWidgetItem(itm, [exe, version])
                 itm.setExpanded(True)
             else:
-                itm.setText(1, self.tr("(not found)"))
+                if itm.childCount() == 0:
+                    itm.setText(1, self.tr("(not found)"))
+                else:
+                    QTreeWidgetItem(itm, [rememberedExe,
+                                          self.tr("(not found)")])
+                    itm.setExpanded(True)
         QApplication.processEvents()
         self.programsList.header().resizeSections(QHeaderView.ResizeToContents)
         self.programsList.header().setStretchLastSection(True)

eric ide

mercurial