From e31e15b34a2067945cad294c45e26550762d2a39 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Dec 2013 22:01:06 +0100 Subject: [PATCH] Add open command --- qutebrowser/app.py | 4 ++++ qutebrowser/browser.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 17a9c8e14..31d1da1ac 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -1,11 +1,15 @@ import sys from PyQt5.QtWidgets import QWidget, QApplication from qutebrowser.widgets.mainwindow import MainWindow +from qutebrowser.commands import CommandParser def main(): app = QApplication(sys.argv) mw = MainWindow() + cp = CommandParser() + mw.status.cmd.editingFinished.connect(lambda: cp.parse(mw.status.cmd.text())) + cp.openurl.connect(mw.tabs.openurl) mw.show() sys.exit(app.exec_()) diff --git a/qutebrowser/browser.py b/qutebrowser/browser.py index f58c5e3be..cf433d32a 100644 --- a/qutebrowser/browser.py +++ b/qutebrowser/browser.py @@ -16,6 +16,11 @@ class TabbedBrowser(TabWidget): self.tabs.append(tab) self.addTab(tab, url) + @pyqtSlot(str) + def openurl(self, url): + tab = self.tabs[self.currentIndex()] + tab.openurl(url) + class BrowserTab(QWebView): def __init__(self, parent): super().__init__(parent)