diff --git a/Viewer/features/filesystem.js b/Viewer/features/filesystem.js index 864477ed..afccc4c3 100755 --- a/Viewer/features/filesystem.js +++ b/Viewer/features/filesystem.js @@ -3005,8 +3005,7 @@ var FileSystemWriterUIActions = actions.Actions({ mode = settings['mode'] } settings = settings || (this.config['export-settings'] = - this.config['export-settings'] - || {}) + this.config['export-settings'] || {}) // mode aliases... var mode_aliases = Object.entries(that.config['export-dialog-modes'] || {}) .reduce(function(res, [key, value]){ @@ -3029,6 +3028,7 @@ var FileSystemWriterUIActions = actions.Actions({ var data = that.config['export-dialog-modes'][mode].data // mode selector... + // NOTE: this is only visible if no mode/settings are given... !show_mode && make(['Export $mode: ', function(){ return mode }], @@ -3065,9 +3065,7 @@ var FileSystemWriterUIActions = actions.Actions({ { cls: 'selected', open: function(){ - var mode = - that.config['export-dialog-modes'][settings['mode']] - that[mode.action](settings) + that.exportAs(settings) dialog.close() }, buttons: [ ['Save preset', @@ -3103,20 +3101,60 @@ var FileSystemWriterUIActions = actions.Actions({ 'exportDialog: "images"'], - // XXX handle presets with repeating titles... + // XXX BUG: affecting preset name will delete on dialog close... + // to reproduce: + // - open dialog + // - edit preset changing path + // - close + // result: + // .config['export-presets'] will contain undefined instead + // of last preset + // likely cause: + // - inconsistent keys and on .close(..) we can't get the + // correct preset... + // XXX BUG: running a preset from the editor will use the default + // settings and not the loaded preset... + // ...can't reproduce... (revise) + // XXX ASAP handle presets with repeating titles... // XXX UI: // - element format: // TITLE // mode / destination / format // - revise buttons and icons... // - button shortcuts... - // XXX add a 'name' field to the exportDialog(..)??? + // XXX add a 'name' field to the exportDialog(..) (???) // XXX would be nice to mark/title sections -- presets / history... (???) exportPresets: ['- File/Export presets and history...', widgets.makeUIDialog(function(mode){ var that = this var logger = this.logger && this.logger.push('exportPresets') + // XXX need a way for index to support unique names and to do it + // in a stable manner: + // - getName(..) must generate the same title for + // the same item, i.e. 'abc' -> 'abc (3)' -> 'abc (3)' ... + // ...this may be done like this: + // - index format (buildIndex(..)): + // { + //