mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	enabled history, still not final...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									cffc66e191
								
							
						
					
					
						commit
						c584ec1c46
					
				| @ -2673,8 +2673,8 @@ var FileSystemWriterUIActions = actions.Actions({ | |||||||
| 				'preview-size-limit': 'no limit', | 				'preview-size-limit': 'no limit', | ||||||
| 			}, | 			}, | ||||||
| 		], | 		], | ||||||
| 		// XXX need to manage history length...
 |  | ||||||
| 		'export-history-length': 50, | 		'export-history-length': 50, | ||||||
|  | 		// XXX should this be stored here or like file history in session???
 | ||||||
| 		'export-history': [], | 		'export-history': [], | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| @ -3112,18 +3112,17 @@ var FileSystemWriterUIActions = actions.Actions({ | |||||||
| 		'exportDialog: "images"'], | 		'exportDialog: "images"'], | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// XXX TODO:
 | 	// XXX format the element into: title (optional) + info
 | ||||||
| 	// 		- format the element into: title (optional) + info
 |  | ||||||
| 	// XXX add a 'name' field to the exportDialog(..)???
 | 	// XXX add a 'name' field to the exportDialog(..)???
 | ||||||
| 	// XXX button icons... 
 | 	// XXX button icons... 
 | ||||||
| 	// XXX button shortcuts...
 | 	// XXX button shortcuts...
 | ||||||
| 	// XXX handle presets with repeating titles...
 | 	// XXX handle presets with repeating titles...
 | ||||||
| 	exportPresets: ['- File/Export history...', | 	// XXX would be nice to mark sections...
 | ||||||
|  | 	exportPresets: ['- File/Export presets and history...', | ||||||
| 		widgets.makeUIDialog(function(mode){ | 		widgets.makeUIDialog(function(mode){ | ||||||
| 			var that = this | 			var that = this | ||||||
| 			var logger = this.logger && this.logger.push('exportPresets') | 			var logger = this.logger && this.logger.push('exportPresets') | ||||||
| 
 | 
 | ||||||
| 			// XXX these should be type-specific...
 |  | ||||||
| 			var getName = function(preset){ | 			var getName = function(preset){ | ||||||
| 				return preset.name | 				return preset.name | ||||||
| 					|| `${ preset.mode }: "${ preset.path }"` } | 					|| `${ preset.mode }: "${ preset.path }"` } | ||||||
| @ -3145,8 +3144,7 @@ var FileSystemWriterUIActions = actions.Actions({ | |||||||
| 			var [index, keys] = buildIndex(presets) | 			var [index, keys] = buildIndex(presets) | ||||||
| 
 | 
 | ||||||
| 			// history...
 | 			// history...
 | ||||||
| 			// XXX
 | 			var history = that.config['export-history'] || [] | ||||||
| 			var history = [] |  | ||||||
| 			var [history_index, history_keys] = buildIndex(history) | 			var [history_index, history_keys] = buildIndex(history) | ||||||
| 
 | 
 | ||||||
| 			return browse.makeLister(null, function(path, make){ | 			return browse.makeLister(null, function(path, make){ | ||||||
| @ -3239,7 +3237,7 @@ var FileSystemWriterUIActions = actions.Actions({ | |||||||
| 				make.Separator() | 				make.Separator() | ||||||
| 				history.length == 0 ? | 				history.length == 0 ? | ||||||
| 					make.Empty('No export history...') | 					make.Empty('No export history...') | ||||||
| 					: ake.EditableList(history_keys, { | 					: make.EditableList(history_keys, { | ||||||
| 						list_id: 'history', | 						list_id: 'history', | ||||||
| 						sortable: false, | 						sortable: false, | ||||||
| 						new_item: false, | 						new_item: false, | ||||||
| @ -3272,9 +3270,9 @@ var FileSystemWriterUIActions = actions.Actions({ | |||||||
| 						return getPreset(e, presets, index) }) | 						return getPreset(e, presets, index) }) | ||||||
| 				// handle history delete...
 | 				// handle history delete...
 | ||||||
| 				history.length != that.config['export-history'] | 				history.length != that.config['export-history'] | ||||||
| 					&& that.config['export-history'] = history_keys | 					&& (that.config['export-history'] = history_keys | ||||||
| 						.map(function(e){ | 						.map(function(e){ | ||||||
| 							return getPreset(e, history, history_index) }) }) })], | 							return getPreset(e, history, history_index) })) }) })], | ||||||
| 
 | 
 | ||||||
| 	// XXX these do note need the ui -- move to a separate feature...
 | 	// XXX these do note need the ui -- move to a separate feature...
 | ||||||
| 	// XXX these are essentially the same as the history API, make a 
 | 	// XXX these are essentially the same as the history API, make a 
 | ||||||
| @ -3334,7 +3332,11 @@ module.FileSystemWriterUI = core.ImageGridFeatures.Feature({ | |||||||
| 		[[ | 		[[ | ||||||
| 			'exportIndex', | 			'exportIndex', | ||||||
| 			'exportDirs', | 			'exportDirs', | ||||||
| 		], function(_, settings){}] | 		], function(_, settings){ | ||||||
|  | 			this.exportHistoryPush( | ||||||
|  | 				(!settings || typeof(settings) == typeof('str')) ? | ||||||
|  | 					this.config['export-settings'] | ||||||
|  | 					: settings) }] | ||||||
| 	], | 	], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user