Bug 141090 - New profiles do not display current theme w/ check flag

patch by jerry.tan@sun.com r=me sr=bryner
This commit is contained in:
bsmedberg%covad.net 2004-04-24 17:05:23 +00:00
Родитель fe8d2b30ea
Коммит 02373a0bb0
4 изменённых файлов: 23 добавлений и 2 удалений

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

@ -1731,6 +1731,12 @@ NS_IMETHODIMP nsChromeRegistry::SelectLocaleForProfile(const nsACString& aLocale
return SetProvider(NS_LITERAL_CSTRING("locale"), mSelectedLocale, aLocale, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
NS_IMETHODIMP nsChromeRegistry::SelectSkinForProfile(const nsACString& aSkin,
const PRUnichar *aProfilePath)
{
return SetProvider(NS_LITERAL_CSTRING("skin"), mSelectedSkin, aSkin, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
/* void setRuntimeProvider (in boolean runtimeProvider); */
// should we inline this one?
NS_IMETHODIMP nsChromeRegistry::SetRuntimeProvider(PRBool runtimeProvider)

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

@ -85,7 +85,7 @@ interface nsIChromeRegistry : nsISupports
void checkForNewChrome();
};
[scriptable, uuid(a9f92623-5982-4afe-9d90-619cf5b0c39f)]
[scriptable, uuid(fd1ee2f8-0238-40b0-9b54-27cf810d9c86)]
interface nsIXULChromeRegistry : nsIChromeRegistry {
/* Applies a skin or locale to all possible packages */
@ -96,8 +96,9 @@ interface nsIXULChromeRegistry : nsIChromeRegistry {
PRInt32 isSkinSelected(in ACString skinName, in boolean useProfile);
PRInt32 isLocaleSelected(in ACString localeName, in boolean useProfile);
// Special additional APIs for locales only.
//Special additional APIs for locales and skin.
void selectLocaleForProfile(in ACString localeName, in wstring profilePath);
void selectSkinForProfile(in ACString skinName, in wstring profilePath);
/* Should be called when locales change to reload all chrome (including XUL). */
void reloadChrome();

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

@ -1731,6 +1731,14 @@ nsProfile::CreateNewProfileWithLocales(const PRUnichar* profileName,
}
}
//need to set skin info here
nsCAutoString currentSkinName;
rv = packageRegistry->GetSelectedSkin(NS_LITERAL_CSTRING("global"),currentSkinName);
if (!currentSkinName.IsEmpty()) {
rv = chromeRegistry->SelectSkinForProfile(currentSkinName,
NS_ConvertUTF8toUCS2(fileStr).get());
}
if (!contentLocale.IsEmpty()) {
// caller prefers locale subdir
nsCOMPtr<nsIFile> locProfDefaultsDir;

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

@ -1731,6 +1731,12 @@ NS_IMETHODIMP nsChromeRegistry::SelectLocaleForProfile(const nsACString& aLocale
return SetProvider(NS_LITERAL_CSTRING("locale"), mSelectedLocale, aLocale, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
NS_IMETHODIMP nsChromeRegistry::SelectSkinForProfile(const nsACString& aSkin,
const PRUnichar *aProfilePath)
{
return SetProvider(NS_LITERAL_CSTRING("skin"), mSelectedSkin, aSkin, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
/* void setRuntimeProvider (in boolean runtimeProvider); */
// should we inline this one?
NS_IMETHODIMP nsChromeRegistry::SetRuntimeProvider(PRBool runtimeProvider)