Bug 278860 - Show the right error message when the profile is missing; r=bsmedberg a=mfinkle

This commit is contained in:
Michael Kaply 2012-04-19 15:40:49 -04:00
parent 04baa95806
commit 2b30980af0
2 changed files with 20 additions and 0 deletions

View File

@ -121,6 +121,14 @@ function acceptDialog()
profileLock = selectedProfile.profile.lock({ value: null });
}
catch (e) {
if (!selectedProfile.profile.localDir.exists()) {
var missingTitle = gProfileManagerBundle.getString("profileMissingTitle");
var missing =
gProfileManagerBundle.getFormattedString("profileMissing", [appName]);
gPromptService.alert(window, missingTitle, missing);
return false;
}
var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle");
var locked =
gProfileManagerBundle.getFormattedString("profileLocked2", [appName, selectedProfile.profile.name, appName]);

View File

@ -2197,6 +2197,12 @@ SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc, n
rv = profile->GetLocalDir(getter_AddRefs(profileLocalDir));
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
profileLocalDir->Exists(&exists);
if (!exists) {
return ProfileMissingDialog(aNative);
}
return ProfileLockedDialog(profileDir, profileLocalDir, unlocker,
aNative, aResult);
}
@ -2271,6 +2277,12 @@ SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc, n
rv = profile->GetRootDir(getter_AddRefs(profileLocalDir));
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
profileLocalDir->Exists(&exists);
if (!exists) {
return ProfileMissingDialog(aNative);
}
return ProfileLockedDialog(profileDir, profileLocalDir, unlocker,
aNative, aResult);
}