Helpviewer/QtHelpDocumentationDialog.py

changeset 5224
7454861e4106
parent 4631
5c1a96925da4
child 5227
5bffd1a6741f
equal deleted inserted replaced
5223:4c0b3ee7d2d8 5224:7454861e4106
12 from PyQt5.QtCore import pyqtSlot, Qt, QItemSelectionModel 12 from PyQt5.QtCore import pyqtSlot, Qt, QItemSelectionModel
13 from PyQt5.QtWidgets import QDialog 13 from PyQt5.QtWidgets import QDialog
14 from PyQt5.QtHelp import QHelpEngineCore 14 from PyQt5.QtHelp import QHelpEngineCore
15 15
16 from E5Gui import E5MessageBox, E5FileDialog 16 from E5Gui import E5MessageBox, E5FileDialog
17 from E5Gui.E5Application import e5App
17 18
18 from .Ui_QtHelpDocumentationDialog import Ui_QtHelpDocumentationDialog 19 from .Ui_QtHelpDocumentationDialog import Ui_QtHelpDocumentationDialog
19 20
20 21
21 class QtHelpDocumentationDialog(QDialog, Ui_QtHelpDocumentationDialog): 22 class QtHelpDocumentationDialog(QDialog, Ui_QtHelpDocumentationDialog):
41 self.documentsList.addItems(docs) 42 self.documentsList.addItems(docs)
42 43
43 self.__registeredDocs = [] 44 self.__registeredDocs = []
44 self.__unregisteredDocs = [] 45 self.__unregisteredDocs = []
45 self.__tabsToClose = [] 46 self.__tabsToClose = []
47
48 try:
49 self.__pluginHelpDocuments = \
50 e5App().getObject("PluginManager").getPluginQtHelpFiles()
51 except KeyError:
52 from PluginManager.PluginManager import PluginManager
53 self.__pluginHelpDocuments = \
54 PluginManager(self).getPluginQtHelpFiles()
55 self.addPluginButton.setEnabled(bool(self.__pluginHelpDocuments))
46 56
47 @pyqtSlot() 57 @pyqtSlot()
48 def on_documentsList_itemSelectionChanged(self): 58 def on_documentsList_itemSelectionChanged(self):
49 """ 59 """
50 Private slot handling a change of the documents selection. 60 Private slot handling a change of the documents selection.
135 145
136 if self.documentsList.count(): 146 if self.documentsList.count():
137 self.documentsList.setCurrentRow( 147 self.documentsList.setCurrentRow(
138 0, QItemSelectionModel.ClearAndSelect) 148 0, QItemSelectionModel.ClearAndSelect)
139 149
150 @pyqtSlot()
151 def on_addPluginButton_clicked(self):
152 """
153 Private slot to add QtHelp documents provided by plug-ins.
154 """
155 # TODO: not implemented yet
156 raise NotImplementedError
157
140 def hasChanges(self): 158 def hasChanges(self):
141 """ 159 """
142 Public slot to test the dialog for changes. 160 Public slot to test the dialog for changes.
143 161
144 @return flag indicating presence of changes 162 @return flag indicating presence of changes

eric ide

mercurial