Changeset 5116

Show
Ignore:
Timestamp:
12/12/07 17:38:14 (8 months ago)
Author:
morris
Message:

Add Sparkle support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Spiral/trunk/English.lproj/MainMenu.nib/classes.nib

    r5099 r5116  
    6767                                <key>_subtitleTrackMenu</key> 
    6868                                <string>NSMenu</string> 
     69                                <key>_updater</key> 
     70                                <string>SUUpdater</string> 
    6971                        </dict> 
    7072                        <key>SUPERCLASS</key> 
     
    107109                </dict> 
    108110                <dict> 
     111                        <key>ACTIONS</key> 
     112                        <dict> 
     113                                <key>checkForUpdates</key> 
     114                                <string>id</string> 
     115                        </dict> 
     116                        <key>CLASS</key> 
     117                        <string>SUUpdater</string> 
     118                        <key>LANGUAGE</key> 
     119                        <string>ObjC</string> 
     120                        <key>SUPERCLASS</key> 
     121                        <string>NSObject</string> 
     122                </dict> 
     123                <dict> 
    109124                        <key>CLASS</key> 
    110125                        <string>WIObject</string> 
  • Spiral/trunk/English.lproj/MainMenu.nib/info.nib

    r5099 r5116  
    1010        <integer>5</integer> 
    1111        <key>IBOpenObjects</key> 
    12         <array> 
    13                 <integer>301</integer> 
    14         </array> 
     12        <array/> 
    1513        <key>IBSystem Version</key> 
    1614        <string>9B18</string> 
  • Spiral/trunk/English.lproj/Preferences.nib/classes.nib

    r5107 r5116  
    88                        <key>ACTIONS</key> 
    99                        <dict> 
     10                                <key>checkForUpdate</key> 
     11                                <string>id</string> 
    1012                                <key>defaultSize</key> 
    1113                                <string>id</string> 
     
    2527                        <key>OUTLETS</key> 
    2628                        <dict> 
     29                                <key>_checkForUpdateButton</key> 
     30                                <string>NSButton</string> 
    2731                                <key>_defaultSizePopUpButton</key> 
    2832                                <string>NSPopUpButton</string> 
  • Spiral/trunk/Info.plist

    r5099 r5116  
    304304        <key>NSPrincipalClass</key> 
    305305        <string>WIApplication</string> 
     306        <key>SUFeedURL</key> 
     307        <string>http://www.zankasoftware.com/sparkle/spiral.xml</string> 
     308        <key>SUCheckAtStartup</key> 
     309        <false/> 
    306310</dict> 
    307311</plist> 
  • Spiral/trunk/SPApplicationController.h

    r5099 r5116  
    4545        IBOutlet NSPanel                        *_openURLPanel; 
    4646        IBOutlet NSTextView                     *_openURLTextView; 
     47 
     48        IBOutlet SUUpdater                      *_updater; 
    4749         
    48         WIURL                                           *_connectionRedirectURL; 
    49         BOOL                                            _connectionDone; 
    50  
    5150        BOOL                                            _holdingAppleRemoteButton; 
    5251} 
    5352 
    54 + (BOOL)openFile:(NSString *)path withPlaylistFile:(SPPlaylistFile *)file; 
    55 + (BOOL)openURL:(WIURL *)url withPlaylistFile:(SPPlaylistFile *)file; 
     53+ (SPApplicationController *)applicationController; 
     54 
     55- (BOOL)openFile:(NSString *)path withPlaylistFile:(SPPlaylistFile *)file; 
     56- (BOOL)openURL:(WIURL *)url withPlaylistFile:(SPPlaylistFile *)file; 
     57- (BOOL)hasPerianInstalled; 
     58- (void)scheduleUpdateCheck; 
    5659 
    5760- (IBAction)preferences:(id)sender; 
  • Spiral/trunk/SPApplicationController.m

    r5099 r5116  
    3737#import "SPSettings.h" 
    3838 
     39static SPApplicationController                  *SPSharedApplicationController; 
     40 
    3941@implementation SPApplicationController 
    4042 
    41 + (BOOL)hasPerianInstalled { 
    42         NSString                *libraryPath, *perianPath; 
    43         BOOL                    hasPerian = NO; 
    44          
    45         for(libraryPath in NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES)) { 
    46                 perianPath = [libraryPath stringByAppendingPathComponent:@"QuickTime/Perian.component"]; 
    47                  
    48                 if([[NSFileManager defaultManager] fileExistsAtPath:perianPath]) { 
    49                         hasPerian = YES; 
    50                          
    51                         break; 
    52                 } 
    53         } 
    54          
    55         return hasPerian; 
     43+ (SPApplicationController *)applicationController { 
     44        return SPSharedApplicationController; 
    5645} 
    5746 
     
    6049#pragma mark - 
    6150 
    62 + (BOOL)openFile:(NSString *)path withPlaylistFile:(SPPlaylistFile *)file { 
    63         return [self openURL:[WIURL fileURLWithPath:path] withPlaylistFile:file]; 
    64 } 
    65  
    66  
    67  
    68 + (BOOL)openURL:(WIURL *)url withPlaylistFile:(SPPlaylistFile *)file { 
    69         NSError                                 *error; 
    70         QTMovie                                 *movie; 
    71         SPPlayerController              *controller; 
    72          
    73         controller = [SPPlayerController currentPlayerController]; 
    74  
    75         if(!controller) 
    76                 controller = [[[SPPlayerController alloc] init] autorelease]; 
    77  
    78         movie = [[QTMovie alloc] initWithURL:[url URL] error:&error]; 
    79          
    80         if(!movie) { 
    81                 if(![[controller movieController] isInFullscreen]) 
    82                         [[NSDocumentController sharedDocumentController] presentError:error]; 
    83                  
    84                 return NO; 
    85         } 
    86          
    87         [controller setMovie:movie]; 
    88         [[controller movieController] setPlaylistFile:file]; 
    89         [[controller window] setRepresentedURL:[url URL]]; 
    90         [[controller window] setTitle:[url lastPathComponent]]; 
    91  
    92         if(![[controller movieController] isInFullscreen]) 
    93                 [controller showWindow:self]; 
    94