Make it possible for other XUL apps to hide profile switching UI. b=204908, r=/sr=/a=sspitzer

git-svn-id: svn://10.0.0.236/trunk@142264 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ccarlen%netscape.com
2003-05-09 13:06:29 +00:00
parent 83dadb0ac1
commit 95d3fb2a05
4 changed files with 18 additions and 5 deletions

View File

@@ -760,6 +760,8 @@ pref("profile.confirm_automigration",true);
// if -1, we never think your profile is defunct
// and users will never see the remigrate UI.
pref("profile.seconds_until_defunct", -1);
// We can show it anytime from menus
pref("profile.manage_only_at_launch", false);
// Customizable toolbar stuff
pref("custtoolbar.personal_toolbar_folder", "");

View File

@@ -92,7 +92,12 @@ function StartUp()
}
var autoSelectLastProfile = document.getElementById("autoSelectLastProfile");
autoSelectLastProfile.checked = profile.startWithLastUsedProfile;
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
if (prefs.getBoolPref("profile.manage_only_at_launch"))
autoSelectLastProfile.hidden = true;
else
autoSelectLastProfile.checked = profile.startWithLastUsedProfile;
var profileList = document.getElementById("profiles");
profileList.focus();
@@ -219,9 +224,10 @@ function onStart()
if (offlineState.checked != ioService.offline)
ioService.offline = offlineState.checked;
}
var autoSelectLastProfile = document.getElementById("autoSelectLastProfile");
profile.startWithLastUsedProfile = autoSelectLastProfile.checked;
if (!autoSelectLastProfile.hidden)
profile.startWithLastUsedProfile = autoSelectLastProfile.checked;
try {
profile.currentProfile = profilename;

View File

@@ -468,7 +468,12 @@ nsProfile::LoadDefaultProfileDir(nsCString & profileURLStr, PRBool canInteract)
// multiple profiles.
PRBool startWithLastUsedProfile = PR_FALSE;
GetStartWithLastUsedProfile(&startWithLastUsedProfile);
// But first, make sure this app supports this.
PRBool cantAutoSelect;
rv = prefBranch->GetBoolPref("profile.manage_only_at_launch", &cantAutoSelect);
if (NS_SUCCEEDED(rv) && !cantAutoSelect)
GetStartWithLastUsedProfile(&startWithLastUsedProfile);
// This means that there was no command-line argument to force
// profile UI to come up. But we need the UI anyway if there

View File

@@ -33,7 +33,7 @@
<menuitem id="java" label="&javaConsoleCmd.label;" accesskey="&javaConsoleCmd.accesskey;" oncommand="toJavaConsole()"/>
</menupopup>
</menu>
<menuseparator/>
<menuseparator id="sep_switchprofile"/>
<menuitem id="cmd_switchprofile" label="&switchProfileCmd.label;" accesskey="&switchProfileCmd.accesskey;" oncommand="toProfileManager();"/>
</menupopup>
</menu>