diff --git a/dashboard/qml/SelectGame.qml b/dashboard/qml/SelectGame.qml index cd35a9bf..58728728 100644 --- a/dashboard/qml/SelectGame.qml +++ b/dashboard/qml/SelectGame.qml @@ -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; } }