From 9dccdb0b0335f82aa9f2e63642f16ff0f2699528 Mon Sep 17 00:00:00 2001
From: Jan <sentrycraft123@gmail.com>
Date: Tue, 18 Jul 2023 14:26:20 +0200
Subject: feat: Add basic Proton management (#383)

Adds logic to install, remove, and check existing install of NorthstarProton.
---
 src-vue/src/views/DeveloperView.vue | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

(limited to 'src-vue/src/views/DeveloperView.vue')

diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue
index 500c9c35..28ab3892 100644
--- a/src-vue/src/views/DeveloperView.vue
+++ b/src-vue/src/views/DeveloperView.vue
@@ -21,6 +21,18 @@
                 Check NSProton Compatibility
             </el-button>
 
+            <el-button type="primary" @click="installNSProton">
+                Install NSProton
+            </el-button>
+
+            <el-button type="primary" @click="uninstallNSProton">
+                Remove NSProton
+            </el-button>
+
+            <el-button type="primary" @click="getLocalNSProtonVersion">
+                Get local NSProton Version
+            </el-button>
+
             <h3>Testing:</h3>
 
             <el-button type="primary" @click="launchGameWithoutChecks">
@@ -308,6 +320,22 @@ export default defineComponent({
                     notification.close();
                 });
         },
+        async installNSProton() {
+            showNotification(`Started NSProton install`);
+            await invoke("install_northstar_proton_wrapper")
+                .then((message) => { showNotification(`Done`); })
+                .catch((error) => { showNotification(`Error`, error, "error"); })
+        },
+        async uninstallNSProton() {
+            await invoke("uninstall_northstar_proton_wrapper")
+                .then((message) => { showNotification(`Done`); })
+                .catch((error) => { showNotification(`Error`, error, "error"); })
+        },
+        async getLocalNSProtonVersion() {
+            await invoke("get_local_northstar_proton_wrapper_version")
+                .then((message) => { showNotification(`NSProton Version`, message as string); })
+                .catch((error) => { showNotification(`Error`, error, "error"); })
+        },
     }
 });
 </script>
-- 
cgit v1.2.3

