Fix system checks self-disabling in dashboard
This commit is contained in:
@@ -27,11 +27,16 @@ target_sources(wivrn-dashboard PRIVATE ${DBUS_INTERFACE_SRC})
|
||||
|
||||
set_source_files_properties(../images/wivrn.svg PROPERTIES QT_RESOURCE_ALIAS qml/wivrn.svg)
|
||||
|
||||
set_source_files_properties(qml/DashboardSettings.qml PROPERTIES
|
||||
QT_QML_SINGLETON_TYPE TRUE
|
||||
)
|
||||
|
||||
qt_add_qml_module(wivrn-dashboard
|
||||
URI io.github.wivrn.wivrn
|
||||
QML_FILES
|
||||
qml/Main.qml
|
||||
qml/ApkInstallPage.qml
|
||||
qml/DashboardSettings.qml
|
||||
qml/SettingsPage.qml
|
||||
qml/HeadsetsPage.qml
|
||||
qml/HeadsetStatsPage.qml
|
||||
@@ -50,7 +55,6 @@ qt_add_qml_module(wivrn-dashboard
|
||||
qml/Github.svg
|
||||
)
|
||||
|
||||
|
||||
configure_file(gui_config.h.in gui_config.h)
|
||||
configure_file(io.github.wivrn.wivrn.desktop.in io.github.wivrn.wivrn.desktop)
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
pragma Singleton
|
||||
|
||||
import QtCore
|
||||
|
||||
Settings {
|
||||
property bool first_run: true
|
||||
property bool show_system_checks: true
|
||||
property string last_run_version: ""
|
||||
|
||||
property bool adb_custom: false
|
||||
property string adb_location: ""
|
||||
}
|
||||
|
||||
+8
-17
@@ -42,15 +42,6 @@ Kirigami.ApplicationWindow {
|
||||
|
||||
onClosing: Qt.quit()
|
||||
|
||||
Core.Settings {
|
||||
id: settings
|
||||
property alias first_run: root.first_run
|
||||
property alias last_run_version: root.last_run_version
|
||||
property bool show_system_checks: true
|
||||
}
|
||||
property bool first_run: true
|
||||
property string last_run_version
|
||||
|
||||
width: 900
|
||||
height: 800
|
||||
|
||||
@@ -76,10 +67,10 @@ Kirigami.ApplicationWindow {
|
||||
if (value == WivrnServer.FailedToStart)
|
||||
message_failed_to_start.visible = true;
|
||||
|
||||
if (root.first_run && started) {
|
||||
if (DashboardSettings.first_run && started) {
|
||||
console.log("First run");
|
||||
root.pageStack.push(Qt.createComponent("WizardPage.qml").createObject());
|
||||
root.first_run = false;
|
||||
DashboardSettings.first_run = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,8 +100,8 @@ Kirigami.ApplicationWindow {
|
||||
if (WivrnServer.serverStatus == WivrnServer.Stopped)
|
||||
WivrnServer.start_server();
|
||||
|
||||
if (root.last_run_version != ApkInstaller.currentVersion) {
|
||||
root.last_run_version = ApkInstaller.currentVersion;
|
||||
if (DashboardSettings.last_run_version != ApkInstaller.currentVersion) {
|
||||
DashboardSettings.last_run_version = ApkInstaller.currentVersion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +121,7 @@ Kirigami.ApplicationWindow {
|
||||
text: i18n("Avahi daemon is not installed")
|
||||
type: Kirigami.MessageType.Warning
|
||||
showCloseButton: true
|
||||
visible: settings.show_system_checks && !Avahi.installed
|
||||
visible: DashboardSettings.show_system_checks && !Avahi.installed
|
||||
}
|
||||
|
||||
Kirigami.InlineMessage {
|
||||
@@ -138,7 +129,7 @@ Kirigami.ApplicationWindow {
|
||||
text: i18n("Avahi daemon is not started")
|
||||
type: Kirigami.MessageType.Warning
|
||||
showCloseButton: true
|
||||
visible: settings.show_system_checks && Avahi.installed && !Avahi.running
|
||||
visible: DashboardSettings.show_system_checks && Avahi.installed && !Avahi.running
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
visible: Avahi.canStart
|
||||
@@ -154,7 +145,7 @@ Kirigami.ApplicationWindow {
|
||||
// type: Kirigami.MessageType.Warning
|
||||
type: Kirigami.MessageType.Information
|
||||
showCloseButton: true
|
||||
visible: settings.show_system_checks && !WivrnServer.capSysNice
|
||||
visible: DashboardSettings.show_system_checks && !WivrnServer.capSysNice
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: i18n("Fix it")
|
||||
@@ -168,7 +159,7 @@ Kirigami.ApplicationWindow {
|
||||
text: i18n("Firewall may not allow port 9757")
|
||||
type: Kirigami.MessageType.Warning
|
||||
showCloseButton: true
|
||||
visible: settings.show_system_checks && Firewall.needSetup
|
||||
visible: DashboardSettings.show_system_checks && Firewall.needSetup
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: i18n("Fix it")
|
||||
|
||||
@@ -19,14 +19,6 @@ Kirigami.ScrollablePage {
|
||||
id: config
|
||||
}
|
||||
|
||||
Core.Settings {
|
||||
property alias adb_custom: settings.adb_custom
|
||||
property alias adb_location: settings.adb_location
|
||||
property alias show_system_checks: show_system_checks.checked
|
||||
}
|
||||
property bool adb_custom
|
||||
property string adb_location
|
||||
|
||||
ColumnLayout {
|
||||
id: column
|
||||
anchors.fill: parent
|
||||
@@ -272,7 +264,7 @@ Kirigami.ScrollablePage {
|
||||
enabled: adb_custom.checked
|
||||
Controls.TextField {
|
||||
id: adb_location
|
||||
placeholderText: settings.adb_location
|
||||
placeholderText: DashboardSettings.adb_location
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Controls.Button {
|
||||
@@ -383,9 +375,11 @@ Kirigami.ScrollablePage {
|
||||
} else {
|
||||
config.openvr = openvr.value
|
||||
}
|
||||
settings.adb_custom = adb_custom.checked;
|
||||
settings.adb_location = adb_location.text;
|
||||
Adb.setPath(adb_custom.checked ? adb_location.text : "adb");
|
||||
DashboardSettings.adb_custom = adb_custom.checked;
|
||||
DashboardSettings.adb_location = adb_location.text;
|
||||
Adb.setPath(DashboardSettings.adb_custom.checked ? adb_location.text : "adb");
|
||||
|
||||
DashboardSettings.show_system_checks = show_system_checks.checked;
|
||||
|
||||
config.debugGui = debug_gui.checked;
|
||||
config.steamVrLh = steamvr_lh.checked;
|
||||
@@ -403,8 +397,10 @@ Kirigami.ScrollablePage {
|
||||
|
||||
openvr_combobox.load()
|
||||
|
||||
adb_custom.checked = settings.adb_custom;
|
||||
adb_location.text = settings.adb_location;
|
||||
adb_custom.checked = DashboardSettings.adb_custom;
|
||||
adb_location.text = DashboardSettings.adb_location;
|
||||
|
||||
show_system_checks.checked = DashboardSettings.show_system_checks;
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
|
||||
Reference in New Issue
Block a user