From 0878e45dcdcc4b6274e017700ed37ea5a31b04e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20de=20Saint-Exup=C3=A9ry?= Date: Tue, 23 Aug 2016 15:20:04 +0200 Subject: [PATCH 1/4] Add .idea to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ae75970c..1197a441 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ npm-debug.log test-results.xml test_config.json +.idea From fd80b758ed5613a9a5af5466664d404a6dc9089d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20de=20Saint-Exup=C3=A9ry?= Date: Tue, 23 Aug 2016 15:25:58 +0200 Subject: [PATCH 2/4] Add access to settings through tray menu --- CHANGELOG.md | 1 + docs/setup.md | 1 + src/main/menus/tray.js | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37640dfd..883a94e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Release date: TBD - Invalidate cache before load, to make server upgrades easy - Removed misleading shortcuts from tray menu, as they didn't work - Ctrl/Command+F puts cursor in search box to search in current channel. +- Add access to settings through tray menu #### Windows - Added an option to toogle the red dot icon for unread messages (default is on). diff --git a/docs/setup.md b/docs/setup.md index 0ffeb318..ebbdcf70 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -78,6 +78,7 @@ You have to configure the application to interact with your teams. - Windows: Press `Alt` key to bring up the menu at the top of the window, then click `File -> Settings`. - OS X: Click `Mattermost` from the menu at the top of the screen, then click `Preferences...`. - Linux: Click `File -> Settings` on the menu. + - If tray menu : Right-click on tray icon and click `Settings` 2. Press `+` button next to the "Teams" label. diff --git a/src/main/menus/tray.js b/src/main/menus/tray.js index b79c4c87..f5fedc68 100644 --- a/src/main/menus/tray.js +++ b/src/main/menus/tray.js @@ -28,6 +28,14 @@ function createTemplate(mainWindow, config) { }; }), { type: 'separator' + }, { + label: 'Settings', + click: () => { + mainWindow.loadURL('file://' + __dirname + '/browser/settings.html'); + mainWindow.show(); + } + }, { + type: 'separator' }, { role: 'quit' } From b66412b07cb6c724708432ae90d5c053d368eb25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20de=20Saint-Exup=C3=A9ry?= Date: Wed, 24 Aug 2016 14:44:38 +0200 Subject: [PATCH 3/4] [PR review] Change settings docs --- docs/setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setup.md b/docs/setup.md index ebbdcf70..e41f6bdb 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -78,7 +78,7 @@ You have to configure the application to interact with your teams. - Windows: Press `Alt` key to bring up the menu at the top of the window, then click `File -> Settings`. - OS X: Click `Mattermost` from the menu at the top of the screen, then click `Preferences...`. - Linux: Click `File -> Settings` on the menu. - - If tray menu : Right-click on tray icon and click `Settings` + - All : right-click on tray icon and click `Settings` 2. Press `+` button next to the "Teams" label. From 1d33fc6f6e46f3a05eb1c90102fe912e4e4a972d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20de=20Saint-Exup=C3=A9ry?= Date: Thu, 25 Aug 2016 10:54:47 +0200 Subject: [PATCH 4/4] Show or restore if minimized --- src/main/menus/tray.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/menus/tray.js b/src/main/menus/tray.js index f5fedc68..2ac3ef4f 100644 --- a/src/main/menus/tray.js +++ b/src/main/menus/tray.js @@ -12,12 +12,7 @@ function createTemplate(mainWindow, config) { return { label: team.name, click: (item, focusedWindow) => { - if (mainWindow.isMinimized()) { - mainWindow.restore(); - } - else { - mainWindow.show(); - } + showOrRestore(mainWindow); mainWindow.webContents.send('switch-tab', i); if (process.platform === 'darwin') { @@ -32,7 +27,7 @@ function createTemplate(mainWindow, config) { label: 'Settings', click: () => { mainWindow.loadURL('file://' + __dirname + '/browser/settings.html'); - mainWindow.show(); + showOrRestore(mainWindow); } }, { type: 'separator' @@ -47,6 +42,10 @@ var createMenu = function(mainWindow, config) { return Menu.buildFromTemplate(createTemplate(mainWindow, config)); }; +function showOrRestore(window) { + window.isMinimized() ? window.restore() : window.show() +} + module.exports = { createMenu: createMenu };