Add open command

This commit is contained in:
Florian Bruhin 2013-12-16 22:01:06 +01:00
parent 1b759512bb
commit e31e15b34a
2 changed files with 9 additions and 0 deletions

View File

@ -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_())

View File

@ -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)