Show
Ignore:
Timestamp:
04/14/09 21:24:46 (7 months ago)
Author:
ashot
Message:

fix reset, add menu options for re-indexing and picking which folder to index

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/uploadr/flash/src/Model.as

    r602 r619  
    1414        public class Model{ 
    1515         
     16         
    1617                public var current_tags:Object; 
    1718                public var user:Object; 
     
    3637                 
    3738                public var current_id:String; 
    38                 public var current:Array
     39                public var current:Array = new Array()
    3940                public var current_by_id:Object; 
    4041                 
     
    5960                public var initialized:Boolean; 
    6061                 
    61                  
    62                  
    6362                public var selected:Array; 
    6463                public var selection_by_id:Object = {}; 
    6564                 
    66                 private var views:Array
     65                private var views:Array = new Array()
    6766                private var timer:Timer; 
    6867                //private var api:FlickrAPI; 
     
    7069                private var look_larger; 
    7170                 
    72                 public var tag_sections:Array
     71                public var tag_sections:Array = new Array()
    7372                 
    7473                 
     
    7978                 
    8079                public function Model(){ 
    81                          
    82                         this.initVars(); 
    83                          
    84                          
    85                          
    8680                         
    8781                        this.mode = "date"; 
     
    10094                } 
    10195                 
    102                 private function initVars(){ 
    103                         this.views = new Array(); 
    104                         this.tag_sections = new Array(); 
    105                 } 
    106                  
    10796                public function reset(){ 
    108                         this.initVars(); 
    10997                        this.sets_by_id = new Object(); 
    11098                        this.tags_by_id = new Object(); 
     
    113101                        this.current_by_id = new Object(); 
    114102                        this.current_id = null; 
    115                         this.current = null; 
     103                        this.current = new Array(); 
     104                        this.tag_sections = new Array(); 
    116105                        this.set_data = new Array(); 
    117106                        this.tag_data = new Array(); 
     
    124113                        this.updateSets(); 
    125114                        this.updateList(); 
     115                        this.dispatch("ListChanged"); 
    126116                        this.refreshMode(); 
    127                         this.dispatch("ListChanged"); 
    128117                        this.dispatch("CurrentChanged"); 
     118                        this.dispatch("Reset"); 
    129119                } 
    130120                 
     
    462452                        this.current_tags = new Object(); 
    463453                         
    464                         //this.updateDatesTags(); 
     454                        this.updateDatesTags(); 
    465455                                 
    466456                        //this.updateCurrentById(); 
     
    476466                        for(var i=0; i < this.current.length; i++){ 
    477467                                if(this.current[i].tags){ 
    478                                                var ts:Array = this.current[i].tags.split(" "); 
     468                                        var ts:Array = this.current[i].tags.split(" "); 
    479469                                        for(var k=0; k<ts.length;k++){ 
    480470                                                if(!this.current_tags[ts[k]]) 
  • trunk/uploadr/flash/src/widget/Grid.as

    r602 r619  
    212212                } 
    213213 
     214                public function clear(){ 
     215                        this.removed_items = {}; 
     216                } 
     217                 
    214218                public function addItem(p:Object, no_refresh=false){ 
    215219                        if(!this.removed_items[p.id]){ 
  • trunk/uploadr/flash/src/widget/PhotoGrid.as

    r602 r619  
    2727                private function refresh_progress(){ 
    2828                        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) 
    3030                                        this.grid.items[j].progress = this.m.all[j].progress; 
    3131                        } 
     
    4040                        this.grid.refresh(); 
    4141                        this.grid.scroll_bar.refresh(); 
     42                } 
     43                 
     44                public function m_Reset(){ 
     45                        this.grid.clear(); 
    4246                } 
    4347