Add message to restart server after config change

This commit is contained in:
Patrick Nicolas
2025-11-19 14:16:15 +01:00
parent 01c4f0343a
commit 7c2057ec9e
9 changed files with 115 additions and 68 deletions
+42 -14
View File
@@ -11,10 +11,6 @@ Kirigami.ApplicationWindow {
id: root
title: i18n("WiVRn dashboard")
Settings {
id: config
}
ConnectUsbDialog {
id: select_usb_device
}
@@ -51,11 +47,6 @@ Kirigami.ApplicationWindow {
Connections {
target: WivrnServer
function onCapSysNiceChanged(value) {
if (WivrnServer.serverStatus != WivrnServer.Stopped)
restart_capsysnice.visible = true;
}
function onServerStatusChanged(value) {
var started = value == WivrnServer.Started;
@@ -79,10 +70,6 @@ Kirigami.ApplicationWindow {
switch_pairing.checked = WivrnServer.pairingEnabled;
}
function onJsonConfigurationChanged() {
config.load(WivrnServer);
}
function onServerError(info) {
console.log(info.where);
console.log(info.message);
@@ -184,6 +171,16 @@ Kirigami.ApplicationWindow {
}
}
]
Connections {
target: WivrnServer
function onCapSysNiceChanged(value) {
if (WivrnServer.serverStatus != WivrnServer.Stopped)
restart_capsysnice.visible = true;
}
function onServerStatusChanged(value) {
restart_capsysnice.visible = false;
}
}
}
Kirigami.InlineMessage {
@@ -213,7 +210,7 @@ Kirigami.ApplicationWindow {
text: i18n("No OpenVR compatibility detected, Steam games won't be able to load VR.\nInstall xrizer or OpenComposite.")
type: Kirigami.MessageType.Warning
showCloseButton: true
visible: WivrnServer.openVRCompat.length == 0 && config.openvr == ""
visible: WivrnServer.openVRCompat.length == 0 && Settings.openvr == ""
}
Kirigami.InlineMessage {
@@ -238,6 +235,37 @@ Kirigami.ApplicationWindow {
]
}
Kirigami.InlineMessage {
id: config_restart
Layout.fillWidth: true
text: i18n("Restart the server for configuration changes to take effect")
type: Kirigami.MessageType.Information
showCloseButton: true
visible: false
actions: [
Kirigami.Action {
text: i18nc("restart the server", "Restart now")
onTriggered: {
WivrnServer.restart_server();
config_restart.visible = false;
}
}
]
Connections {
target: Settings
function onSettingsChanged() {
if (WivrnServer.sessionRunning)
config_restart.visible = true;
}
}
Connections {
target: WivrnServer
function onServerStatusChanged(value) {
config_restart.visible = false;
}
}
}
Kirigami.InlineMessage {
id: message_failed_to_start
Layout.fillWidth: true