From d912ce2ebe4c3f19d222332d330b87798274b718 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 20 May 2020 02:49:26 +0300 Subject: [PATCH] experiemnting... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 53 +++++++++++++++++++++++--------- ui (gen4)/features/keyboard.js | 4 ++- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index cc3f74be..e5432fd4 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -673,24 +673,24 @@ var FileSystemLoaderActions = actions.Actions({ }) }], - // Load new images... - // - // Load new images from current path... - // .loadNewImages() - // -> promise - // - // Load new images from path... - // .loadNewImages(path) - // -> promise - // - // This will prepend images in path (default .location.path) that - // were not loaded in index... - // - // NOTE: this will not load images that are already loaded. - // // XXX revise logger... // XXX revise alignment... loadNewImages: ['File/Load new images', + core.doc`Load new images... + + Load new images from current path... + .loadNewImages() + -> promise + + Load new images from path... + .loadNewImages(path) + -> promise + + This will prepend images in path (default .location.path) that + were not loaded in index... + + NOTE: this will not load images that are already loaded. + `, function(path, logger){ path = path || this.location.path @@ -829,9 +829,13 @@ var FileSystemLoaderActions = actions.Actions({ return res.flat() }) }], + // XXX should this take a path argument??? // XXX not yet sure about this... removeMissingImages: ['File/Remove missing images from index', core.doc`Remove missing images from index + + .removeMissingImages() + -> promise This will remove images that are not found via their original path/name from the index. @@ -879,6 +883,25 @@ var FileSystemLoaderActions = actions.Actions({ that.data.clear(res) logger && rem_logger.emit('done', 'data cleanup') } return res }) }], + + + // XXX EXPERIMENTAL... + // shorthand... + syncIndexWithDir: ['- File/', + core.doc`Load new and remove deleted images... + + .syncIndexWithDir() + -> promise + + + This will call: + .loadNewImages() + .removeMissingImages() + `, + function(logger){ + return Promise.all([ + this.loadNewImages(), + this.removeMissingImages(), ]) }], }) diff --git a/ui (gen4)/features/keyboard.js b/ui (gen4)/features/keyboard.js index 0a3df0c5..24254fe1 100755 --- a/ui (gen4)/features/keyboard.js +++ b/ui (gen4)/features/keyboard.js @@ -263,7 +263,9 @@ module.GLOBAL_KEYBOARD = { ctrl_F: 'F11', meta_F: 'F11', - ctrl_R: 'loadNewImages!', + // XXX EXPERIMENTAL: which should it be??? + //ctrl_R: 'loadNewImages!', + ctrl_R: 'syncIndexWithDir!', ctrl_alt_R: 'reload!', ctrl_shift_R: 'F5',