From e9d57e8b73e57740bbb09c2424ca808a5bceffbb Mon Sep 17 00:00:00 2001 From: Jessica Schilling Date: Tue, 4 Aug 2020 16:35:41 -0600 Subject: [PATCH 1/3] Stub menu item and hover state --- assets/locales/en.json | 1 + src/tray.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/locales/en.json b/assets/locales/en.json index 18d69c0a0..45b24324b 100644 --- a/assets/locales/en.json +++ b/assets/locales/en.json @@ -5,6 +5,7 @@ "ipfsIsNotRunning": "IPFS is Not Running", "ipfsHasErrored": "IPFS has Errored", "runningWithGC": "Running (GC in progress)", + "numberOfPeers": "Foo Peers", "start": "Start", "stop": "Stop", "restart": "Restart", diff --git a/src/tray.js b/src/tray.js index e6b308247..a6ff4f6b9 100644 --- a/src/tray.js +++ b/src/tray.js @@ -56,6 +56,11 @@ function buildMenu (ctx) { enabled: false, icon: path.resolve(path.join(__dirname, `../assets/icons/status/${color}.png`)) })), + { + id: 'numberOfPeers', + label: i18n.t('numberOfPeers'), + enabled: false + }, { id: 'restartIpfs', label: i18n.t('restart'), @@ -258,7 +263,7 @@ module.exports = function (ctx) { menu = buildMenu(ctx) tray.setContextMenu(menu) - tray.setToolTip('IPFS Desktop') + tray.setToolTip('Foo Peers') menu.on('menu-will-show', () => { ipcMain.emit('menubar-will-open') }) menu.on('menu-will-close', () => { ipcMain.emit('menubar-will-close') }) @@ -277,6 +282,8 @@ module.exports = function (ctx) { menu.getMenuItemById('ipfsHasErrored').visible = errored && !gcRunning menu.getMenuItemById('runningWithGC').visible = gcRunning + menu.getMenuItemById('numberOfPeers').visible = status === STATUS.STARTING_FINISHED && !gcRunning + menu.getMenuItemById('startIpfs').visible = status === STATUS.STOPPING_FINISHED menu.getMenuItemById('stopIpfs').visible = status === STATUS.STARTING_FINISHED menu.getMenuItemById('restartIpfs').visible = (status === STATUS.STARTING_FINISHED || errored) From 27f540d467540f6bb85eb0d3b14f52236f16cc46 Mon Sep 17 00:00:00 2001 From: Jessica Schilling Date: Tue, 4 Aug 2020 16:56:41 -0600 Subject: [PATCH 2/3] Hover text as i18n --- src/tray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tray.js b/src/tray.js index a6ff4f6b9..ff5e6c8df 100644 --- a/src/tray.js +++ b/src/tray.js @@ -263,7 +263,7 @@ module.exports = function (ctx) { menu = buildMenu(ctx) tray.setContextMenu(menu) - tray.setToolTip('Foo Peers') + tray.setToolTip('Foo' + ' ' + i18n.t('peers')) menu.on('menu-will-show', () => { ipcMain.emit('menubar-will-open') }) menu.on('menu-will-close', () => { ipcMain.emit('menubar-will-close') }) From 898bb21cb011b25f70d295cfa243abe32f6a73ea Mon Sep 17 00:00:00 2001 From: Jessica Schilling Date: Tue, 4 Aug 2020 17:04:23 -0600 Subject: [PATCH 3/3] Menu item as i18n --- assets/locales/en.json | 1 - src/tray.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/locales/en.json b/assets/locales/en.json index 45b24324b..18d69c0a0 100644 --- a/assets/locales/en.json +++ b/assets/locales/en.json @@ -5,7 +5,6 @@ "ipfsIsNotRunning": "IPFS is Not Running", "ipfsHasErrored": "IPFS has Errored", "runningWithGC": "Running (GC in progress)", - "numberOfPeers": "Foo Peers", "start": "Start", "stop": "Stop", "restart": "Restart", diff --git a/src/tray.js b/src/tray.js index ff5e6c8df..47d946979 100644 --- a/src/tray.js +++ b/src/tray.js @@ -58,7 +58,7 @@ function buildMenu (ctx) { })), { id: 'numberOfPeers', - label: i18n.t('numberOfPeers'), + label: 'Foo' + ' ' + i18n.t('peers'), enabled: false }, {