1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-07-15 10:28:46 +00:00

Added about dialog

This commit is contained in:
Michael Hollister 2024-11-19 09:54:50 -06:00
parent 795393e69a
commit ff19f76f7e
2 changed files with 25 additions and 2 deletions

View file

@ -92,6 +92,26 @@ export default class Main {
label: 'Check for updates', label: 'Check for updates',
click: async () => { await Main.checkForUpdates(false); }, click: async () => { await Main.checkForUpdates(false); },
}, },
{
label: 'About',
click: async () => {
let aboutMessage = `Version: ${Main.application.getVersion()}\nRelease channel: ${Updater.releaseChannel}\n`;
if (Updater.releaseChannel !== 'stable') {
aboutMessage += `Release channel version: ${Updater.getChannelVersion()}\n`;
}
aboutMessage += `OS: ${process.platform} ${process.arch}\n`;
await dialog.showMessageBox({
type: 'info',
title: 'Fcast Receiver',
message: aboutMessage,
buttons: ['OK'],
defaultId: 0
});
},
},
{ {
type: 'separator', type: 'separator',
}, },
@ -413,7 +433,8 @@ export default class Main {
}, },
}); });
Main.logger = log4js.getLogger(); Main.logger = log4js.getLogger();
Main.logger.info(`Starting application: ${app.name} (${app.getVersion()} - ${Updater.getChannelVersion()}) | ${app.getAppPath()}`); Main.logger.info(`Starting application: ${app.name} (${app.getVersion()} - ${Updater.releaseChannel} - ${Updater.getChannelVersion()}) | ${app.getAppPath()}`);
Main.logger.info(`OS: ${process.platform} ${process.arch}`);
if (isUpdating) { if (isUpdating) {
await Updater.processUpdate(); await Updater.processUpdate();

View file

@ -62,13 +62,14 @@ export class Updater {
public static updateDownloaded: boolean = false; public static updateDownloaded: boolean = false;
public static updateProgress: number = 0; public static updateProgress: number = 0;
public static checkForUpdatesOnStart: boolean = true; public static checkForUpdatesOnStart: boolean = true;
public static releaseChannel = 'stable';
static { static {
Updater.localPackageJson = JSON.parse(fs.readFileSync(path.join(Updater.appPath, './package.json'), 'utf8')); Updater.localPackageJson = JSON.parse(fs.readFileSync(path.join(Updater.appPath, './package.json'), 'utf8'));
let updaterSettings = Store.get('updater'); let updaterSettings = Store.get('updater');
if (updaterSettings !== null) { if (updaterSettings !== null) {
Updater.localPackageJson.channel = updaterSettings.channel === undefined ? 'stable' : updaterSettings.channel; Updater.localPackageJson.channel = updaterSettings.channel === undefined ? Updater.localPackageJson.channel : updaterSettings.channel;
Updater.checkForUpdatesOnStart = updaterSettings.checkForUpdatesOnStart === undefined ? true : updaterSettings.checkForUpdatesOnStart; Updater.checkForUpdatesOnStart = updaterSettings.checkForUpdatesOnStart === undefined ? true : updaterSettings.checkForUpdatesOnStart;
} }
@ -77,6 +78,7 @@ export class Updater {
'checkForUpdatesOnStart': Updater.checkForUpdatesOnStart, 'checkForUpdatesOnStart': Updater.checkForUpdatesOnStart,
} }
Updater.releaseChannel = Updater.localPackageJson.channel;
Store.set('updater', updaterSettings); Store.set('updater', updaterSettings);
} }