mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-27 16:10:32 +00:00
add buttons in electron to show rns config and meshchat database files in containing folder
This commit is contained in:
parent
5c4d342d78
commit
b7f4123946
3 changed files with 43 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
|||
const { app, BrowserWindow, dialog, ipcMain, systemPreferences } = require('electron');
|
||||
const { app, BrowserWindow, dialog, ipcMain, shell, systemPreferences } = require('electron');
|
||||
const electronPrompt = require('electron-prompt');
|
||||
const { spawn } = require('child_process');
|
||||
const fs = require('fs');
|
||||
|
|
@ -11,7 +11,7 @@ var mainWindow = null;
|
|||
var exeChildProcess = null;
|
||||
|
||||
// allow fetching app version via ipc
|
||||
ipcMain.handle('app-version', async() => {
|
||||
ipcMain.handle('app-version', () => {
|
||||
return app.getVersion();
|
||||
});
|
||||
|
||||
|
|
@ -36,11 +36,16 @@ ipcMain.handle('prompt', async(event, message) => {
|
|||
});
|
||||
|
||||
// allow relaunching app via ipc
|
||||
ipcMain.handle('relaunch', async() => {
|
||||
ipcMain.handle('relaunch', () => {
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
});
|
||||
|
||||
// allow showing a file path in os file manager
|
||||
ipcMain.handle('showPathInFolder', (event, path) => {
|
||||
shell.showItemInFolder(path);
|
||||
});
|
||||
|
||||
function log(message) {
|
||||
|
||||
// make sure main window exists
|
||||
|
|
|
|||
|
|
@ -25,4 +25,9 @@ contextBridge.exposeInMainWorld('electron', {
|
|||
return await ipcRenderer.invoke('relaunch');
|
||||
},
|
||||
|
||||
// allow showing a file path in os file manager
|
||||
showPathInFolder: async function(path) {
|
||||
return await ipcRenderer.invoke('showPathInFolder', path);
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue