aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js
index 2a7f4d7..a097525 100644
--- a/src/index.js
+++ b/src/index.js
@@ -216,12 +216,12 @@ ipcMain.on("update-northstar", async () => {
})
ipcMain.on("setpath-cli", () => {gamepath.set()});
-ipcMain.on("setpath", (event, value) => {
+ipcMain.on("setpath", (event, value, force_dialog) => {
if (! value) {
if (! win.isVisible()) {
- gamepath.set(win);
+ gamepath.set(win, force_dialog);
} else {
- gamepath.set(win, true);
+ gamepath.set(win, force_dialog || true);
}
} else if (! win.isVisible()) {
win.show();
@@ -288,6 +288,24 @@ ipcMain.on("newpath", (event, newpath) => {
win.send("wrong-path");
});
+ipcMain.on("found-missing-perms", async (e, selected_gamepath) => {
+ await win_show.alert(lang("gui.gamepath.found_missing_perms") + selected_gamepath);
+ ipcMain.emit("setpath", null, false, true);
+})
+
+ipcMain.on("missing-perms", async (e, selected_gamepath) => {
+ await win_show.alert(lang("gui.gamepath.missing_perms") + selected_gamepath);
+ ipcMain.emit("setpath");
+})
+
+ipcMain.on("gamepath-lost-perms", async (e, selected_gamepath) => {
+ if (! gamepath.setting) {
+ gamepath.setting = true;
+ await win_show.alert(lang("gui.gamepath.lost_perms") + selected_gamepath);
+ ipcMain.emit("setpath");
+ }
+})
+
// starts the GUI or CLI
if (cli.hasArgs()) {
if (cli.hasParam("update-viper")) {