Add and fix

This commit is contained in:
Cutls 2019-08-29 01:33:06 +09:00
parent 834fa719b2
commit 5d8ca9566a
3 changed files with 11 additions and 3 deletions

View File

@ -116,6 +116,9 @@ ipc.on('langres', function (event, arg) {
ipc.on('exportSettingsFile', function (event, arg) { ipc.on('exportSettingsFile', function (event, arg) {
postMessage(["exportSettingsCore", arg], "*") postMessage(["exportSettingsCore", arg], "*")
}); });
ipc.on('exportAllComplete', function (event, arg) {
postMessage(["alert", "Complete"], "*")
});
ipc.on('config', function (event, arg) { ipc.on('config', function (event, arg) {
postMessage(["importSettingsCore", arg], "*") postMessage(["importSettingsCore", arg], "*")
}); });

View File

@ -121,7 +121,7 @@ function load() {
} else { } else {
ls = tlView.config[i].data ls = tlView.config[i].data
for (var j = 0; j < ls.length; j++) { for (var j = 0; j < ls.length; j++) {
if(localStorage.getItem(tlView.config[i].data[j].storage)){ if (localStorage.getItem(tlView.config[i].data[j].storage)) {
tlView.config[i].data[j].setValue = localStorage.getItem(tlView.config[i].data[j].storage) tlView.config[i].data[j].setValue = localStorage.getItem(tlView.config[i].data[j].storage)
} }
} }
@ -323,7 +323,11 @@ function exportSettingsCore() {
var tagarr = localStorage.getItem("tag"); var tagarr = localStorage.getItem("tag");
var favtag = JSON.parse(tagarr); var favtag = JSON.parse(tagarr);
exp.favoriteTags = favtag; exp.favoriteTags = favtag;
exp.version = "2.1" exp.revisons = 2.1
exp.meta = {}
exp.meta.date = new Date()
exp.meta.thedesk = localStorage.getItem("ver")
exp.meta.platform = localStorage.getItem("platform")
return exp; return exp;
} }
function importSettings() { function importSettings() {

View File

@ -196,6 +196,7 @@ function system(mainWindow, dir, lang, dirname) {
ipc.on('export', (e, args) => { ipc.on('export', (e, args) => {
fs.writeFileSync(args[0], JSON5.stringify(args[1])); fs.writeFileSync(args[0], JSON5.stringify(args[1]));
e.sender.webContents.send('exportAllComplete', "");
}); });
//フォント //フォント
function object_array_sort(data, key, order, fn) { function object_array_sort(data, key, order, fn) {