diff --git a/ui (gen4)/features/external-editor.js b/ui (gen4)/features/external-editor.js index f40829cc..4de92895 100755 --- a/ui (gen4)/features/external-editor.js +++ b/ui (gen4)/features/external-editor.js @@ -36,8 +36,29 @@ var browseWalk = require('lib/widget/browse-walk') var ExternalEditorActions = actions.Actions({ config: { + // XXX do we actually need this???? 'external-editor-default': 'System default', - // XXX + + // XXX should this be a dict??? + // ...a list is simpler for sorting... + '_external-editors': [ + { + // NOTE: empty means use app name... + title: 'System default', + // NOTE: empty means system to select editor... + path: '', + // NOTE: empty is the same as '$TARGET'... + arguments: '', + target: '', + }, + { + title: 'IrfanView', + path: 'C:/Program Files (x86)/IrfanView/i_view32.exe', + arguments: '', + target: '', + }, + ], + 'external-editors': [ // XXX system default might be different on different systems... ['System default|"$PATH"'], @@ -48,8 +69,8 @@ var ExternalEditorActions = actions.Actions({ ], 'external-editor-targets': [ - 'Original image', 'Best preview', + //'Original image', // XXX ], }, @@ -130,11 +151,10 @@ var ExternalEditorUIActions = actions.Actions({ // NOTE: empty means use app name... title: '', // NOTE: empty means system to select editor... - path: '/', + path: '', // NOTE: empty is the same as '$TARGET'... - // XXX use $TARGET... arguments: '', - target: 'Original image', + target: '', } var o = overlay.Overlay(this.ribbons.viewer, @@ -142,7 +162,7 @@ var ExternalEditorUIActions = actions.Actions({ make(['Title: ', function(){ return editor.title || '' }]) .on('open', function(){ event.preventDefault() - widgets.makeEditableItem(o.client, + widgets.makeEditableItem(o.client, $(this), $(this).find('.text').last(), function(_, text){ editor.title = text }) }) @@ -176,26 +196,32 @@ var ExternalEditorUIActions = actions.Actions({ }) .on('open', function(){ event.preventDefault() - widgets.makeEditableItem(o.client, + widgets.makeEditableItem(o.client, $(this), $(this).find('.text').last(), function(_, text){ editor.path = text }) }) make(['Arguments: ', function(){ return editor.arguments || '' }]) .on('open', function(){ event.preventDefault() - widgets.makeEditableItem(o.client, + widgets.makeEditableItem(o.client, $(this), $(this).find('.text').last(), function(_, text){ editor.arguments = text }) }) - make(['Target: ', function(){ return editor.target || 'Original image' }]) + make(['Target: ', + function(){ + return editor.target + || that.config['external-editor-targets'][0] }]) .on('open', widgets.makeNestedConfigListEditor(that, o, 'external-editor-targets', function(val){ if(val == null){ return editor.target + || that.config['external-editor-targets'][0] + } else { - editor.target = val + editor.target = val + || that.config['external-editor-targets'][0] } }, { @@ -217,6 +243,8 @@ var ExternalEditorUIActions = actions.Actions({ return o }], // XXX use .externalEditorDialog(..) + // XXX need to support $TARGET in args... + // ...append if not present... listExtenalEditors: ['Edit/List external editors', function(){ var that = this diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index 72d6e1e8..9cb0d5bf 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -1299,7 +1299,7 @@ var FileSystemWriterUIActions = actions.Actions({ } }, // XXX indicate export state: index, crop, image... - exportDialog: ['File/Export/Images...', + exportDialog: ['File/Export/Export optioons...', function(){ var that = this diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 523cd4b0..56171858 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -36,7 +36,7 @@ var browseWalk = require('lib/widget/browse-walk') // can be a different elem... var makeEditableItem = module.makeEditableItem = -function(list, elem, callback, options){ +function(list, item, elem, callback, options){ return elem .makeEditable({ clear_on_edit: false, @@ -47,7 +47,7 @@ function(list, elem, callback, options){ // XXX make the selector more accurate... // ...at this point this will select the first elem // with text which can be a different elem... - .then(function(){ list.select(text) }) + .then(function(){ list.select(item.text()) }) }) }