203077 - Rename Firefox profile data folder from Phoenix to Firefox. This includes some changes to better support the Phoenix Profile Migrator.

Also, make migration wizard show for 5 seconds (with a Finish button to dismiss) when automigrating, so the user can see what's happening.
for full details see http://bugzilla.mozilla.org/show_bug.cgi?id=203077#c35
r=jst
This commit is contained in:
ben%bengoodger.com 2004-03-11 01:26:41 +00:00
Родитель ae52c1ef20
Коммит 8bae74ab52
17 изменённых файлов: 67 добавлений и 106 удалений

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

@ -45,7 +45,7 @@ int main(int argc, char* argv[])
{
nsXREAppData appData;
appData.SetSplashEnabled(PR_FALSE);
appData.SetProductName(NS_LITERAL_CSTRING("Phoenix"));
appData.SetProductName(NS_LITERAL_CSTRING("Firefox"));
appData.SetUseStartupPrefs(PR_FALSE);
return xre_main(argc, argv, appData);

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

@ -3,7 +3,7 @@ const kProfileMigratorContractIDPrefix = "@mozilla.org/profile/migrator;1?app=br
var MigrationWizard = {
_source: "", // Source Profile Migrator ContractID suffix
_itemsFlags: kIMig.ALL, // Selected Import Data Sources (32-bit bitfield)
_itemsFlags: kIMig.ALL, // Selected Import Data Sources (16-bit bitfield)
_selectedProfile: null, // Selected Profile name to import from
_wiz: null,
_migrator: null,
@ -143,7 +143,7 @@ var MigrationWizard = {
var bundle = document.getElementById("bundle");
var items = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
for (var i = 0; i < 32; ++i) {
for (var i = 0; i < 16; ++i) {
var itemID = (items >> i) & 0x1 ? Math.pow(2, i) : 0;
if (itemID > 0) {
var checkbox = document.createElement("checkbox");
@ -185,6 +185,10 @@ var MigrationWizard = {
this._wiz.getButton("cancel").disabled = true;
this._wiz.getButton("back").disabled = true;
this._wiz.getButton("next").disabled = true;
// When automigrating, show all of the data that can be received from this source.
if (this._autoMigrate)
this._itemsFlags = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
this._listItems("migratingItems");
setTimeout(this.onMigratingMigrate, 0, this);
@ -203,13 +207,20 @@ var MigrationWizard = {
var bundle = document.getElementById("bundle");
var itemID;
for (var i = 0; i < 32; ++i) {
for (var i = 0; i < 16; ++i) {
var itemID = (this._itemsFlags >> i) & 0x1 ? Math.pow(2, i) : 0;
if (itemID > 0) {
var label = document.createElement("label");
label.id = itemID + "_migrated";
label.setAttribute("value", bundle.getString(itemID + "_" + this._source));
items.appendChild(label);
try {
label.setAttribute("value", bundle.getString(itemID + "_" + this._source));
items.appendChild(label);
}
catch (e) {
// if the block above throws, we've enumerated all the import data types we
// currently support and are now just wasting time, break.
break;
}
}
}
},
@ -236,7 +247,8 @@ var MigrationWizard = {
dump("*** done\n");
if (this._autoMigrate) {
// We're done now.
window.close();
this._wiz.advance();
setTimeout("close()", 5000);
}
else {
var nextButton = this._wiz.getButton("next");

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

@ -71,6 +71,7 @@
<radio id="dogbert" label="&importFromNetscape4.label;" accesskey="&importFromNetscape4.accesskey;"/>
<radio id="opera" label="&importFromOpera.label;" accesskey="&importFromOpera.accesskey;"/>
#else
<radio id="phoenix" label="&importFromPhoenix.label;" accesskey="&importFromPhoenix.accesskey;"/>
<radio id="seamonkey" label="&importFromSeamonkey.label;" accesskey="&importFromSeamonkey.accesskey;"/>
<radio id="dogbert" label="&importFromNetscape4.label;" accesskey="&importFromNetscape4.accesskey;"/>
<radio id="opera" label="&importFromOpera.label;" accesskey="&importFromOpera.accesskey;"/>

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

@ -5,6 +5,8 @@
<!ENTITY importFromIE.label "Microsoft Internet Explorer">
<!ENTITY importFromIE.accesskey "M">
<!ENTITY importFromPhoenix.label "Phoenix 0.1-0.5, Firebird 0.6-0.7 or Firefox 0.8">
<!ENTITY importFromPhoenix.accesskey "P">
<!ENTITY importFromSeamonkey.label "Netscape 6, 7 or Mozilla 1.x">
<!ENTITY importFromSeamonkey.accesskey "N">
<!ENTITY importFromNetscape4.label "Netscape 4.x">

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

@ -1,64 +0,0 @@
profileName_format=%S %S
# Browser Specific
sourceNameIE=Internet Explorer
sourceNameSeamonkey=Netscape 6/7/Mozilla
sourceNameDogbert=Netscape 4
sourceNameOpera=Opera
sourceNameSafari=Safari
sourceNameOmniWeb=OmniWeb
sourceNameCamino=Camino
sourceNameICab=iCab
sourceNameKonqueror=Konqueror
sourceNameEpiphany=Epiphany
sourceNameGaleon=Galeon
importedBookmarksFolder=From %S
importedSearchURLsFolder=Keyword Searches (From %S)
importedSearchURLsTitle=Search on %S
importedSearchUrlDesc=Type "%S <search query>" in the Location Bar to perform a search on %S.
importedDogbertBookmarksTitle=From Netscape 4
importedSeamonkeyBookmarksTitle=From Netscape 6/7/Mozilla
importedSafariBookmarks=From Safari
importedOperaHotlistTitle=From Opera
importedOperaSearchUrls=Keyword Searches (From Opera)
# Import Sources
1_ie=Internet Options
1_opera=Preferences
1_dogbert=Preferences
1_seamonkey=Preferences
2_ie=Cookies
2_opera=Cookies
2_dogbert=Cookies
2_seamonkey=Cookies
4_ie=Browsing History
4_opera=Browsing History
4_dogbert=Browsing History
4_seamonkey=Browsing History
8_ie=Saved Form History
8_opera=Saved Form History
8_dogbert=Saved Form History
8_seamonkey=Saved Form History
16_ie=Saved Passwords
16_opera=Saved Passwords
16_dogbert=Saved Passwords
16_seamonkey=Saved Passwords
32_ie=Favorites
32_opera=Bookmarks
32_dogbert=Bookmarks
32_seamonkey=Bookmarks
64_ie=Other Data
64_opera=Other Data
64_dogbert=Other Data
64_seamonkey=Other Data

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

@ -44,14 +44,14 @@ interface nsIBrowserProfileMigrator : nsISupports
/**
* profile items to migrate. use with migrate().
*/
const unsigned long ALL = 0x0000;
const unsigned long SETTINGS = 0x0001;
const unsigned long COOKIES = 0x0002;
const unsigned long HISTORY = 0x0004;
const unsigned long FORMDATA = 0x0008;
const unsigned long PASSWORDS = 0x0010;
const unsigned long BOOKMARKS = 0x0020;
const unsigned long OTHERDATA = 0x0040;
const unsigned short ALL = 0x0000;
const unsigned short SETTINGS = 0x0001;
const unsigned short COOKIES = 0x0002;
const unsigned short HISTORY = 0x0004;
const unsigned short FORMDATA = 0x0008;
const unsigned short PASSWORDS = 0x0010;
const unsigned short BOOKMARKS = 0x0020;
const unsigned short OTHERDATA = 0x0040;
/**
* Copy user profile information to the current active profile.
@ -59,7 +59,7 @@ interface nsIBrowserProfileMigrator : nsISupports
* @param aReplace replace or append current data where applicable.
* @param aProfile profile to migrate from, if there is more than one.
*/
void migrate(in unsigned long aItems, in boolean aReplace, in wstring aProfile);
void migrate(in unsigned short aItems, in boolean aReplace, in wstring aProfile);
/**
* A bit field containing profile items that this migrator
@ -70,7 +70,7 @@ interface nsIBrowserProfileMigrator : nsISupports
* data mode (automigration, before profile has started)
* @returns bit field containing profile items (see above)
*/
unsigned long getMigrateData(in wstring aProfile, in boolean aReplace);
unsigned short getMigrateData(in wstring aProfile, in boolean aReplace);
/**
* Whether or not there is any data that can be imported from this

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

@ -62,7 +62,7 @@ nsCaminoProfileMigrator::~nsCaminoProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsCaminoProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsCaminoProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -76,7 +76,7 @@ nsCaminoProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnich
NS_IMETHODIMP
nsCaminoProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
*aResult = 0; // XXXben implement me
return NS_OK;

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

@ -106,7 +106,7 @@ nsDogbertProfileMigrator::~nsDogbertProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsDogbertProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsDogbertProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -139,7 +139,7 @@ nsDogbertProfileMigrator::GetSourceProfile(const PRUnichar* aProfile)
NS_IMETHODIMP
nsDogbertProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
if (!mSourceProfile)
GetSourceProfile(aProfile);

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

@ -62,7 +62,7 @@ nsICabProfileMigrator::~nsICabProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsICabProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsICabProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -76,7 +76,7 @@ nsICabProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar
NS_IMETHODIMP
nsICabProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
*aResult = 0; // XXXben implement me
return NS_OK;

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

@ -427,7 +427,7 @@ user_pref("font.size.variable.x-western", 15);
///////////////////////////////////////////////////////////////////////////////
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsIEProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsIEProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -448,7 +448,7 @@ nsIEProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar*
NS_IMETHODIMP
nsIEProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
// There's no harm in assuming everything is available.
*aResult = nsIBrowserProfileMigrator::SETTINGS | nsIBrowserProfileMigrator::COOKIES |

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

@ -62,7 +62,7 @@ nsMacIEProfileMigrator::~nsMacIEProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsMacIEProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsMacIEProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -76,7 +76,7 @@ nsMacIEProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnicha
NS_IMETHODIMP
nsMacIEProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
*aResult = 0; // XXXben implement me
return NS_OK;

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

@ -62,7 +62,7 @@ nsOmniWebProfileMigrator::~nsOmniWebProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsOmniWebProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsOmniWebProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -76,7 +76,7 @@ nsOmniWebProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnic
NS_IMETHODIMP
nsOmniWebProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
*aResult = 0; // XXXben implement me
return NS_OK;

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

@ -104,7 +104,7 @@ nsOperaProfileMigrator::~nsOperaProfileMigrator()
}
NS_IMETHODIMP
nsOperaProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsOperaProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -126,7 +126,7 @@ nsOperaProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnicha
NS_IMETHODIMP
nsOperaProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
if (!mOperaProfile)
GetOperaProfile(aProfile, getter_AddRefs(mOperaProfile));

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

@ -83,7 +83,7 @@ nsPhoenixProfileMigrator::~nsPhoenixProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsPhoenixProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsPhoenixProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -125,7 +125,7 @@ nsPhoenixProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnic
NS_IMETHODIMP
nsPhoenixProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
if (!mSourceProfile)
GetSourceProfile(aProfile);

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

@ -69,13 +69,23 @@ nsProfileMigrator::Migrate()
nsresult rv = NS_OK;
if (mMigrator && mSourceKey) {
if (!needsActiveProfile)
rv = OpenMigrationWizard();
else {
nsCOMPtr<nsIObserverService> obs(do_GetService("@mozilla.org/observer-service;1"));
rv = obs->AddObserver(this, "browser-window-before-show", PR_FALSE);
PRBool sourceExists;
mMigrator->GetSourceExists(&sourceExists);
if (sourceExists) {
if (!needsActiveProfile)
rv = OpenMigrationWizard();
else {
nsCOMPtr<nsIObserverService> obs(do_GetService("@mozilla.org/observer-service;1"));
rv = obs->AddObserver(this, "browser-window-before-show", PR_FALSE);
}
}
else
rv = NS_ERROR_FILE_NOT_FOUND; // No data was found to import.
}
else
rv = NS_ERROR_FILE_NOT_FOUND; // No migrator could be found.
return rv;
}

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

@ -77,7 +77,7 @@ nsSafariProfileMigrator::~nsSafariProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsSafariProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsSafariProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -96,7 +96,7 @@ nsSafariProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnich
NS_IMETHODIMP
nsSafariProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
*aResult = 0; // XXXben implement me
return NS_OK;

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

@ -84,7 +84,7 @@ nsSeamonkeyProfileMigrator::~nsSeamonkeyProfileMigrator()
// nsIBrowserProfileMigrator
NS_IMETHODIMP
nsSeamonkeyProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnichar* aProfile)
nsSeamonkeyProfileMigrator::Migrate(PRUint16 aItems, PRBool aReplace, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
@ -120,7 +120,7 @@ nsSeamonkeyProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUn
NS_IMETHODIMP
nsSeamonkeyProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
PRBool aReplace,
PRUint32* aResult)
PRUint16* aResult)
{
if (!mSourceProfile)
GetSourceProfile(aProfile);