Changeset 619
- Timestamp:
- 04/14/09 21:24:46 (7 months ago)
- Files:
-
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/flash/Desktop.swf (modified) (previous)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/main.xul (modified) (1 diff)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js (modified) (8 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/threads.js (modified) (6 diffs)
- trunk/uploadr/flash/src/Model.as (modified) (10 diffs)
- trunk/uploadr/flash/src/widget/Grid.as (modified) (1 diff)
- trunk/uploadr/flash/src/widget/PhotoGrid.as (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/main.xul
r602 r619 90 90 <toolbox id="menu"> 91 91 <menubar> 92 <menu label=" &menu.upload;" accesskey="U">92 <menu label="Desktop" accesskey="D"> 93 93 <menupopup id="menu_UploadPopup"> 94 <menuitem label="&menu.upload.add;" key="key_add" accesskey="A" oncommand="photos.add_dialog();" /> 95 <menuitem id="menu_upload" label="&menu.upload;" key="key_upload" accesskey="U" oncommand="photos.upload();" /> 96 <menuitem label="Clear Index" accesskey="X" oncommand="photos.removeAll();photos.load();ui.init()" /> 94 <menuitem label="Choose Folder to Index" key="key_add" accesskey="C" oncommand="photos.add_dialog();" /> 95 <menuitem label="Re-Index" accesskey="R" oncommand="photos.removeAll();" /> 97 96 <menuitem id="menu_FileQuitItem" label="&menu.upload.exit;" key="key_quit" accesskey="Q" oncommand="exit();" /> 98 97 </menupopup> trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js
r615 r619 95 95 96 96 index_some_photos: function(){ 97 //photos.alert('start..');98 97 threads.indexer.dispatch(new IndexDrive(), threads.worker.DISPATCH_NORMAL); 99 98 }, … … 118 117 } 119 118 120 // Open the filepicker119 // Open the directory picker 121 120 var fp = Cc['@mozilla.org/filepicker;1'] 122 121 .createInstance(Ci.nsIFilePicker); … … 127 126 fp.displayDirectory = def; 128 127 var res = fp.show(); 128 129 129 if (Ci.nsIFilePicker.returnOK == res) { 130 photos.removeAll();photos.load(fp.file.path);ui.init(); 130 photos.file = Cc['@mozilla.org/file/local;1'] 131 .createInstance(Ci.nsILocalFile); 132 photos.file.initWithPath(fp.file.path); 133 logStringMessage("!!" + photos.file.path); 134 135 photos.removeAll(); 136 137 photos.index_some_photos(); 138 131 139 nsPreferences.setUnicharPref('flickr.add_directory', fp.file.path); 132 140 } … … 350 358 351 359 352 if(to_flash.length > 0) 360 if(to_flash.length > 0){ 353 361 photos.call_swf('add_files', [to_flash]); 362 } 354 363 355 364 for(var i=0;i<to_flash.length;i++){ … … 930 939 931 940 // Load saved metadata 932 load: function( path){933 934 var obj = !path ? file.read('photos.json') : {};941 load: function(){ 942 943 var obj = file.read('photos.json'); 935 944 936 945 if(obj.indexed_paths) 937 946 photos.indexed_paths = obj.indexed_paths; 947 else 948 photos.indexed_paths = {}; 938 949 939 if(path) {940 photos.file = Cc['@mozilla.org/file/local;1']941 .createInstance(Ci.nsILocalFile);942 photos.file.initWithPath(path);943 }944 950 945 951 if(obj.list) … … 1007 1013 // this is desperate move when the uploadr is in unusable state 1008 1014 removeAll: function() { 1015 1009 1016 //if (document.getElementById('t_clear').className == 'disabled_button') 1010 1017 //return; 1011 1018 //document.getElementById('t_clear').className = 'disabled_button'; 1019 1012 1020 photos.thumb_cancel = true; 1013 1021 if (conf.console.thumb) { 1014 logStringMessage('clearing');1015 }1022 logStringMessage('clearing'); 1023 } 1016 1024 photos.list = []; 1017 1025 photos.indexed_paths = {}, 1026 photos.added_paths = {}, 1027 photos.indexed_dirs = file.get_excluded_directories(); 1028 photos.last_dir = null; 1029 photos.last_file = null; 1030 photos.indexed_contents = {}, 1031 photos.to_thumb = []; 1018 1032 photos.selected = []; 1019 1033 photos.count = 0; … … 1021 1035 photos.errors = 0; 1022 1036 photos.batch_size = 0; 1037 photos.waiting_to_thumb = 0; 1023 1038 photos.video_batch_size = 0; 1024 1039 _block_sort = _block_remove = _block_normalize = _block_exit = 0; … … 1036 1051 */ 1037 1052 ui.bandwidth_updated(); 1053 photos.thumb_cancel = false; 1038 1054 //meta.disable(); 1039 1055 //buttons.upload.disable(); trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/threads.js
r615 r619 180 180 var thumb = this.result.split('###'); 181 181 182 if(!photos.list[this.id])//cancelled 183 return; 182 184 // Get this photo from the DOM and remove its loading class 183 185 … … 247 249 //photos.list[this.id].hash = file.compute_file_hash(thumbPath); 248 250 if(photos.list[this.id].thumb_width < 400){ 251 logStringMessage(this.id); 249 252 photos.call_swf('thumbnail_done', [photos.list[this.id], thumbPath]); 250 253 } … … 655 658 656 659 }; 660 657 661 IndexDrive.prototype = { 658 662 paths:[], … … 662 666 663 667 668 669 664 670 if(!photos.file){ 665 671 path = Cc['@mozilla.org/file/directory_service;1'] … … 681 687 //if(photos.last_dir) 682 688 //photos.file = photos.last_dir; 683 689 684 690 this.paths = []; 685 691 this.short_circuit = false; … … 966 972 }; 967 973 968 trunk/uploadr/flash/src/Model.as
r602 r619 14 14 public class Model{ 15 15 16 16 17 public var current_tags:Object; 17 18 public var user:Object; … … 36 37 37 38 public var current_id:String; 38 public var current:Array ;39 public var current:Array = new Array(); 39 40 public var current_by_id:Object; 40 41 … … 59 60 public var initialized:Boolean; 60 61 61 62 63 62 public var selected:Array; 64 63 public var selection_by_id:Object = {}; 65 64 66 private var views:Array ;65 private var views:Array = new Array(); 67 66 private var timer:Timer; 68 67 //private var api:FlickrAPI; … … 70 69 private var look_larger; 71 70 72 public var tag_sections:Array ;71 public var tag_sections:Array = new Array(); 73 72 74 73 … … 79 78 80 79 public function Model(){ 81 82 this.initVars();83 84 85 86 80 87 81 this.mode = "date"; … … 100 94 } 101 95 102 private function initVars(){103 this.views = new Array();104 this.tag_sections = new Array();105 }106 107 96 public function reset(){ 108 this.initVars();109 97 this.sets_by_id = new Object(); 110 98 this.tags_by_id = new Object(); … … 113 101 this.current_by_id = new Object(); 114 102 this.current_id = null; 115 this.current = null; 103 this.current = new Array(); 104 this.tag_sections = new Array(); 116 105 this.set_data = new Array(); 117 106 this.tag_data = new Array(); … … 124 113 this.updateSets(); 125 114 this.updateList(); 115 this.dispatch("ListChanged"); 126 116 this.refreshMode(); 127 this.dispatch("ListChanged");128 117 this.dispatch("CurrentChanged"); 118 this.dispatch("Reset"); 129 119 } 130 120 … … 462 452 this.current_tags = new Object(); 463 453 464 //this.updateDatesTags();454 this.updateDatesTags(); 465 455 466 456 //this.updateCurrentById(); … … 476 466 for(var i=0; i < this.current.length; i++){ 477 467 if(this.current[i].tags){ 478 var ts:Array = this.current[i].tags.split(" ");468 var ts:Array = this.current[i].tags.split(" "); 479 469 for(var k=0; k<ts.length;k++){ 480 470 if(!this.current_tags[ts[k]]) trunk/uploadr/flash/src/widget/Grid.as
r602 r619 212 212 } 213 213 214 public function clear(){ 215 this.removed_items = {}; 216 } 217 214 218 public function addItem(p:Object, no_refresh=false){ 215 219 if(!this.removed_items[p.id]){ trunk/uploadr/flash/src/widget/PhotoGrid.as
r602 r619 27 27 private function refresh_progress(){ 28 28 for(var j in this.grid.items){ 29 if(this.m.all[j] .progress >=0)29 if(this.m.all[j] && this.m.all[j].progress >=0) 30 30 this.grid.items[j].progress = this.m.all[j].progress; 31 31 } … … 40 40 this.grid.refresh(); 41 41 this.grid.scroll_bar.refresh(); 42 } 43 44 public function m_Reset(){ 45 this.grid.clear(); 42 46 } 43 47