Merge branch 'master' into #184-Get-Github-Commit-into-version-number

This commit is contained in:
UKDTOM 2020-10-18 15:15:30 +02:00
commit 89d777e416
4 changed files with 54 additions and 4 deletions

View file

@ -8,6 +8,7 @@
* [#173 Sidebar not updated when changing languages](https://github.com/WebTools-NG/WebTools-NG/issues/173)
* [#184 Get Github Commit into version number](https://github.com/WebTools-NG/WebTools-NG/issues/184)
* [#154 Added a about page for version, platform, architecture information.](https://github.com/WebTools-NG/WebTools-NG/issues/154)
## V0.1.7

View file

@ -70,7 +70,13 @@
"menuHelp": "Help",
"menuForum": "Forums",
"menuGithub": "Github",
"menuManual": "Manual"
"menuManual": "Manual",
"menuAbout": "About WebTools",
"menuAboutText":{
"menuAboutVersion":"Version",
"menuAboutPlatform":"Platform",
"menuAboutArchitecture": "Architecture"
}
},
"Sidebar": {
"NavSections":{
@ -103,6 +109,7 @@
},
"Ok": "OK",
"Reload": "Reload",
"Copy": "Copy",
"Update" : {
"Title": "Update detected",
"Body": "{0} was released on Github on: {1}.",

View file

@ -1,6 +1,11 @@
import i18n from '../../../i18n'
import { shell } from 'electron'
import { wtutils} from '../../modules/General/wtutils';
import { shell, clipboard } from 'electron'
import { wtutils, dialog } from '../../modules/General/wtutils';
const aboutInformation =
(i18n.t("Common.Menu.Help.menuAboutText.menuAboutVersion") +": " + wtutils.AppVersion) + '\n' +
(i18n.t('Common.Menu.Help.menuAboutText.menuAboutPlatform') +": " + wtutils.Platform) + '\n' +
(i18n.t('Common.Menu.Help.menuAboutText.menuAboutArchitecture') +": " + process.arch)
// Menu template
const menuTemplate = [
@ -129,6 +134,23 @@ 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"),
i18n.t("Common.Copy"),
aboutInformation).then(
result => {
if (result.response === 1) {
console.log("copy pressed")
clipboard.writeText(aboutInformation);
}
}
)
}
}
]
}

View file

@ -3,6 +3,8 @@ 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;
const electron = require('electron');
@ -326,7 +328,25 @@ const wtutils = new class WTUtils {
const dialog = new class Dialog {
constructor() {
}
}
AboutWindow(Title, OKLabel, CopyLabel, aboutInformation)
{
log.debug('Open AboutWindow Dialog')
const {remote} = require('electron'),
dialog = remote.dialog,
WIN = remote.getCurrentWindow();
let options = {
buttons: [OKLabel, CopyLabel],
title: Title,
message: 'WebTools-NG',
detail: aboutInformation,
type: 'info',
noLink: true
}
let aboutWindow = dialog.showMessageBox(WIN, options)
return aboutWindow
}
OpenDirectory(Title, OKLabel)
{