Merge branch 'Carpetsmoker-last-tab'
This commit is contained in:
commit
bbea66c91f
@ -234,17 +234,19 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
tab: The QWebView to be closed.
|
tab: The QWebView to be closed.
|
||||||
"""
|
"""
|
||||||
last_close = config.get('tabs', 'last-close')
|
last_close = config.get('tabs', 'last-close')
|
||||||
if self.count() > 1:
|
self._remove_tab(tab)
|
||||||
self._remove_tab(tab)
|
|
||||||
elif last_close == 'close':
|
if self.count() == 0:
|
||||||
self._remove_tab(tab)
|
if last_close == 'close':
|
||||||
self.close_window.emit()
|
self.close_window.emit()
|
||||||
elif last_close == 'blank':
|
elif last_close == 'blank':
|
||||||
tab.openurl(QUrl('about:blank'))
|
self.openurl(QUrl('about:blank'), newtab=True)
|
||||||
elif last_close == 'startpage':
|
elif last_close == 'startpage':
|
||||||
tab.openurl(QUrl(config.get('general', 'startpage')[0]))
|
url = QUrl(config.get('general', 'startpage')[0])
|
||||||
elif last_close == 'default-page':
|
self.openurl(url, newtab=True)
|
||||||
tab.openurl(config.get('general', 'default-page'))
|
elif last_close == 'default-page':
|
||||||
|
url = config.get('general', 'default-page')
|
||||||
|
self.openurl(url, newtab=True)
|
||||||
|
|
||||||
def _remove_tab(self, tab):
|
def _remove_tab(self, tab):
|
||||||
"""Remove a tab from the tab list and delete it properly.
|
"""Remove a tab from the tab list and delete it properly.
|
||||||
|
Loading…
Reference in New Issue
Block a user