118 self.__closeButton = QToolButton(self) |
118 self.__closeButton = QToolButton(self) |
119 self.__closeButton.setIcon(UI.PixmapCache.getIcon("close.png")) |
119 self.__closeButton.setIcon(UI.PixmapCache.getIcon("close.png")) |
120 self.__closeButton.setToolTip( |
120 self.__closeButton.setToolTip( |
121 self.tr("Close the current help window")) |
121 self.tr("Close the current help window")) |
122 self.__closeButton.setEnabled(False) |
122 self.__closeButton.setEnabled(False) |
123 self.__closeButton.clicked[bool].connect(self.closeBrowser) |
123 self.__closeButton.clicked.connect(self.closeBrowser) |
124 self.__rightCornerWidgetLayout.addWidget(self.__closeButton) |
124 self.__rightCornerWidgetLayout.addWidget(self.__closeButton) |
125 if Preferences.getUI("SingleCloseButton") or \ |
125 if Preferences.getUI("SingleCloseButton") or \ |
126 not hasattr(self, 'setTabsClosable'): |
126 not hasattr(self, 'setTabsClosable'): |
127 self.__closeButton.show() |
127 self.__closeButton.show() |
128 else: |
128 else: |
135 self.__newTabButton = QToolButton(self) |
135 self.__newTabButton = QToolButton(self) |
136 self.__newTabButton.setIcon(UI.PixmapCache.getIcon("plus.png")) |
136 self.__newTabButton.setIcon(UI.PixmapCache.getIcon("plus.png")) |
137 self.__newTabButton.setToolTip( |
137 self.__newTabButton.setToolTip( |
138 self.tr("Open a new help window tab")) |
138 self.tr("Open a new help window tab")) |
139 self.setCornerWidget(self.__newTabButton, Qt.TopLeftCorner) |
139 self.setCornerWidget(self.__newTabButton, Qt.TopLeftCorner) |
140 self.__newTabButton.clicked[bool].connect(self.newBrowser) |
140 self.__newTabButton.clicked.connect(self.__newBrowser) |
141 |
141 |
142 self.__initTabContextMenu() |
142 self.__initTabContextMenu() |
143 |
143 |
144 self.__historyCompleter = None |
144 self.__historyCompleter = None |
145 |
145 |
286 Private method to show a print preview of the selected tab. |
286 Private method to show a print preview of the selected tab. |
287 """ |
287 """ |
288 browser = self.widget(self.__tabContextMenuIndex) |
288 browser = self.widget(self.__tabContextMenuIndex) |
289 self.printPreviewBrowser(browser) |
289 self.printPreviewBrowser(browser) |
290 |
290 |
|
291 @pyqtSlot() |
|
292 def __newBrowser(self): |
|
293 """ |
|
294 Private slot to open a new browser tab. |
|
295 """ |
|
296 self.newBrowser() |
|
297 |
291 def newBrowser(self, link=None, requestData=None, position=-1): |
298 def newBrowser(self, link=None, requestData=None, position=-1): |
292 """ |
299 """ |
293 Public method to create a new web browser tab. |
300 Public method to create a new web browser tab. |
294 |
301 |
295 @param link link to be shown (string or QUrl) |
302 @param link link to be shown (string or QUrl) |
429 """ |
436 """ |
430 for index in range(self.count()): |
437 for index in range(self.count()): |
431 browser = self.widget(index) |
438 browser = self.widget(index) |
432 browser and browser.reload() |
439 browser and browser.reload() |
433 |
440 |
|
441 @pyqtSlot() |
434 def closeBrowser(self): |
442 def closeBrowser(self): |
435 """ |
443 """ |
436 Public slot called to handle the close action. |
444 Public slot called to handle the close action. |
437 """ |
445 """ |
438 self.closeBrowserAt(self.currentIndex()) |
446 self.closeBrowserAt(self.currentIndex()) |