Skip to content

Commit

Permalink
Enabling Preferences shortcut for Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
encadyma committed Jan 9, 2018
1 parent 388fb29 commit 0d5966a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if (process.platform === 'darwin') {
submenu: [
{role: 'about'},
{type: 'separator'},
{label: 'Preferences...', accelerator: 'Cmd+,'},
{label: 'Preferences...', accelerator: 'Cmd+,', click() { mainWindow.webContents.send("STORAGE_OPEN_PREFERENCES"); }},
{type: 'separator'},
{role: 'services', submenu: []},
{type: 'separator'},
Expand Down
18 changes: 17 additions & 1 deletion src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,23 @@
export default {
name: 'swishbox',
components: { HeaderBar }
components: { HeaderBar },
mounted() {
this.$electron.ipcRenderer.on("STORAGE_OPEN_PREFERENCES", () => {
this.$router.push({ name: 'preferences-page' });
});
this.$electron.ipcRenderer.on("STORAGE_METADATA_UPDATE", (event, metadata) => {
this.$store.commit('STORAGE_VUEX_UPDATE_METADATA', metadata);
});
this.$electron.ipcRenderer.on("STORAGE_PREFERENCES_UPDATE", (event, preferences) => {
this.$store.commit('STORAGE_VUEX_UPDATE_PREFERENCES', preferences);
});
this.$electron.ipcRenderer.send("STORAGE_METADATA_FETCH");
this.$electron.ipcRenderer.send("STORAGE_PREFERENCES_FETCH");
}
};
</script>

Expand Down
12 changes: 0 additions & 12 deletions src/renderer/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@
version: process.env.SWISHBOX_VERSION,
};
},
mounted() {
this.$electron.ipcRenderer.on("STORAGE_METADATA_UPDATE", (event, metadata) => {
this.$store.commit('STORAGE_VUEX_UPDATE_METADATA', metadata);
});
this.$electron.ipcRenderer.on("STORAGE_PREFERENCES_UPDATE", (event, preferences) => {
this.$store.commit('STORAGE_VUEX_UPDATE_PREFERENCES', preferences);
});
this.$electron.ipcRenderer.send("STORAGE_METADATA_FETCH");
this.$electron.ipcRenderer.send("STORAGE_PREFERENCES_FETCH");
},
methods: {
openFeedback() {
this.$electron.shell.openExternal('https://github.com/encadyma/swishbox/issues');
Expand Down

0 comments on commit 0d5966a

Please sign in to comment.