Write new profile setting to settings.json file when changed
This commit is contained in:
parent
4a3a99acb6
commit
4dccefc126
|
@ -31,6 +31,7 @@ devices.profile = function (profile) {
|
|||
for (let key of keys) {
|
||||
mcopy.cfg[key] = keys[key]
|
||||
}
|
||||
ipcRenderer.send('profile', { profile })
|
||||
};
|
||||
devices.listen = function () {
|
||||
'use strict';
|
||||
|
@ -72,6 +73,10 @@ devices.ready = function (event, arg) {
|
|||
$('#devices').append(opt);
|
||||
}
|
||||
}
|
||||
if (arg && arg.profile) {
|
||||
$('#profile').val(arg.profile)
|
||||
//devices.profile(arg.profile)
|
||||
}
|
||||
return event.returnValue = true;
|
||||
};
|
||||
|
||||
|
|
14
app/main.js
14
app/main.js
|
@ -41,6 +41,18 @@ let menu
|
|||
mcopy.cfg = require('./data/cfg.json')
|
||||
mcopy.settings = {}
|
||||
|
||||
dev.init = function () {
|
||||
dev.listen()
|
||||
}
|
||||
|
||||
dev.listen = function () {
|
||||
ipcMain.on('profile', (event, arg) => {
|
||||
console.log(`Saving profile ${arg.profile}`)
|
||||
settings.update('profile', arg.profile)
|
||||
settings.save()
|
||||
})
|
||||
}
|
||||
|
||||
dev.enumerate = function (err, devices) {
|
||||
if (err) {
|
||||
log.info(err, 'SERIAL', false, true)
|
||||
|
@ -535,6 +547,8 @@ var init = function () {
|
|||
light.init()
|
||||
proj.init()
|
||||
cam.init()
|
||||
dev.init()
|
||||
|
||||
|
||||
//transfer.init()
|
||||
//capture.init()
|
||||
|
|
Loading…
Reference in New Issue