Changeset 583

Show
Ignore:
Timestamp:
04/01/09 10:05:49 (8 months ago)
Author:
jdecq
Message:

- add logging support for sorting
- don't just ignore blocked sort but reschedule them

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/conf.js

    r541 r583  
    4242                timeout: true, 
    4343                retry: true, 
    44                 fileLogging: false 
     44                fileLogging: false, 
     45                sort: false, 
     46                normalize: false 
    4547        }, 
    4648 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js

    r559 r583  
    784784        // Normalize the photo list and selected list with the DOM 
    785785        normalize: function() { 
     786                if(conf.console.normalize) { 
     787                    logStringMessage('normalize'); 
     788                } 
    786789                if (isNormalizing || _block_normalize) { 
    787790                    photos.normalizeTimeoutId = window.setTimeout(function() { 
    788791                        photos.normalize(); 
    789                     }, 100); 
     792                    }, 500); 
    790793                    return; 
    791794                } 
    792795                isNormalizing = true; 
     796                if(conf.console.normalize) { 
     797                    logStringMessage('normalize [in]'); 
     798                } 
    793799                document.getElementById('photos').style.display = 'none'; 
    794800                document.getElementById('normalizing').style.display = '-moz-box'; 
     
    815821                document.getElementById('photos').style.display = '-moz-box'; 
    816822                document.getElementById('normalizing').style.display = 'none'; 
     823                if(conf.console.normalize) { 
     824                    logStringMessage('normalize [out]'); 
     825                } 
    817826                isNormalizing = false; 
    818827        }, 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/threads.js

    r556 r583  
    439439SortCallback.prototype = { 
    440440        run: function() { 
     441                if(conf.console.sort) { 
     442                    logStringMessage('sort'); 
     443                } 
    441444                // Allow blocking sorts during loading 
    442445                if (0 != _block_sort) {  
     446                    window.setTimeout(function() { 
     447                        threads.main.dispatch(new SortCallback(), threads.main.DISPATCH_NORMAL); 
     448                    }, 500 ); 
    443449                    return; 
    444450                } 
     
    446452                // Perform the sort 
    447453                block_normalize(); 
     454                if(conf.console.sort) { 
     455                    logStringMessage('sort [in] ' + _block_normalize); 
     456                } 
    448457                if (1 >= photos.list.length) { 
    449                         if (1 == photos.list.length) { buttons.upload.enable(); } 
     458                        if (1 == photos.list.length) {  
     459                            buttons.upload.enable();  
     460                        } 
     461            if(conf.console.sort) { 
     462                        logStringMessage('sort [out]'); 
     463                    } 
    450464                        unblock_normalize(); 
    451465                        return; 
     
    475489                } 
    476490                unblock_normalize(); 
    477                 photos.normalize(); 
     491        if(conf.console.sort) { 
     492            logStringMessage('sort [out]'); 
     493            } 
     494            photos.normalize(); 
    478495 
    479496                // And finally allow them to upload 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/ui.js

    r550 r583  
    202202 
    203203                about: function() { 
     204                    //photos.normalize(); 
    204205                        window.openDialog('chrome://uploadr/content/about.xul', 
    205206                                'about-dialog', 'chrome,modal,centerscreen', 
     
    382383var unblock_normalize = function() { 
    383384        --_block_normalize; 
     385        if(_block_normalize < 0) { 
     386            logStringMessage("extra unblock_normalize :-("); 
     387        } 
    384388}; 
    385389var _block_exit = 0;