mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-20 17:11:36 -08:00
Fix config reset when selecting app
This commit is contained in:
1 parent
028e4a3384
commit
206ec71150
1 file changed
+3
-20
@@ -7,8 +7,6 @@ import io.github.wivrn.wivrn
|
||||
ColumnLayout {
|
||||
id: select_game
|
||||
|
||||
property bool json_loaded: false
|
||||
|
||||
Component.onCompleted: {
|
||||
apps.append({
|
||||
"name": i18nc("don't start an application automatically", "None"),
|
||||
@@ -75,13 +73,8 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
function reload() {
|
||||
select_game.json_loaded = false;
|
||||
load();
|
||||
}
|
||||
|
||||
function load() {
|
||||
if (select_game.json_loaded || WivrnServer.serverStatus != WivrnServer.Started || WivrnServer.jsonConfiguration == "")
|
||||
if (WivrnServer.jsonConfiguration == "")
|
||||
return;
|
||||
|
||||
Settings.load(WivrnServer);
|
||||
@@ -103,22 +96,12 @@ ColumnLayout {
|
||||
app_text.text = Settings.application;
|
||||
app_combobox.currentIndex = custom_idx;
|
||||
}
|
||||
|
||||
select_game.json_loaded = true;
|
||||
}
|
||||
|
||||
function save() {
|
||||
var new_application;
|
||||
|
||||
if (apps.get(app_combobox.currentIndex).is_custom)
|
||||
new_application = app_text.text;
|
||||
Settings.application = app_text.text;
|
||||
else
|
||||
new_application = apps.get(app_combobox.currentIndex).command;
|
||||
|
||||
Settings.load(WivrnServer);
|
||||
if (Settings.application != new_application) {
|
||||
Settings.application = new_application;
|
||||
Settings.save(WivrnServer);
|
||||
}
|
||||
Settings.application = apps.get(app_combobox.currentIndex).command;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user