Helpviewer/HelpWindow.py

changeset 1196
77da430b4080
parent 1170
a3731e520b28
child 1232
ed31e909cf2e
equal deleted inserted replaced
1195:572730077b35 1196:77da430b4080
128 128
129 self.tabWidget = HelpTabWidget(self) 129 self.tabWidget = HelpTabWidget(self)
130 self.tabWidget.currentChanged[int].connect(self.__currentChanged) 130 self.tabWidget.currentChanged[int].connect(self.__currentChanged)
131 self.tabWidget.titleChanged.connect(self.__titleChanged) 131 self.tabWidget.titleChanged.connect(self.__titleChanged)
132 self.tabWidget.showMessage.connect(self.statusBar().showMessage) 132 self.tabWidget.showMessage.connect(self.statusBar().showMessage)
133 self.tabWidget.browserClosed.connect(self.__browserClosed)
133 134
134 self.findDlg = SearchWidget(self, self) 135 self.findDlg = SearchWidget(self, self)
135 centralWidget = QWidget() 136 centralWidget = QWidget()
136 layout = QVBoxLayout() 137 layout = QVBoxLayout()
137 layout.setContentsMargins(1, 1, 1, 1) 138 layout.setContentsMargins(1, 1, 1, 1)
217 self.__virusTotal = VirusTotalAPI(self) 218 self.__virusTotal = VirusTotalAPI(self)
218 self.__virusTotal.submitUrlError.connect(self.__virusTotalSubmitUrlError) 219 self.__virusTotal.submitUrlError.connect(self.__virusTotalSubmitUrlError)
219 self.__virusTotal.urlScanReport.connect(self.__virusTotalUrlScanReport) 220 self.__virusTotal.urlScanReport.connect(self.__virusTotalUrlScanReport)
220 self.__virusTotal.fileScanReport.connect(self.__virusTotalFileScanReport) 221 self.__virusTotal.fileScanReport.connect(self.__virusTotalFileScanReport)
221 222
223 self.__previewer = None
224
222 QTimer.singleShot(0, self.__lookForNewDocumentation) 225 QTimer.singleShot(0, self.__lookForNewDocumentation)
223 if self.__searchWord is not None: 226 if self.__searchWord is not None:
224 QTimer.singleShot(0, self.__searchForWord) 227 QTimer.singleShot(0, self.__searchForWord)
225 228
226 def __setIconDatabasePath(self, enable=True): 229 def __setIconDatabasePath(self, enable=True):
1535 else: 1538 else:
1536 linkName = link 1539 linkName = link
1537 h = HelpWindow(linkName, ".", self.parent(), "qbrowser", self.fromEric) 1540 h = HelpWindow(linkName, ".", self.parent(), "qbrowser", self.fromEric)
1538 h.show() 1541 h.show()
1539 1542
1543 def previewer(self):
1544 """
1545 Public method to get a reference to the previewer tab.
1546
1547 @return reference to the previewer tab (HelpBrowserWV)
1548 """
1549 if self.__previewer is None:
1550 if self.tabWidget.count() != 1 or \
1551 self.currentBrowser().url().toString() not in [
1552 "", "pyrc:home", "about:blank"]:
1553 self.newTab()
1554 self.__previewer = self.currentBrowser()
1555 self.tabWidget.setCurrentWidget(self.__previewer)
1556 return self.__previewer
1557
1558 def __browserClosed(self, browser):
1559 """
1560 Private slot handling the closure of a browser tab.
1561
1562 @param browser reference to the browser window (QWidget)
1563 """
1564 if browser is self.__previewer:
1565 self.__previewer = None
1566
1540 def __openFile(self): 1567 def __openFile(self):
1541 """ 1568 """
1542 Private slot called to open a file. 1569 Private slot called to open a file.
1543 """ 1570 """
1544 fn = E5FileDialog.getOpenFileName( 1571 fn = E5FileDialog.getOpenFileName(

eric ide

mercurial