From 596052f2feada5df4bf77004bba80fdafde9db2f Mon Sep 17 00:00:00 2001 From: Jesse Ostrander Date: Sat, 16 Dec 2017 15:40:34 -0500 Subject: [PATCH] Add HotKey for I'm Feeling Lucky button --- src/_locales/cs.json | 1 + src/_locales/da.json | 1 + src/_locales/de.json | 1 + src/_locales/en-US.json | 1 + src/_locales/es-ES.json | 1 + src/_locales/fr-FR.json | 1 + src/_locales/hu.json | 1 + src/_locales/it.json | 1 + src/_locales/ja.json | 1 + src/_locales/nl-NL.json | 1 + src/_locales/pirate.json | 1 + src/_locales/pl-PL.json | 1 + src/_locales/pt-BR.json | 1 + src/_locales/ro.json | 1 + src/_locales/ru.json | 1 + src/_locales/sk.json | 1 + src/_locales/sv.json | 1 + src/_locales/ua.json | 1 + src/main/features/core/keyboardShortcuts.js | 1 + src/renderer/ui/components/settings/HotkeyInput.js | 1 + src/renderer/ui/components/settings/tabs/HotkeyTab.js | 1 + src/renderer/windows/GPMWebView/playback/controller.js | 4 ++++ 22 files changed, 25 insertions(+) diff --git a/src/_locales/cs.json b/src/_locales/cs.json index 4fd9fa701..f16a732d3 100644 --- a/src/_locales/cs.json +++ b/src/_locales/cs.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Zvýšit hlasitost", "playback-label-info-track": "", "playback-os-no-track-playing": "", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Vyžaduje restart", diff --git a/src/_locales/da.json b/src/_locales/da.json index 59ecf2420..74c4636a7 100644 --- a/src/_locales/da.json +++ b/src/_locales/da.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Skru ned for lydstyrken", "playback-label-info-track": "", "playback-os-no-track-playing": "", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Kræver genstart af GPMDP", diff --git a/src/_locales/de.json b/src/_locales/de.json index a2d45df97..81de0d668 100644 --- a/src/_locales/de.json +++ b/src/_locales/de.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Lauter", "playback-label-info-track": "Aktuellen Titel ankündigen", "playback-os-no-track-playing": "Es spielt derzeit kein Titel", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Erfordert einen Neustart", diff --git a/src/_locales/en-US.json b/src/_locales/en-US.json index 1e7ec8d2e..9a703855a 100644 --- a/src/_locales/en-US.json +++ b/src/_locales/en-US.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Increase Volume", "playback-label-info-track": "Notify current track", "playback-os-no-track-playing": "No Track Playing", + "playback-label-im-feeling-lucky": "I'm Feeling Lucky", "settings-requires-restart": "Requires restart", diff --git a/src/_locales/es-ES.json b/src/_locales/es-ES.json index 5cf771c76..cf0b49097 100644 --- a/src/_locales/es-ES.json +++ b/src/_locales/es-ES.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Subir Volumen", "playback-label-info-track": "Notificar pista actual", "playback-os-no-track-playing": "Ninguna pista sonando", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Requiere reiniciar", diff --git a/src/_locales/fr-FR.json b/src/_locales/fr-FR.json index 033c20e13..60985bab8 100644 --- a/src/_locales/fr-FR.json +++ b/src/_locales/fr-FR.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Augmenter le volume", "playback-label-info-track": "Notifier la piste courante", "playback-os-no-track-playing": "Aucune piste en cours de lecture", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Besoin de redémarrer", diff --git a/src/_locales/hu.json b/src/_locales/hu.json index fc8a384b8..5f9b24823 100644 --- a/src/_locales/hu.json +++ b/src/_locales/hu.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Növelje a hangerőt", "playback-label-info-track": "Aktuális dal értesítése", "playback-os-no-track-playing": "Zeneszám nem játszódik", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Újraindítást igényel", diff --git a/src/_locales/it.json b/src/_locales/it.json index eef8bd831..8842c05e3 100644 --- a/src/_locales/it.json +++ b/src/_locales/it.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Aumenta il volume", "playback-label-info-track": "Notifica il brano corrente", "playback-os-no-track-playing": "Nessun brano in riproduzione", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Richiede riavvio", diff --git a/src/_locales/ja.json b/src/_locales/ja.json index c84292df3..5cefdfae3 100644 --- a/src/_locales/ja.json +++ b/src/_locales/ja.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "音量を下げる", "playback-label-info-track": "", "playback-os-no-track-playing": "現在再生中の曲はありません", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "再起動が必要です", diff --git a/src/_locales/nl-NL.json b/src/_locales/nl-NL.json index bb6a6621b..be9c83508 100644 --- a/src/_locales/nl-NL.json +++ b/src/_locales/nl-NL.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Zachter", "playback-label-info-track": "", "playback-os-no-track-playing": "", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Vereist herstart", diff --git a/src/_locales/pirate.json b/src/_locales/pirate.json index 1466bc534..ecb6a2867 100644 --- a/src/_locales/pirate.json +++ b/src/_locales/pirate.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Arr, I can't hear you", "playback-label-info-track": "", "playback-os-no-track-playing": "", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Requires ye scuttle and relaunch", diff --git a/src/_locales/pl-PL.json b/src/_locales/pl-PL.json index d1e51efde..004eb4880 100644 --- a/src/_locales/pl-PL.json +++ b/src/_locales/pl-PL.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Zwiększ głośność", "playback-label-info-track": "Powiadom o obecnie odtwarzanym utworze", "playback-os-no-track-playing": "Żaden utwór nie jest teraz odtwarzany", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Wymaga ponownego uruchomienia", diff --git a/src/_locales/pt-BR.json b/src/_locales/pt-BR.json index 73012b19e..c5800f359 100644 --- a/src/_locales/pt-BR.json +++ b/src/_locales/pt-BR.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Aumentar Volume", "playback-label-info-track": "Notificar música atual", "playback-os-no-track-playing": "", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Requer reinicialização", diff --git a/src/_locales/ro.json b/src/_locales/ro.json index 25f56c0a5..35b4a2f94 100644 --- a/src/_locales/ro.json +++ b/src/_locales/ro.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Crește volumul", "playback-label-info-track": "Notifică melodia curentă", "playback-os-no-track-playing": "Nu se redă nicio melodie în acest moment", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Necesită repornirea aplicației", diff --git a/src/_locales/ru.json b/src/_locales/ru.json index 9716723ff..4f3809617 100644 --- a/src/_locales/ru.json +++ b/src/_locales/ru.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Увеличить громкость", "playback-label-info-track": "", "playback-os-no-track-playing": "Ничего не воспроизводится", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Требует перезапуска", diff --git a/src/_locales/sk.json b/src/_locales/sk.json index d537cafdc..ccda84e53 100644 --- a/src/_locales/sk.json +++ b/src/_locales/sk.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Zvýšiť hlasitosť", "playback-label-info-track": "Upozornenie s aktuálnou skladbou", "playback-os-no-track-playing": "Neprehráva sa žiadna skladba", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Vyžaduje reštart", diff --git a/src/_locales/sv.json b/src/_locales/sv.json index 2ccbba7e9..96726263a 100644 --- a/src/_locales/sv.json +++ b/src/_locales/sv.json @@ -60,6 +60,7 @@ "modal-goToURL-title": "Skriv in Google Play-adressen:", "modal-welcome-title": "Välkommen til version", "modal-welcome-content": "Vi hoppas att du gillar den nya uppdateringen!", + "playback-label-im-feeling-lucky": "", "playback-label-next-track": "Nästa låt", "playback-label-play-pause": "Spela / Pausa", diff --git a/src/_locales/ua.json b/src/_locales/ua.json index 80ae8b8d6..f745080ac 100644 --- a/src/_locales/ua.json +++ b/src/_locales/ua.json @@ -71,6 +71,7 @@ "playback-label-volume-up": "Збільшити гучність", "playback-label-info-track": "Повідомлення про поточний трек", "playback-os-no-track-playing": "Нічого не відтворюється", + "playback-label-im-feeling-lucky": "", "settings-requires-restart": "Потребує перезапуску", diff --git a/src/main/features/core/keyboardShortcuts.js b/src/main/features/core/keyboardShortcuts.js index acf5a75ba..4a39c9556 100644 --- a/src/main/features/core/keyboardShortcuts.js +++ b/src/main/features/core/keyboardShortcuts.js @@ -37,6 +37,7 @@ const customHotkeysTemplate = { increaseVolume: null, decreaseVolume: null, infoTrack: null, + imFeelingLucky: null, }; const userHotkeys = Settings.get('hotkeys', {}); diff --git a/src/renderer/ui/components/settings/HotkeyInput.js b/src/renderer/ui/components/settings/HotkeyInput.js index e35dd5073..a35ad5c5a 100644 --- a/src/renderer/ui/components/settings/HotkeyInput.js +++ b/src/renderer/ui/components/settings/HotkeyInput.js @@ -27,6 +27,7 @@ class HotkeyInput extends Component { 'increaseVolume', 'decreaseVolume', 'infoTrack', + 'imFeelingLucky', ]).isRequired, hotkeys: PropTypes.object.isRequired, setSetting: PropTypes.func.isRequired, diff --git a/src/renderer/ui/components/settings/tabs/HotkeyTab.js b/src/renderer/ui/components/settings/tabs/HotkeyTab.js index 0b39321da..7778c308d 100644 --- a/src/renderer/ui/components/settings/tabs/HotkeyTab.js +++ b/src/renderer/ui/components/settings/tabs/HotkeyTab.js @@ -17,6 +17,7 @@ export default class HotkeyTab extends Component { + ); } diff --git a/src/renderer/windows/GPMWebView/playback/controller.js b/src/renderer/windows/GPMWebView/playback/controller.js index 0167399de..fedc3066d 100644 --- a/src/renderer/windows/GPMWebView/playback/controller.js +++ b/src/renderer/windows/GPMWebView/playback/controller.js @@ -90,3 +90,7 @@ Emitter.on('playback:infoTrack', () => { icon: currentTrack.albumArt, }); }); + +Emitter.on('playback:imFeelingLucky', () => { + window.GPM.playback.startFeelingLucky(); +})