fix: segfault gtk when using webkit

This commit is contained in:
Johannes Kirschbauer
2024-05-18 15:55:59 +02:00
committed by hsjobeki
parent bd34807055
commit 59b3981582
4 changed files with 62 additions and 27 deletions

View File

@@ -2,6 +2,7 @@ import logging
import threading
import gi
from clan_cli import machines
from clan_cli.history.list import list_history
from clan_vm_manager.components.interfaces import ClanConfig
@@ -11,7 +12,7 @@ from clan_vm_manager.singletons.use_vms import ClanStore
from clan_vm_manager.views.details import Details
from clan_vm_manager.views.list import ClanList
from clan_vm_manager.views.logs import Logs
from clan_vm_manager.views.webview import webview
from clan_vm_manager.views.webview import WebView
gi.require_version("Adw", "1")
@@ -59,6 +60,13 @@ class MainWindow(Adw.ApplicationWindow):
stack_view.add_named(ClanList(config), "list")
stack_view.add_named(Details(), "details")
stack_view.add_named(Logs(), "logs")
webview = WebView()
@webview.method
def list_machines(data: None) -> list[str]:
return machines.list.list_machines(".")
stack_view.add_named(webview.get_webview(), "webview")
stack_view.set_visible_child_name(config.initial_view)