Prominent notice in TFUSBController.m.
[MacTF.git] / UKUpdateChecker.h
blob78658baf60ec955665d696848ce6ebdea4895ddb
1 //
2 // UKUpdateChecker.h
3 // NiftyFeatures
4 //
5 // Created by Uli Kusterer on Sun Nov 23 2003.
6 // Copyright (c) 2003 M. Uli Kusterer. All rights reserved.
7 //
11 Directions: Instantiate one of these in your MainMenu.nib. Hook up your
12 "Check for updates..." menu item (should be the second in your
13 <application name> menu, immediately after the "About" item) to
14 the checkForUpdates: action.
16 At first startup, this will ask the user whether she wants it
17 to check for updates at each startup. It will remember that
18 choice in the standard user defaults, and if it was yes, it
19 will check at each startup, displaying a message whenever
20 a newer version becomes available.
22 Also note that the URL where this expects the version info file
23 to be is in the Localizable.strings file, as are all messages
24 this class displays.
27 // -----------------------------------------------------------------------------
28 // Headers:
29 // -----------------------------------------------------------------------------
31 #import <Foundation/Foundation.h>
34 // -----------------------------------------------------------------------------
35 // Constants:
36 // -----------------------------------------------------------------------------
38 // New (MacPad-compatible) Plist keys:
39 #define UKUpdateCheckerURLFilename @"MacPAD" // MacPAD.url file in your bundle's "Resources" folder with URL of .plist file listing the updates.
40 #define UKUpdateCheckerVersionPlistKey @"productVersion" // String holding newest version number.
41 #define UKUpdateCheckerURLPlistKey @"productPageURL" // String with product web page URL.
43 // Old Plist keys: (legacy, do not use these, only so you can keep your old
44 // files until you have time to update them)
45 #define UKUpdateCheckerOldVersionPlistKey @"version" // String holding newest version number.
46 #define UKUpdateCheckerOldURLPlistKey @"url" // String with download web page URL.
48 // Only check at startup every N days. Since checking every time at startup
49 // can cause huge bandwidth problems, you can use this number to adjust the
50 // frequency. It won't check more often than once per day, anyway.
51 #ifndef DAYS_BETWEEN_CHECKS
52 #define DAYS_BETWEEN_CHECKS 10 // Default: 10, you may change this.
53 #endif
56 // -----------------------------------------------------------------------------
57 // UKUpdateChecker class:
58 // -----------------------------------------------------------------------------
60 @interface UKUpdateChecker : NSObject
62 IBOutlet NSButton* prefsButton; // Optional button in the preferences window for turning "check at startup" on/off.
65 // Action for the "check for updates" menu item:
66 -(IBAction) checkForUpdates: (id)sender;
69 // Use this as the action of any "Preferences" button for setting checkAtStartup you may have:
70 -(IBAction) takeBoolFromObject: (id)sender;
73 // This object handles it all for you, but if you need to, use this to turn on/off checking at startup:
74 -(void) setCheckAtStartup: (BOOL)shouldCheck;
75 -(BOOL) checkAtStartup;
78 // Private:
79 -(void) checkForUpdatesAndNotifyIfUnsuccessful: (BOOL)doNotify;
81 @end