Changeset 6673


Ignore:
Timestamp:
Aug 31, 2008, 9:10:45 PM (13 years ago)
Author:
livings124
Message:

make sure the blocklist sheet's initial text matches the current download status (this will matter later on)

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BlocklistDownloader.h

    r6671 r6673  
    2727@class BlocklistDownloaderViewController;
    2828
     29typedef enum
     30{
     31    BLOCKLIST_DL_START,
     32    BLOCKLIST_DL_DOWNLOADING,
     33    BLOCKLIST_DL_PROCESSING
     34} blocklistDownloadState;
     35
    2936@interface BlocklistDownloader : NSObject
    3037{
     
    3542    NSUInteger fCurrentSize;
    3643    long long fExpectedSize;
     44   
     45    blocklistDownloadState fState;
    3746}
    3847
  • trunk/macosx/BlocklistDownloader.m

    r6671 r6673  
    6262    if (fViewController)
    6363    {
     64        switch (fState)
     65        {
     66            case BLOCKLIST_DL_START:
     67                [fViewController setStatusStarting];
     68                break;
     69            case BLOCKLIST_DL_DOWNLOADING:
     70                [fViewController setStatusProgressForCurrentSize: fCurrentSize expectedSize: fExpectedSize];
     71                break;
     72            case BLOCKLIST_DL_PROCESSING:
     73                [fViewController setStatusProcessing];
     74                break;
     75        }
     76       
    6477        #warning set actual status
    6578        [fViewController setStatusStarting];
     
    8598- (void) download: (NSURLDownload *) download didReceiveResponse: (NSURLResponse *) response
    8699{
     100    fState = BLOCKLIST_DL_DOWNLOADING;
     101   
    87102    fCurrentSize = 0;
    88103    fExpectedSize = [response expectedContentLength];
     
    107122- (void) downloadDidFinish: (NSURLDownload *) download
    108123{
     124    fState = BLOCKLIST_DL_PROCESSING;
     125   
    109126    if ([NSApp isOnLeopardOrBetter])
    110127        [self performSelectorInBackground: @selector(finishDownloadSuccess) withObject: nil];
     
    119136- (void) startDownload
    120137{
     138    fState = BLOCKLIST_DL_START;
     139   
    121140    NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: LIST_URL]];
    122141   
Note: See TracChangeset for help on using the changeset viewer.