Index: Info-Camino.plist.in
===================================================================
RCS file: /cvsroot/mozilla/camino/Info-Camino.plist.in,v
retrieving revision 1.2
diff -u -r1.2 Info-Camino.plist.in
--- Info-Camino.plist.in 29 Aug 2007 14:01:09 -0000 1.2
+++ Info-Camino.plist.in 28 Oct 2007 17:29:25 -0000
@@ -151,6 +151,13 @@
CFBundleVersion
%CM_APP_VERSION%
+ LSFileQuarantineEnabled
+
+ LSFileQuarantineExcludedPathPatterns
+
+ ~/Library/Caches/*
+ ~/Library/Application Support/*
+
LSMinimumSystemVersion
10.4
NSAppleScriptEnabled
@@ -182,15 +189,33 @@
- LSFileQuarantineEnabled
-
- LSFileQuarantineExcludedPathPatterns
-
- ~/Library/Caches/*
- ~/Library/Application Support/*
-
OSAScriptingDefinition
Camino.sdef
+ SUCheckAtStartup
+
+ SUExpectsDSASignature
+
+ SUPublicDSAKey
+ -----BEGIN PUBLIC KEY-----
+MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQDQ4Easn8ybXNil3l8UXWHnu2s7Q4Kk
+uXXMZ2V/l8LLrQ3AlaH/7CZoUKY+LtpmPHL57yHvFWQIxJGz4BwkFBgt+4Yvw2Lh
+miXi2sMSKK721sXkoPZO3iQsdSIav0A//B2EWM3wCya3LY8V7Pwd06hIGErG+2sR
+Zm7oqyCZvC2f8jjradkGzOKssOWm1TaLHL230u65lf9roTVG0UCFSPcgN29u0u7v
+OGiYlkTqsE0Dv4hi4QxxJQk2mn7dJYcNRnkbciaxCSdcqPMvIg0DPL300C3YfaCu
+dDAHlCj70kZSp2m2jGZQFwGyZ82xu6QjE3ocTG7mjHJSTG2cmeSn2cFDAhUAxjIm
+aMWtvHGo5Rxcn09EzZvqa28CggEAA0bvQnqr3ekK8Tuy3GbqOQxQahOmLmjKKDfT
+3QXYPMt+pyWh5Eoay1uCpZtc99PXqWDg1dN0LVRFu2M9S8iTeNNCtQ42E0Hm1oNs
+J0SQa1lf2/rMr+xwIj0kJtpr+uvYTPPoSJgPOXa/W/5o0b/VCRCT8QXqvQMmd++B
+ZFkf9pLVh8eH/Gfa5abLcLGDR2kWsRA4vra+cZJbMDKxfB3MsI125ejBhb698ltv
+dHHUIxm/e92+r6pP73/EC9SwgjtFQWBL4ZjBZg6kdhHdw6WIWVRDsZTvdquK5B7g
+I5NMqJyl/eaTGnKD+Q349GeQtdnc2txUGxeMb83SWulPgEZNZQOCAQUAAoIBAHva
+7XzuaZiAvgnIGFuSA61tO3nIT7CtLbgMqRPBBGoIh9qG+JcQNOQ5BAtq839mP1FC
+nOXEajr3UDO5tKn4V3Y3X/jCjwDLZHIP+Y5m/cvVm50tSrBIfT2G5pUrGd9cSEDG
+XfYOEaMdGVa9aLBrSo9739WVbWg7UIEqb0D2a3nBo16JDSyn9H7Hcq2cjWJugQZ6
+UM2UtHwvaK/NHAcprjANQuYQ78U4GapNnuLIXx1EBru8gSKHlcyeOu9fa79oAhvN
+xz+k1ujre1mK8oq2DT2kCo29Ufgsc6U5bCc2Bs7S/fHOVBjxUf9/XIfvOyJRCbVJ
+2hR9h9Vj9Fd3jEyXbQA=
+-----END PUBLIC KEY-----
mozProfileDirName
Camino
Index: PreferencePanes/Navigation/Navigation.h
===================================================================
RCS file: /cvsroot/mozilla/camino/PreferencePanes/Navigation/Navigation.h,v
retrieving revision 1.21
diff -u -r1.21 Navigation.h
--- PreferencePanes/Navigation/Navigation.h 23 Feb 2007 01:37:38 -0000 1.21
+++ PreferencePanes/Navigation/Navigation.h 28 Oct 2007 17:29:41 -0000
@@ -50,6 +50,7 @@
IBOutlet NSButton* checkboxCheckDefaultBrowserOnLaunch;
IBOutlet NSButton* checkboxWarnWhenClosing;
IBOutlet NSButton* checkboxRememberWindowState;
+ IBOutlet NSButton* checkboxAutoUpdate;
}
- (IBAction)checkboxStartPageClicked:(id)sender;
@@ -58,6 +59,7 @@
- (IBAction)warningCheckboxClicked:(id)sender;
- (IBAction)rememberWindowStateCheckboxClicked:(id)sender;
- (IBAction)checkDefaultBrowserOnLaunchClicked:(id)sender;
+- (IBAction)autoUpdateCheckboxClicked:(id)sender;
// method to be called so that when the default feed viewer is modified
// in FeedServiceController, we can rebuild the list here as well.
Index: PreferencePanes/Navigation/Navigation.mm
===================================================================
RCS file: /cvsroot/mozilla/camino/PreferencePanes/Navigation/Navigation.mm,v
retrieving revision 1.38
diff -u -r1.38 Navigation.mm
--- PreferencePanes/Navigation/Navigation.mm 23 Feb 2007 01:37:38 -0000 1.38
+++ PreferencePanes/Navigation/Navigation.mm 28 Oct 2007 17:29:41 -0000
@@ -41,9 +41,11 @@
#import
#import
#import
+#import
#import "NSWorkspace+Utils.h"
#import "AppListMenuFactory.h"
+#import "UserDefaults.h"
#import "Navigation.h"
@@ -101,6 +103,9 @@
if ([self getBooleanPref:"camino.remember_window_state" withSuccess:&gotPref])
[checkboxRememberWindowState setState:NSOnState];
+ if ([[NSUserDefaults standardUserDefaults] integerForKey:SUScheduledCheckIntervalKey] > 0)
+ [checkboxAutoUpdate setState:NSOnState];
+
[textFieldHomePage setStringValue:[self getCurrentHomePage]];
// set up default browser menu
@@ -161,6 +166,20 @@
[self setPref:"camino.check_default_browser" toBoolean:([sender state] == NSOnState)];
}
+- (IBAction)autoUpdateCheckboxClicked:(id)sender
+{
+ if (sender == checkboxAutoUpdate) {
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
+ if ([sender state] == NSOnState) {
+ [defaults setInteger:USER_DEFAULTS_UPDATE_INTERVAL_DEFAULT
+ forKey:SUScheduledCheckIntervalKey];
+ }
+ else {
+ [defaults setInteger:0 forKey:SUScheduledCheckIntervalKey];
+ }
+ }
+}
+
- (NSString*)getCurrentHomePage
{
BOOL gotPref;
Index: config/Camino.xcconfig
===================================================================
RCS file: /cvsroot/mozilla/camino/config/Camino.xcconfig,v
retrieving revision 1.8
diff -u -r1.8 Camino.xcconfig
--- config/Camino.xcconfig 28 Aug 2007 23:49:31 -0000 1.8
+++ config/Camino.xcconfig 28 Oct 2007 17:29:41 -0000
@@ -15,6 +15,7 @@
OTHER_LDFLAGS = -lpthread -lm -Wl,-executable_path,../dist/bin
LIBRARY_SEARCH_PATHS = ../dist/bin ../dist/lib
HEADER_SEARCH_PATHS = ../dist/include/ ../dist/include/appcomps ../dist/include/caps ../dist/include/chardet ../dist/include/chrome ../dist/include/commandhandler ../dist/include/composer ../dist/include/content ../dist/include/cookie ../dist/include/docshell ../dist/include/dom ../dist/include/downloadmanager ../dist/include/editor ../dist/include/embed_base ../dist/include/exthandler ../dist/include/find ../dist/include/gfx ../dist/include/helperAppDlg ../dist/include/history ../dist/include/htmlparser ../dist/include/intl ../dist/include/js ../dist/include/layout ../dist/include/locale ../dist/include/mimetype ../dist/include/mork ../dist/include/necko ../dist/include/nkcache ../dist/include/nspr ../dist/include/pipboot ../dist/include/pipnss ../dist/include/pref ../dist/include/profdirserviceprovider ../dist/include/shistory ../dist/include/spellchecker ../dist/include/string ../dist/include/thebes ../dist/include/txtsvc ../dist/include/uconv ../dist/include/unicharutil ../dist/include/uriloader ../dist/include/view ../dist/include/webbrowserpersist ../dist/include/webbrwsr ../dist/include/webshell ../dist/include/widget ../dist/include/windowwatcher ../dist/include/xmlextras ../dist/include/xpcom ../dist/include/xpcom_obsolete ../dist/include/xpconnect ../dist/include/xultmpl ../dist/public/nss $(SYSTEM_DEVELOPER_DIR)/Headers/FlatCarbon $(LOCAL_LIBRARY_DIR)/Frameworks/SharedMenusCocoa.framework/Headers
+FRAMEWORK_SEARCH_PATHS = sparkle/build/Release
// Warning settings
GCC_WARN_SIGN_COMPARE = YES
Index: resources/application/all-camino.js.in
===================================================================
RCS file: /cvsroot/mozilla/camino/resources/application/all-camino.js.in,v
retrieving revision 1.5
diff -u -r1.5 all-camino.js.in
--- resources/application/all-camino.js.in 28 Aug 2007 23:49:35 -0000 1.5
+++ resources/application/all-camino.js.in 28 Oct 2007 17:29:41 -0000
@@ -190,3 +190,6 @@
// Camino makes its own popup windows (context menus, tooltips)
pref("ui.use_native_popup_windows", true);
+
+// auto-update URL base
+pref("app.update.url", "https://caminobrowser.org/update-check");
Index: src/application/MainController.h
===================================================================
RCS file: /cvsroot/mozilla/camino/src/application/MainController.h,v
retrieving revision 1.79
diff -u -r1.79 MainController.h
--- src/application/MainController.h 18 Apr 2007 20:41:23 -0000 1.79
+++ src/application/MainController.h 28 Oct 2007 17:29:42 -0000
@@ -48,6 +48,7 @@
@class PreferenceManager;
@class FindDlgController;
@class MVPreferencesController;
+@class SUUpdater;
typedef enum EBookmarkOpenBehavior
@@ -88,6 +89,8 @@
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem; // unused
IBOutlet NSMenuItem* mShowAllBookmarksMenuItem;
+ IBOutlet SUUpdater* mAutoUpdater;
+
BOOL mInitialized;
BOOL mOffline;
BOOL mGeckoInitted;
Index: src/application/MainController.mm
===================================================================
RCS file: /cvsroot/mozilla/camino/src/application/MainController.mm,v
retrieving revision 1.240
diff -u -r1.240 MainController.mm
--- src/application/MainController.mm 5 Oct 2007 04:41:54 -0000 1.240
+++ src/application/MainController.mm 28 Oct 2007 17:29:45 -0000
@@ -38,6 +38,7 @@
* ***** END LICENSE BLOCK ***** */
#import
+#import
#import "NSArray+Utils.h"
#import "NSString+Utils.h"
@@ -168,6 +169,9 @@
- (void)dealloc
{
+ if ([self isInitialized])
+ [[NSUserDefaults standardUserDefaults] removeObserver:self forKeyPath:SUScheduledCheckIntervalKey];
+
[mCharsets release];
// Terminate shared menus
@@ -334,6 +338,13 @@
else {
[[SessionManager sharedInstance] clearSavedState];
}
+
+ // Watch for any changes to the Sparkle auto-check pref so we can inform
+ // the updater to adjust accordingly.
+ [[NSUserDefaults standardUserDefaults] addObserver:self
+ forKeyPath:SUScheduledCheckIntervalKey
+ options:NSKeyValueObservingOptionNew
+ context:nil];
[self setInitialized:YES];
}
@@ -906,6 +917,20 @@
[self delayedUpdatePageInfo];
}
+- (void)observeValueForKeyPath:(NSString *)keyPath
+ ofObject:(id)object
+ change:(NSDictionary *)change
+ context:(void *)context
+{
+ if ([keyPath isEqualToString:SUScheduledCheckIntervalKey]) {
+ NSTimeInterval updatePeriod = [[NSUserDefaults standardUserDefaults] integerForKey:SUScheduledCheckIntervalKey];
+ // Note that this sets up a *repeating* check with this interval, so setting
+ // this shorter to cause the next update to happen quickly would be bad.
+ // An updatePeriod of 0 here disables the checks, which is what we want.
+ [mAutoUpdater scheduleCheckWithInterval:updatePeriod];
+ }
+}
+
#pragma mark -
#pragma mark -
#pragma mark Application Menu
Index: src/application/UserDefaults.h
===================================================================
RCS file: /cvsroot/mozilla/camino/src/application/UserDefaults.h,v
retrieving revision 1.8
diff -u -r1.8 UserDefaults.h
--- src/application/UserDefaults.h 13 Jul 2007 22:00:04 -0000 1.8
+++ src/application/UserDefaults.h 28 Oct 2007 17:29:45 -0000
@@ -51,4 +51,5 @@
#define USER_DEFAULTS_AUTOCOMPLETE_WHILE_TYPING @"Autocomplete While Typing" /* Boolean */
#define USER_DEFAULTS_CONTAINER_SPLITTER_WIDTH @"Bookmarks Splitter position" /* Float */
#define USER_DEFAULTS_LAST_SELECTED_BM_FOLDER @"Last Selected Bookmark Folder" /* String */
+#define USER_DEFAULTS_UPDATE_INTERVAL_DEFAULT (24 * 60 * 60)
Index: src/extensions/NSWorkspace+Utils.h
===================================================================
RCS file: /cvsroot/mozilla/camino/src/extensions/NSWorkspace+Utils.h,v
retrieving revision 1.7
diff -u -r1.7 NSWorkspace+Utils.h
--- src/extensions/NSWorkspace+Utils.h 18 Jul 2007 16:16:01 -0000 1.7
+++ src/extensions/NSWorkspace+Utils.h 28 Oct 2007 17:29:45 -0000
@@ -57,6 +57,7 @@
- (NSString*)displayNameForFile:(NSURL*)inFileURL;
// OS feature checks
++ (NSString*)osVersionString;
+ (BOOL)isTigerOrHigher;
+ (BOOL)supportsSpotlight;
+ (BOOL)supportsUnifiedToolbar;
Index: src/extensions/NSWorkspace+Utils.m
===================================================================
RCS file: /cvsroot/mozilla/camino/src/extensions/NSWorkspace+Utils.m,v
retrieving revision 1.11
diff -u -r1.11 NSWorkspace+Utils.m
--- src/extensions/NSWorkspace+Utils.m 25 Jul 2007 16:41:53 -0000 1.11
+++ src/extensions/NSWorkspace+Utils.m 28 Oct 2007 17:29:45 -0000
@@ -135,6 +135,19 @@
}
//
+// +osVersionString
+//
+// Returns the system version string from
+// /System/Library/CoreServices/SystemVersion.plist
+// (as recommended by Apple).
+//
++ (NSString*)osVersionString
+{
+ NSDictionary* versionInfo = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
+ return [versionInfo objectForKey:@"ProductVersion"];
+}
+
+//
// +systemVersion
//
// Returns the host's OS version as returned by the 'sysv' gestalt selector,
Index: src/preferences/PreferenceManager.mm
===================================================================
RCS file: /cvsroot/mozilla/camino/src/preferences/PreferenceManager.mm,v
retrieving revision 1.81
diff -u -r1.81 PreferenceManager.mm
--- src/preferences/PreferenceManager.mm 28 Aug 2007 22:12:30 -0000 1.81
+++ src/preferences/PreferenceManager.mm 28 Oct 2007 17:29:46 -0000
@@ -38,7 +38,10 @@
#import
+#import
+
#import "NSString+Gecko.h"
+#import "NSWorkspace+Utils.h"
#import "PreferenceManager.h"
#import "AppDirServiceProvider.h"
@@ -201,6 +204,7 @@
@interface PreferenceManager(PreferenceManagerPrivate)
- (void)registerNotificationListener;
+- (void)initUpdatePrefs;
- (void)termEmbedding:(NSNotification*)aNotification;
- (void)xpcomTerminate:(NSNotification*)aNotification;
@@ -376,6 +380,8 @@
// we should never get here
NSLog (@"Failed to initialize mozilla prefs");
}
+
+ [self initUpdatePrefs];
mDefaults = [NSUserDefaults standardUserDefaults];
}
@@ -654,6 +660,41 @@
return YES;
}
+- (void)initUpdatePrefs
+{
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
+
+ // Get the base auto-update manifest URL
+ NSString* baseURL = [self getStringPref:"app.update.url.override"
+ withSuccess:NULL];
+ if (![baseURL length])
+ baseURL = [self getStringPref:"app.update.url" withSuccess:NULL];
+ NSString* intlUAString = [self getStringPref:"general.useragent.extra.multilang"
+ withSuccess:NULL];
+ // Append the parameters we might be interested in.
+ NSString* manifestURL = !baseURL ? @"" : [NSString stringWithFormat:@"%@?os=%@&arch=%@&version=%@&intl=%d",
+ baseURL,
+ [NSWorkspace osVersionString],
+#if defined(__ppc__)
+ @"ppc",
+#elif defined(__i386__)
+ @"x86",
+#else
+#error Unknown Architecture
+#endif
+ [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],
+ ([intlUAString length] ? 1 : 0)];
+ [defaults setObject:manifestURL forKey:SUFeedURLKey];
+
+ // Set the update interval default if none is set. We don't set this in the
+ // Info.plist because once there's a value there it's impossible to actually
+ // disable update checking.
+ if (![defaults objectForKey:SUScheduledCheckIntervalKey]) {
+ [defaults setInteger:USER_DEFAULTS_UPDATE_INTERVAL_DEFAULT
+ forKey:SUScheduledCheckIntervalKey];
+ }
+}
+
// Convert an Apple locale (or language with the dialect specified) from the form en_GB
// to the en-gb form required for HTTP accept-language headers.
// If the locale isn't in the expected form we return nil. (Systems upgraded