Add open command
This commit is contained in:
parent
1b759512bb
commit
e31e15b34a
@ -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_())
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user