Feat: Add Configuration Button. user can edit config.json as wanted. Linked and IPC

This commit is contained in:
MasterAcnolo
2026-01-15 16:01:24 +01:00
parent 5398fed928
commit 163faec221
4 changed files with 15 additions and 1 deletions

10
main.js
View File

@@ -11,6 +11,13 @@ const { startRPC } = require("./server/discordRPC");
let mainWindow;
const logsFolderPath = logDir;
const basePath = config.localMode
? path.join(__dirname, "config")
: path.join(path.dirname(process.execPath), "resources");
const configFolderPath = path.join(basePath, "config.json");
const defaultDownloadPath = path.join(os.homedir(), "Downloads", "Freedom Loader");
app.setAppUserModelId("com.masteracnolo.freedomloader"); // pour notifications Windows
@@ -176,6 +183,9 @@ ipcMain.on("open-website", () => {
ipcMain.on("open-wiki", () => {
shell.openExternal("https://masteracnolo.github.io/FreedomLoader/pages/wiki.html");
});
ipcMain.on("open-config", () => {
if (configFolderPath) shell.openPath(configFolderPath);
});
// App ready

View File

@@ -17,5 +17,6 @@ contextBridge.exposeInMainWorld("topbarAPI", {
openDevTools: () => ipcRenderer.send("open-devtools"),
openLogs: () => ipcRenderer.send("open-logs"),
openWebsite: () => ipcRenderer.send("open-website"),
openWiki: () => ipcRenderer.send("open-wiki")
openWiki: () => ipcRenderer.send("open-wiki"),
openConfig: () => ipcRenderer.send("open-config")
});

View File

@@ -23,6 +23,7 @@
<button id="logs-btn" title="Logs">Logs</button>
<button id="website-btn" title="Website">Website</button>
<button id="wiki-btn" title="Wiki">Wiki</button>
<button id="config-btn" title="Configuration">Configuration</button>
</div>
<div class="window-controls">
<button id="minimize-btn" title="Réduire"><img src="assets/icon/minimize.svg"></button>

View File

@@ -10,6 +10,7 @@ function setupTopbarListeners() {
const logsBtn = document.getElementById('logs-btn');
const websiteBtn = document.getElementById('website-btn');
const wikiBtn = document.getElementById('wiki-btn');
const configBtn = document.getElementById('config-btn');
if (minBtn) minBtn.onclick = () => topbarAPI.minimize();
if (maxBtn) maxBtn.onclick = () => topbarAPI.maximize();
@@ -18,6 +19,7 @@ function setupTopbarListeners() {
if (logsBtn) logsBtn.onclick = () => topbarAPI.openLogs();
if (websiteBtn) websiteBtn.onclick = () => topbarAPI.openWebsite();
if (wikiBtn) wikiBtn.onclick = () => topbarAPI.openWiki();
if (configBtn) configBtn.onclick = () => topbarAPI.openConfig();
});
}