217 Private method to show a print preview of the selected tab. |
217 Private method to show a print preview of the selected tab. |
218 """ |
218 """ |
219 browser = self.widget(self.__tabContextMenuIndex) |
219 browser = self.widget(self.__tabContextMenuIndex) |
220 self.printPreviewBrowser(browser) |
220 self.printPreviewBrowser(browser) |
221 |
221 |
222 def newBrowser(self, link=None): |
222 def newBrowser(self, link=None, requestData=None): |
223 """ |
223 """ |
224 Public method to create a new web browser tab. |
224 Public method to create a new web browser tab. |
225 |
225 |
226 @param link link to be shown (string or QUrl) |
226 @param link link to be shown (string or QUrl) |
|
227 @param requestData tuple containing the request data (QNetworkRequest, |
|
228 QNetworkAccessManager.Operation, QByteArray) |
227 """ |
229 """ |
228 if link is None: |
230 if link is None: |
229 linkName = "" |
231 linkName = "" |
230 elif isinstance(link, QUrl): |
232 elif isinstance(link, QUrl): |
231 linkName = link.toString() |
233 linkName = link.toString() |
265 self.__mainWindow.closeAct.setEnabled(True) |
267 self.__mainWindow.closeAct.setEnabled(True) |
266 self.__mainWindow.closeAllAct.setEnabled(True) |
268 self.__mainWindow.closeAllAct.setEnabled(True) |
267 self.__closeButton and self.__closeButton.setEnabled(True) |
269 self.__closeButton and self.__closeButton.setEnabled(True) |
268 self.__navigationButton.setEnabled(True) |
270 self.__navigationButton.setEnabled(True) |
269 |
271 |
270 if not linkName and Preferences.getHelp("StartupBehavior") == 0: |
272 if not linkName and not requestData and \ |
|
273 Preferences.getHelp("StartupBehavior") == 0: |
271 linkName = Preferences.getHelp("HomePage") |
274 linkName = Preferences.getHelp("HomePage") |
272 |
275 |
273 if linkName: |
276 if linkName: |
274 browser.setSource(QUrl(linkName)) |
277 browser.setSource(QUrl(linkName)) |
275 if not browser.documentTitle(): |
278 if not browser.documentTitle(): |
277 self.setTabToolTip(index, linkName) |
280 self.setTabToolTip(index, linkName) |
278 else: |
281 else: |
279 self.setTabText(index, |
282 self.setTabText(index, |
280 self.__elide(browser.documentTitle().replace("&", "&&"))) |
283 self.__elide(browser.documentTitle().replace("&", "&&"))) |
281 self.setTabToolTip(index, browser.documentTitle()) |
284 self.setTabToolTip(index, browser.documentTitle()) |
|
285 elif requestData: |
|
286 browser.load(*requestData) |
282 |
287 |
283 def __showNavigationMenu(self): |
288 def __showNavigationMenu(self): |
284 """ |
289 """ |
285 Private slot to show the navigation button menu. |
290 Private slot to show the navigation button menu. |
286 """ |
291 """ |