aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src-vue/src/views')
-rw-r--r--src-vue/src/views/DeveloperView.vue4
-rw-r--r--src-vue/src/views/RepairView.vue4
-rw-r--r--src-vue/src/views/SettingsView.vue56
3 files changed, 56 insertions, 8 deletions
diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue
index 206d425b..1b455452 100644
--- a/src-vue/src/views/DeveloperView.vue
+++ b/src-vue/src/views/DeveloperView.vue
@@ -249,7 +249,7 @@ export default defineComponent({
},
async installMod() {
let mod_to_install = this.mod_to_install_field_string;
- await invoke<string>("install_mod_caller", { gameInstall: this.$store.state.game_install, thunderstoreModString: mod_to_install }).then((message) => {
+ await invoke<string>("install_mod_wrapper", { gameInstall: this.$store.state.game_install, thunderstoreModString: mod_to_install }).then((message) => {
// Show user notification if mod install completed.
showNotification(`Installed ${mod_to_install}`, message);
})
@@ -317,7 +317,7 @@ export default defineComponent({
0
);
- let install_northstar_result = invoke("install_northstar_caller", { gameInstall: this.$store.state.game_install, northstarPackageName: this.selected_ns_version.value.package, versionNumber: this.selected_ns_version.value.version });
+ let install_northstar_result = invoke("install_northstar_wrapper", { gameInstall: this.$store.state.game_install, northstarPackageName: this.selected_ns_version.value.package, versionNumber: this.selected_ns_version.value.version });
await install_northstar_result
.then((message) => {
diff --git a/src-vue/src/views/RepairView.vue b/src-vue/src/views/RepairView.vue
index ce7e154d..341dff2d 100644
--- a/src-vue/src/views/RepairView.vue
+++ b/src-vue/src/views/RepairView.vue
@@ -75,7 +75,7 @@ export default defineComponent({
0
);
- let install_northstar_result = invoke("install_northstar_caller", { gameInstall: this.$store.state.game_install, northstarPackageName: ReleaseCanal.RELEASE });
+ let install_northstar_result = invoke("install_northstar_wrapper", { gameInstall: this.$store.state.game_install, northstarPackageName: ReleaseCanal.RELEASE });
appWindow.listen<InstallProgress>(
'northstar-install-download-progress',
@@ -102,7 +102,7 @@ export default defineComponent({
});
},
async cleanUpDownloadFolder() {
- await invoke("clean_up_download_folder_caller", { gameInstall: this.$store.state.game_install, force: true }).then((message) => {
+ await invoke("clean_up_download_folder_wrapper", { gameInstall: this.$store.state.game_install, force: true }).then((message) => {
// Show user notification if task completed.
showNotification(this.$t('generic.done'), this.$t('generic.done'));
})
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index b1a62c56..70bffbc5 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -6,6 +6,23 @@
>
<el-table :data="availableProfiles" >
<el-table-column prop="name" label="Name" />
+ <el-table-column align="right">
+ <template #default="scope">
+ <el-popconfirm
+ v-if="scope.row.name != 'R2Northstar'"
+ :title="$t('settings.profile.dialog.delete_confirm')"
+ :confirm-button-text="$t('generic.yes')"
+ :cancel-button-text="$t('generic.no')"
+ @confirm="deleteProfile(scope.row.name)"
+ >
+ <template #reference>
+ <el-button type="danger">
+ {{ $t('settings.profile.dialog.delete') }}
+ </el-button>
+ </template>
+ </el-popconfirm>
+ </template>
+ </el-table-column>
</el-table>
</el-dialog>
@@ -34,9 +51,9 @@
<!-- Northstar Active Profile -->
<div class="fc_parameter__panel" v-if="$store.state.developer_mode">
<h3>{{ $t('settings.profile.active') }}</h3>
- <el-dropdown trigger="click">
+ <el-dropdown trigger="click" :disabled="!availableProfiles.length">
<el-button>
- {{ $store.state.game_install.profile }} <el-icon class="el-icon--right"><arrow-down /></el-icon>
+ {{ activeProfile }} <el-icon class="el-icon--right" v-if="availableProfiles.length"><arrow-down /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
@@ -173,7 +190,10 @@ export default defineComponent({
await persistentStore.save(); // explicit save to disk
}
},
- availableProfiles(): Object {
+ activeProfile(): String {
+ return this.$store.state.game_install.profile || "None";
+ },
+ availableProfiles(): Object[] {
let profiles = this.$store.state.available_profiles
// convert string array to object array so we can fill a table
@@ -209,6 +229,15 @@ export default defineComponent({
});
},
async openGameInstallFolder() {
+ // Verify the game path is actually set
+ if (!this.$store.state.game_install.game_path) {
+ showErrorNotification(
+ i18n.global.tc('notification.game_folder.not_found.text'),
+ i18n.global.tc('notification.game_folder.not_found.title')
+ );
+ return;
+ }
+
// Opens the folder in default file explorer application
await open(`${this.$store.state.game_install.game_path}`);
},
@@ -244,10 +273,29 @@ export default defineComponent({
console.error(error);
showErrorNotification(error);
});
- }
+ },
+ async deleteProfile(profile: string) {
+ let store = this.$store;
+ await invoke("delete_profile", {
+ gameInstall: store.state.game_install,
+ profile: profile,
+ }).then(async (message) => {
+ if (profile == store.state.game_install.profile)
+ {
+ // trying to delete the active profile, lets switch to the default profile
+ await this.switchProfile("R2Northstar");
+ }
+ store.commit('fetchProfiles');
+ showNotification('Success');
+ }).catch((error) => {
+ console.error(error);
+ showErrorNotification(error);
+ });
+ },
},
mounted() {
document.querySelector('input')!.disabled = true;
+ this.$store.commit('fetchProfiles');
},
unmounted() {
if (('' + this.modsPerPage) === '') {