use webview to diplay web docs upo pressing F1

This commit is contained in:
2023-01-23 11:44:20 +01:00
parent af51087bbe
commit 9e45f016db

View File

@ -9,6 +9,7 @@ from .menus import BarMenu
from .plotdesc import PlotDescription
from .rpc import RPCServerThread
from .shortcut import shortcut
from .webview import WebView
class MainWindow(QMainWindow):
@ -20,6 +21,9 @@ class MainWindow(QMainWindow):
self.setWindowTitle(title)
self.setWindowIcon(assets.icon())
url = f"http://{host}:{port}/"
self.webdoc = WebView(url, title=title)
self.lst = lst = DictList()
lst.setAlternatingRowColors(True)
lst.itemDoubleClicked.connect(self.on_dclick_list_item)
@ -47,7 +51,7 @@ class MainWindow(QMainWindow):
self.setCentralWidget(splitter)
rst = RPCServerThread(host, port, doc_title_suffix="grum")
rst = RPCServerThread(host, port, doc_title_suffix=title)
rst.start()
rst.server.register_function(self.new_plot)
rst.server.register_function(self.append_data)
@ -55,6 +59,11 @@ class MainWindow(QMainWindow):
self.sig_make_new_plot.connect(self.on_make_new_plot)
def keyPressEvent(self, event):
if event.key() == Qt.Key_F1:
self.webdoc.show()
# Remote API calls
def new_plot(self, name, cfg):