Added strings for EQ preset stuff

This commit is contained in:
kyw504100 2022-02-03 00:16:12 +08:00
parent e41c9ed45a
commit 47c43759b6
No known key found for this signature in database
GPG key ID: 9116E2159A0521FD
2 changed files with 12 additions and 6 deletions

View file

@ -130,6 +130,10 @@
"term.topResult": "Top Result", // Search Results "term.topResult": "Top Result", // Search Results
"term.sharedPlaylists": "Shared Playlists", // Search Results "term.sharedPlaylists": "Shared Playlists", // Search Results
"term.people": "People", // Search Results "term.people": "People", // Search Results
"term.newpreset.name": "New EQ Preset Name", // Equalizer Preset
"term.addedpreset": "Added Preset",
"term.deletepreset.warn": "Are you sure you want to delete this preset?",
"term.deletedpreset": "Removed preset",
// Home // Home
"home.title": "Home", "home.title": "Home",
@ -201,6 +205,8 @@
"action.tray.quit": "Quit", "action.tray.quit": "Quit",
"action.tray.show": "Show", "action.tray.show": "Show",
"action.update": "Update", "action.update": "Update",
"action.newpreset": "New Preset...", // Equalizer Preset
"action.deletepreset": "Delete Preset",
// Settings - General // Settings - General
"settings.header.general": "General", "settings.header.general": "General",

View file

@ -258,14 +258,14 @@
items: { items: {
"new": { "new": {
"icon": "./assets/feather/plus.svg", "icon": "./assets/feather/plus.svg",
name: "New Preset...", "name": app.getLz('action.newpreset'),
action: () => { action: () => {
this.addPreset() this.addPreset()
} }
}, },
"delete": { "delete": {
"icon": "./assets/feather/x-circle.svg", "icon": "./assets/feather/x-circle.svg",
name: "Delete Preset", "name": app.getLz('action.deletepreset'),
action: () => { action: () => {
this.deletePreset() this.deletePreset()
} }
@ -316,13 +316,13 @@
}, },
deletePreset() { deletePreset() {
let presets = this.$root.cfg.audio.equalizer.presets let presets = this.$root.cfg.audio.equalizer.presets
bootbox.confirm("Are you sure you want to delete this preset?", (result) => { bootbox.confirm(app.getLz('term.deletepreset.warn'), (result) => {
if (result) { if (result) {
this.changePreset("default") this.changePreset("default")
// find the preset by id (preset) and remove it // find the preset by id (preset) and remove it
let index = presets.findIndex(p => p.preset == this.preset) let index = presets.findIndex(p => p.preset == this.preset)
presets.splice(index, 1) presets.splice(index, 1)
notyf.success("Removed preset") notyf.success(app.getLz('term.deletedpreset'))
} }
}) })
}, },
@ -367,7 +367,7 @@
}, },
addPreset() { addPreset() {
let self = this let self = this
bootbox.prompt("New EQ Preset Name", (res) => { bootbox.prompt(app.getLz('term.newpreset.name'), (res) => {
if (res) { if (res) {
let eqSettings = Clone(app.cfg.audio.equalizer) let eqSettings = Clone(app.cfg.audio.equalizer)
let newPreset = new self.eqPreset() let newPreset = new self.eqPreset()
@ -379,7 +379,7 @@
newPreset.mix = eqSettings.mix newPreset.mix = eqSettings.mix
newPreset.vibrantBass = eqSettings.vibrantBass newPreset.vibrantBass = eqSettings.vibrantBass
app.cfg.audio.equalizer.presets.push(newPreset) app.cfg.audio.equalizer.presets.push(newPreset)
notyf.success("Added Preset") notyf.success(app.getLz('term.addedpreset'))
self.changePreset(newPreset.preset) self.changePreset(newPreset.preset)
} }
}) })