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

This commit is contained in:
ccarlen%netscape.com 2003-05-09 13:06:29 +00:00
Родитель 3eca35ed3d
Коммит c41aebe6c6
4 изменённых файлов: 18 добавлений и 5 удалений

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

@ -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", "");

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

@ -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;

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

@ -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

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

@ -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>