QtHelpDocumentationSelectionDialog: changed code to support adding complete categories by just selecting the category title.

Sat, 20 Jun 2020 17:36:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 20 Jun 2020 17:36:20 +0200
changeset 7634
8c3d033e5044
parent 7633
96382cbe1d43
child 7635
0cdead130a81

QtHelpDocumentationSelectionDialog: changed code to support adding complete categories by just selecting the category title.

eric6/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.WebBrowser.QtHelp.QtHelpDocumentationSelectionDialog.html file | annotate | diff | comparison | revisions
eric6/WebBrowser/QtHelp/QtHelpDocumentationSelectionDialog.py file | annotate | diff | comparison | revisions
Binary file eric6/Documentation/Help/source.qch has changed
--- a/eric6/Documentation/Source/eric6.WebBrowser.QtHelp.QtHelpDocumentationSelectionDialog.html	Sat Jun 20 15:06:20 2020 +0200
+++ b/eric6/Documentation/Source/eric6.WebBrowser.QtHelp.QtHelpDocumentationSelectionDialog.html	Sat Jun 20 17:36:20 2020 +0200
@@ -158,7 +158,7 @@
 <dl>
 <dt>Return Type:</dt>
 <dd>
-list of str
+set of str
 </dd>
 </dl>
 <a NAME="QtHelpDocumentationSelectionDialog.on_deleteAllButton_clicked" ID="QtHelpDocumentationSelectionDialog.on_deleteAllButton_clicked"></a>
--- a/eric6/WebBrowser/QtHelp/QtHelpDocumentationSelectionDialog.py	Sat Jun 20 15:06:20 2020 +0200
+++ b/eric6/WebBrowser/QtHelp/QtHelpDocumentationSelectionDialog.py	Sat Jun 20 17:36:20 2020 +0200
@@ -168,11 +168,19 @@
         Public method to retrieve the selected help documents.
         
         @return list of QtHelp documentation sets to be installed
-        @rtype list of str
+        @rtype set of str
         """
-        documents = []
+        documents = set()
         for item in self.documentationList.selectedItems():
-            fileName = item.data(0, Qt.UserRole)
-            if fileName:
-                documents.append(fileName)
+            if item.parent() is None:
+                # it is a category item; add all files of that category
+                for childIndex in range(item.childCount()):
+                    child = item.child(childIndex)
+                    fileName = child.data(0, Qt.UserRole)
+                    if fileName:
+                        documents.add(fileName)
+            else:
+                fileName = item.data(0, Qt.UserRole)
+                if fileName:
+                    documents.add(fileName)
         return documents

eric ide

mercurial