From 87ea5e5ee47c80f3f097e5e62a03b45bb4108fea Mon Sep 17 00:00:00 2001 From: salman Date: Wed, 22 Apr 2026 16:53:23 +0200 Subject: [PATCH] Clean up menus and unused menu items --- main.js | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/main.js b/main.js index bc0952b..89429a9 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,33 @@ const { app, BrowserWindow, Menu, dialog, ipcMain, fs } = require('electron'); +function showAboutDialog(parentWindow) { + const detail = [ + 'TRIM.SP simulation GUI for low-energy ion implantation studies.', + `Version: ${app.getVersion()}`, + 'License: GNU General Public License v2 (GPL-2.0).', + 'Maintained by the Low Energy Muons group at the Paul Scherrer Institute.', + 'Main contributor: Zaher Salman.', + '', + 'Key references:', + 'J. P. Biersack and W. Eckstein, Appl. Phys. A 34, 73-94 (1984).', + 'W. Eckstein, Computer Simulation of Ion-Solid Interactions (1991).', + 'E. Morenzoni et al., NIM B 192, 245-266 (2002).', + '', + 'Project repositories:', + 'Bitbucket: bitbucket.org/zaher-salman/trimsp', + 'Gitea: gitea.psi.ch/LMU/TRIMSP' + ].join('\n'); + + dialog.showMessageBox(parentWindow, { + type: 'info', + title: 'About TrimSP', + message: 'TrimSP', + detail: detail, + buttons: ['OK'], + icon: parentWindow ? undefined : undefined + }); +} + // Some Linux/remote desktop setups expose a broken GPU context to Electron. // Fall back to software rendering instead of crashing on startup. app.disableHardwareAcceleration(); @@ -214,18 +242,12 @@ function createWindow () { { role: 'viewMenu' }, - { - role: 'windowMenu' - }, { role: 'help', submenu: [ { - role: 'about' - }, - { - label: 'Learn More', - click () { require('electron').shell.openExternal('http://electron.atom.io') } + label: 'About TrimSP', + click () { showAboutDialog(win); } } ] }