350 |
350 |
351 WebBrowserWindow.BrowserWindows.append(self) |
351 WebBrowserWindow.BrowserWindows.append(self) |
352 |
352 |
353 self.__initWebEngineSettings() |
353 self.__initWebEngineSettings() |
354 |
354 |
|
355 self.__editors = [] |
|
356 |
355 # initialize some of our class objects |
357 # initialize some of our class objects |
356 self.passwordManager() |
358 self.passwordManager() |
357 self.historyManager() |
359 self.historyManager() |
358 self.greaseMonkeyManager() |
360 self.greaseMonkeyManager() |
359 self.protocolHandlerManager() |
361 self.protocolHandlerManager() |
3260 and not self.__tabWidget.shallShutDown() |
3262 and not self.__tabWidget.shallShutDown() |
3261 ): |
3263 ): |
3262 return False |
3264 return False |
3263 |
3265 |
3264 self.__isClosing = True |
3266 self.__isClosing = True |
|
3267 |
|
3268 for editor in self.__editors[:]: |
|
3269 with contextlib.suppress(RuntimeError): |
|
3270 editor.close() |
3265 |
3271 |
3266 if ( |
3272 if ( |
3267 not WebBrowserWindow._performingShutdown |
3273 not WebBrowserWindow._performingShutdown |
3268 and len(WebBrowserWindow.BrowserWindows) == 1 |
3274 and len(WebBrowserWindow.BrowserWindows) == 1 |
3269 and not WebBrowserWindow.isPrivate() |
3275 and not WebBrowserWindow.isPrivate() |
4344 @param src source of the web page |
4350 @param src source of the web page |
4345 @type str |
4351 @type str |
4346 """ |
4352 """ |
4347 from eric7.QScintilla.MiniEditor import MiniEditor |
4353 from eric7.QScintilla.MiniEditor import MiniEditor |
4348 |
4354 |
4349 editor = MiniEditor(parent=self) |
4355 editor = MiniEditor() |
|
4356 editor.closing.connect(lambda: self.__editorClosing(editor)) |
4350 editor.setText(src, "Html") |
4357 editor.setText(src, "Html") |
4351 editor.setLanguage("dummy.html") |
4358 editor.setLanguage("dummy.html") |
4352 editor.show() |
4359 editor.show() |
|
4360 |
|
4361 self.__editors.append(editor) |
|
4362 |
|
4363 def __editorClosing(self, editor): |
|
4364 """ |
|
4365 Private method called, when an editor is closing. |
|
4366 |
|
4367 @param editor reference to the closing editor |
|
4368 @type MiniEditor |
|
4369 """ |
|
4370 with contextlib.suppress(ValueError): |
|
4371 self.__editors.remove(editor) |
|
4372 del editor |
4353 |
4373 |
4354 @pyqtSlot() |
4374 @pyqtSlot() |
4355 def __toggleJavaScriptConsole(self): |
4375 def __toggleJavaScriptConsole(self): |
4356 """ |
4376 """ |
4357 Private slot to toggle the JavaScript console. |
4377 Private slot to toggle the JavaScript console. |