21 |
21 |
22 @signal errorMessage(const QString&) emitted, if an error occurred during |
22 @signal errorMessage(const QString&) emitted, if an error occurred during |
23 the installation of the documentation |
23 the installation of the documentation |
24 @signal docsInstalled(bool) emitted after the installation has finished |
24 @signal docsInstalled(bool) emitted after the installation has finished |
25 """ |
25 """ |
|
26 errorMessage = pyqtSignal(str) |
|
27 docsInstalled = pyqtSignal(bool) |
|
28 |
26 def __init__(self, collection): |
29 def __init__(self, collection): |
27 """ |
30 """ |
28 Constructor |
31 Constructor |
29 |
32 |
30 @param collection full pathname of the collection file (string) |
33 @param collection full pathname of the collection file (string) |
72 self.__mutex.unlock() |
75 self.__mutex.unlock() |
73 |
76 |
74 changes |= self.__installEric5Doc(engine) |
77 changes |= self.__installEric5Doc(engine) |
75 engine = None |
78 engine = None |
76 del engine |
79 del engine |
77 self.emit(SIGNAL("docsInstalled(bool)"), changes) |
80 self.docsInstalled.emit(changes) |
78 |
81 |
79 def __installQtDoc(self, name, engine): |
82 def __installQtDoc(self, name, engine): |
80 """ |
83 """ |
81 Private method to install/update a Qt help document. |
84 Private method to install/update a Qt help document. |
82 |
85 |
120 |
123 |
121 if namespace in engine.registeredDocumentations(): |
124 if namespace in engine.registeredDocumentations(): |
122 engine.unregisterDocumentation(namespace) |
125 engine.unregisterDocumentation(namespace) |
123 |
126 |
124 if not engine.registerDocumentation(fi.absoluteFilePath()): |
127 if not engine.registerDocumentation(fi.absoluteFilePath()): |
125 self.emit(SIGNAL("errorMessage(const QString&)"), |
128 self.errorMessage.emit( |
126 self.trUtf8("""<p>The file <b>{0}</b> could not be registered.""" |
129 self.trUtf8("""<p>The file <b>{0}</b> could not be registered.""" |
127 """<br/>Reason: {1}</p>""")\ |
130 """<br/>Reason: {1}</p>""")\ |
128 .format(fi.absoluteFilePath, engine.error()) |
131 .format(fi.absoluteFilePath, engine.error()) |
129 ) |
132 ) |
130 return False |
133 return False |
177 |
180 |
178 if namespace in engine.registeredDocumentations(): |
181 if namespace in engine.registeredDocumentations(): |
179 engine.unregisterDocumentation(namespace) |
182 engine.unregisterDocumentation(namespace) |
180 |
183 |
181 if not engine.registerDocumentation(fi.absoluteFilePath()): |
184 if not engine.registerDocumentation(fi.absoluteFilePath()): |
182 self.emit(SIGNAL("errorMessage(const QString&)"), |
185 self.errorMessage.emit( |
183 self.trUtf8("""<p>The file <b>{0}</b> could not be registered.""" |
186 self.trUtf8("""<p>The file <b>{0}</b> could not be registered.""" |
184 """<br/>Reason: {1}</p>""")\ |
187 """<br/>Reason: {1}</p>""")\ |
185 .format(fi.absoluteFilePath, engine.error()) |
188 .format(fi.absoluteFilePath, engine.error()) |
186 ) |
189 ) |
187 return False |
190 return False |