From 1345a13a717f1ee130b315157050970ce477e3be Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Apr 2015 17:35:53 +0200 Subject: [PATCH] Add startpage/default-page to tabs -> last-close. --- doc/help/settings.asciidoc | 2 ++ qutebrowser/config/configtypes.py | 2 ++ qutebrowser/mainwindow/tabbedbrowser.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index c78f86495..93d290e34 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -862,6 +862,8 @@ Valid values: * +ignore+: Don't do anything. * +blank+: Load a blank page. + * +startpage+: Load the start page. + * +default-page+: Load the default page. * +close+: Close the window. Default: +pass:[ignore]+ diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index af4474c8a..b0523f5f4 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1337,6 +1337,8 @@ class LastClose(BaseType): valid_values = ValidValues(('ignore', "Don't do anything."), ('blank', "Load a blank page."), + ('startpage', "Load the start page."), + ('default-page', "Load the default page."), ('close', "Close the window.")) diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 30cdf1245..4445f716c 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -249,6 +249,10 @@ class TabbedBrowser(tabwidget.TabWidget): self.close_window.emit() elif last_close == 'blank': tab.openurl(QUrl('about:blank')) + elif last_close == 'startpage': + tab.openurl(QUrl(config.get('general', 'startpage')[0])) + elif last_close == 'default-page': + tab.openurl(config.get('general', 'default-page')) def _remove_tab(self, tab): """Remove a tab from the tab list and delete it properly.