Display the renderer type in the About dialog (#3441)
* Now displaying the renderer type in the About dialog * Show the number of renderers per type in the About dialog * Use values instead of entries (key is unused) Co-Authored-By: onecamp <juancampa@gmail.com>
This commit is contained in:
parent
0dc8fb9ed4
commit
8733ecc84a
4 changed files with 47 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ const helpMenu = require('./menus/help');
|
|||
const darwinMenu = require('./menus/darwin');
|
||||
const {getDecoratedKeymaps} = require('../plugins');
|
||||
const {execCommand} = require('../commands');
|
||||
const {getRendererTypes} = require('../utils/renderer-utils');
|
||||
|
||||
const appName = app.getName();
|
||||
const appVersion = app.getVersion();
|
||||
|
|
@ -39,10 +40,18 @@ exports.createMenu = (createWindow, getLoadedPluginVersions) => {
|
|||
const pluginList =
|
||||
loadedPlugins.length === 0 ? 'none' : loadedPlugins.map(plugin => `\n ${plugin.name} (${plugin.version})`);
|
||||
|
||||
const rendererCounts = Object.values(getRendererTypes()).reduce((acc, type) => {
|
||||
acc[type] = acc[type] ? acc[type] + 1 : 1;
|
||||
return acc;
|
||||
}, {});
|
||||
const renderers = Object.entries(rendererCounts)
|
||||
.map(([type, count]) => type + (count > 1 ? ` (${count})` : ''))
|
||||
.join(', ');
|
||||
|
||||
dialog.showMessageBox({
|
||||
title: `About ${appName}`,
|
||||
message: `${appName} ${appVersion} (${updateChannel})`,
|
||||
detail: `Plugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2018 ZEIT, Inc.`,
|
||||
detail: `Renderers: ${renderers}\nPlugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2018 ZEIT, Inc.`,
|
||||
buttons: [],
|
||||
icon
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue