added info window with version, shell, renderer, Node, Architecture. Version can be translated.

This commit is contained in:
CPSO 2020-10-10 14:59:42 +02:00
parent 59a8a82c15
commit c38c3da265
3 changed files with 42 additions and 2 deletions

View file

@ -70,7 +70,12 @@
"menuHelp": "Help",
"menuForum": "Forums",
"menuGithub": "Github",
"menuManual": "Manual"
"menuManual": "Manual",
"menuAbout": "About WebTools",
"menuAboutText":{
"menuAboutVersion":"Version"
}
},
"Sidebar": {
"NavSections":{

View file

@ -1,6 +1,6 @@
import i18n from '../../../i18n'
import { shell } from 'electron'
import { wtutils} from '../../modules/General/wtutils';
import { wtutils, dialog} from '../../modules/General/wtutils';
// Menu template
const menuTemplate = [
@ -129,6 +129,11 @@ const menuTemplate = [
{
label: i18n.t("Common.Menu.Help.menuManual"),
click: () => { shell.openExternal("https://github.com/WebTools-NG/WebTools-NG/wiki") }
},
{
label: i18n.t("Common.Menu.Help.menuAbout"),
click: () => { dialog.AboutWindow( i18n.t("Common.Menu.Help.menuAbout"), i18n.t("Common.Ok"));
}
}
]
}

View file

@ -2,6 +2,7 @@
This file contains different functions and methods
that we use in our solution.
*/
import i18n from '../../../i18n'
const log = require('electron-log');
console.log = log.log;
@ -277,6 +278,35 @@ const dialog = new class Dialog {
log.debug('Returned directoryname is: ' + dirName)
return dirName
}
AboutWindow(Title, OKLabel)
{
log.debug('Open AboutWindow Dialog')
const {remote} = require('electron'),
dialog = remote.dialog,
WIN = remote.getCurrentWindow();
const aboutInformation =
(i18n.t("Common.Menu.Help.menuAboutText.menuAboutVersion") +": " + wtutils.AppVersion) +
'\nShell: ' + process.versions.electron +
'\nRenderer: ' + process.versions.chrome +
'\nNode: ' + process.versions.node +
'\nArchitecture: ' + process.arch;
let options = {
buttonLabel : OKLabel,
title: Title,
message: 'WebTools-NG',
detail: aboutInformation,
type: 'info',
noLink: true,
}
let aboutWindow = dialog.showMessageBox(WIN, options)
return aboutWindow
}
SaveFile(title, defaultPath, OKLabel) {