state: set statePath when opening a state file from the server (#590)
This commit is contained in:
parent
3ba0719013
commit
2d1ddd3353
4 changed files with 13 additions and 3 deletions
|
|
@ -9,6 +9,7 @@
|
|||
- editor: errors when hitting `mod + a` and unselecting widgets
|
||||
- modal: correct popup title color
|
||||
- options: allow `midi:port_name` pairs in `--send` option
|
||||
- sidepanel/state: opening a state file now properly sets it as the next default save location
|
||||
- widgets:
|
||||
- **new** `menu` widget, circular alternative to the dropdown & switch widgets
|
||||
- file: allow selecting folders
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ module.exports = {
|
|||
|
||||
stateLoad: function(data){
|
||||
|
||||
state.load(data.state, data.send)
|
||||
state.load(data.state, data.send, data.path)
|
||||
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -119,10 +119,12 @@ var StateManager = class StateManager {
|
|||
|
||||
}
|
||||
|
||||
load(state, send) {
|
||||
load(state, send, path) {
|
||||
|
||||
if (!state) return
|
||||
|
||||
this.setStatePath(path)
|
||||
|
||||
try {
|
||||
if (typeof state === 'string') {
|
||||
state = JSON.parse(state)
|
||||
|
|
@ -188,6 +190,13 @@ var StateManager = class StateManager {
|
|||
|
||||
}
|
||||
|
||||
setStatePath(path) {
|
||||
|
||||
if (!path) return
|
||||
this.statePath = path
|
||||
|
||||
}
|
||||
|
||||
pushValueState(id, value) {
|
||||
this.valueStateQueue[id] = value
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ module.exports = {
|
|||
|
||||
module.exports.fileRead(data, clientId, true, (result)=>{
|
||||
|
||||
ipc.send('stateLoad', {state: result, send: true}, clientId)
|
||||
ipc.send('stateLoad', {state: result, path: data.path, send: true}, clientId)
|
||||
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue