413709 Don't automatically update unofficial builds. Only put our app.update.url into official builds. Disable update UI if there's no app.update.url. Show a tooltip for disabled items to keep people from getting too confused. r=smorgan

This commit is contained in:
mark%moxienet.com 2008-01-29 19:37:34 +00:00
Родитель b73e32b723
Коммит 632604544b
11 изменённых файлов: 64 добавлений и 21 удалений

Просмотреть файл

@ -66,6 +66,10 @@ PLATFORM_BUILD_ID_FILE = $(DEPTH)/config/buildid
PLATFORM_BUILD_ID := $(shell cat $(PLATFORM_BUILD_ID_FILE))
PLATFORM_INI_FILE = ../toolkit/xre/platform.ini
ifdef MOZILLA_OFFICIAL
APP_UPDATE_URL = https://caminobrowser.org/update-check
endif
# For Launch Services compatibility, CFBundleVersion can be at most three
# .-separated integers, aaaaaa.bb.cc, with a maximum of 429496.99.99. Use
# Camino's major and minor version number and the build date as the basis for
@ -194,7 +198,8 @@ generated/resources/application/all-camino.js: \
$(CM_APP_VERSION_FILE)
mkdir -p $(dir $@)
sed -e "s/%FOX_APP_VERSION%/$(FOX_APP_VERSION)/" \
-e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" $< > $@
-e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" \
-e "s@%APP_UPDATE_URL%@$(APP_UPDATE_URL)@" $< > $@
generated/Info-Camino.plist: \
$(srcdir)/Info-Camino.plist.in \

Просмотреть файл

@ -107,8 +107,15 @@ static const char kRememberWindowStatePrefName[] = "camino.remember_window_state
if ([self getBooleanPref:kRememberWindowStatePrefName withSuccess:&gotPref])
[checkboxRememberWindowState setState:NSOnState];
if ([[NSUserDefaults standardUserDefaults] integerForKey:SUScheduledCheckIntervalKey] > 0)
if ([[[NSUserDefaults standardUserDefaults] stringForKey:SUFeedURLKey] length] == 0) {
// Disable update checking if there's no feed to check. The tooltip comes
// from the main application because it's used there too.
[checkboxAutoUpdate setEnabled:NO];
[checkboxAutoUpdate setToolTip:NSLocalizedString(@"AutoUpdateDisabledToolTip", @"")];
}
else if ([[NSUserDefaults standardUserDefaults] integerForKey:SUScheduledCheckIntervalKey] > 0) {
[checkboxAutoUpdate setState:NSOnState];
}
[textFieldHomePage setStringValue:[self currentHomePage]];

Просмотреть файл

@ -195,4 +195,4 @@ pref("wallet.crypto.autocompleteoverride", false);
pref("ui.use_native_popup_windows", true);
// auto-update URL base
pref("app.update.url", "https://caminobrowser.org/update-check");
pref("app.update.url", "%APP_UPDATE_URL%");

Просмотреть файл

@ -457,3 +457,6 @@
"SearchPluginInstallationConfirmationMessage" = "Would you like to add the search engine “%@” to the search field?";
"SearchPluginInstallationConfirmButton" = "Add";
"SearchPluginInstallationCancelButton" = "Dont Add";
/* Auto-Update */
"AutoUpdateDisabledToolTip" = "Automatic updates are available in official builds";

Просмотреть файл

@ -139,6 +139,7 @@
aboutPlugins = id;
aboutServers = id;
aboutWindow = id;
checkForUpdates = id;
clearHistory = id;
closeAllWindows = id;
closeCurrentTab = id;
@ -149,7 +150,6 @@
emptyCache = id;
exportBookmarks = id;
feedbackLink = id;
findInPage = id;
goBack = id;
goForward = id;
goHome = id;

Двоичные данные
camino/resources/localized/English.lproj/MainMenu.nib/keyedobjects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -7,5 +7,7 @@ This is based on trunk r52 of Sparkle:
svn co -r52 http://code.andymatuschak.org/sparkle/trunk Sparkle
with the following changes:
- Bug 405901: fix an XML attribute handling bug (already part of Sparkle trunk)
- Bug 412857: don't show CFBundleVersion (Sparkle ticket 150; may require some change on our part when we switch to trunk)
- Bug 412857: don't show CFBundleVersion (Sparkle ticket 150; may require some
change on our part when we switch to trunk)
- Bug 412837: keep updates out of the quarantine
- In support of bug 413709: let an empty value for SUFeedURLKey disable updates

Просмотреть файл

@ -149,6 +149,17 @@
// This is generally useful for a menu item--when the check is explicitly invoked.
- (void)checkForUpdatesAndNotify:(BOOL)verbosity
{
// A value in the user defaults overrides one in the Info.plist (so preferences panels can be created wherein users choose between beta / release feeds).
NSString *appcastString = [[NSUserDefaults standardUserDefaults] objectForKey:SUFeedURLKey];
if (!appcastString)
appcastString = SUInfoValueForKey(SUFeedURLKey);
if (!appcastString) { [NSException raise:@"SUNoFeedURL" format:@"No feed URL is specified in the Info.plist or the user defaults!"]; }
if (![appcastString length]) {
// Allow the application to provide an empty appcast string to
// indicate that update checking should be disabled.
return;
}
if (updateInProgress)
{
if (verbosity)
@ -166,12 +177,6 @@
verbose = verbosity;
updateInProgress = YES;
// A value in the user defaults overrides one in the Info.plist (so preferences panels can be created wherein users choose between beta / release feeds).
NSString *appcastString = [[NSUserDefaults standardUserDefaults] objectForKey:SUFeedURLKey];
if (!appcastString)
appcastString = SUInfoValueForKey(SUFeedURLKey);
if (!appcastString) { [NSException raise:@"SUNoFeedURL" format:@"No feed URL is specified in the Info.plist or the user defaults!"]; }
SUAppcast *appcast = [[SUAppcast alloc] init];
[appcast setDelegate:self];
[appcast fetchAppcastFromURL:[NSURL URLWithString:appcastString]];

Просмотреть файл

@ -113,6 +113,7 @@ typedef enum EBookmarkOpenBehavior
// Application menu actions
- (IBAction)aboutWindow:(id)sender;
- (IBAction)feedbackLink:(id)aSender;
- (IBAction)checkForUpdates:(id)sender;
- (IBAction)displayPreferencesWindow:(id)sender;
- (IBAction)resetBrowser:(id)sender;
- (IBAction)emptyCache:(id)sender;

Просмотреть файл

@ -955,6 +955,14 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
[self loadApplicationPage:pageToLoad];
}
- (IBAction)checkForUpdates:(id)sender
{
// MainController is the target of the "Check for Updates..." menu item
// instead of SUUpdater solely to allow MainController to participate in
// NSMenuValidation for the menu item.
return [mAutoUpdater checkForUpdates:sender];
}
- (IBAction)displayPreferencesWindow:(id)sender
{
[[MVPreferencesController sharedInstance] showPreferences:nil];
@ -1707,6 +1715,13 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
return (browserController && [browserController validateActionBySelector:action]);
}
if (action == @selector(checkForUpdates:) &&
[[[NSUserDefaults standardUserDefaults] stringForKey:SUFeedURLKey] length] == 0) {
// Disable update checking if there's no feed to check.
[aMenuItem setToolTip:NSLocalizedString(@"AutoUpdateDisabledToolTip", @"")];
return NO;
}
// default return
return YES;
}

Просмотреть файл

@ -668,10 +668,14 @@ static BOOL gMadePrefManager;
withSuccess:NULL];
if (![baseURL length])
baseURL = [self getStringPref:"app.update.url" withSuccess:NULL];
// An empty manifestURL will tell Sparkle not to check for updates.
NSString* manifestURL = @"";
if ([baseURL length]) {
// Append the parameters we might be interested in.
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",
manifestURL = [NSString stringWithFormat:@"%@?os=%@&arch=%@&version=%@&intl=%d",
baseURL,
[NSWorkspace osVersionString],
#if defined(__ppc__)
@ -683,6 +687,7 @@ static BOOL gMadePrefManager;
#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