Add a new option tabs->tabs-are-windows.

This commit is contained in:
Florian Bruhin 2014-11-21 06:22:52 +01:00
parent 615be2a4bc
commit 8ec42908f1
2 changed files with 10 additions and 0 deletions

View File

@ -380,6 +380,10 @@ DATA = collections.OrderedDict([
('indicator-space',
SettingValue(typ.Int(minval=0), '3'),
"Spacing between tab edge and indicator."),
('tabs-are-windows',
SettingValue(typ.Bool(), 'false'),
"Whether to open windows instead of tabs."),
)),
('storage', sect.KeyValue(

View File

@ -320,6 +320,12 @@ class TabbedBrowser(tabwidget.TabWidget):
if url is not None:
qtutils.ensure_valid(url)
log.webview.debug("Creating new tab with URL {}".format(url))
if config.get('tabs', 'tabs-are-windows') and self.count() > 0:
from qutebrowser.widgets import mainwindow
window = mainwindow.MainWindow.spawn()
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=window)
return tabbed_browser.tabopen(url, background, explicit)
tab = webview.WebView(self._win_id, self)
self._connect_tab_signals(tab)
if explicit: