Bug 135597 Profile migrator should use prompt service instead of no_space.xul r=ccarlen sr=rbs

This commit is contained in:
neil%parkwaycc.co.uk 2003-11-18 09:16:08 +00:00
Родитель 2470804c7e
Коммит 6e75191930
7 изменённых файлов: 27 добавлений и 48 удалений

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

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

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

@ -1,9 +0,0 @@
comm.jar:
content/communicator/profile/no_space.js (content/no_space.js)
content/communicator/profile/no_space.xul (content/no_space.xul)
content/communicator/profile/profileMigrationProgress.js (content/profileMigrationProgress.js)
content/communicator/profile/profileMigrationProgress.xul (content/profileMigrationProgress.xul)
en-US.jar:
locale/en-US/communicator/profile/no_space.dtd (locale/en-US/no_space.dtd)
locale/en-US/communicator/profile/profileMigrationProgress.dtd (locale/en-US/profileMigrationProgress.dtd)

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

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

@ -41,7 +41,7 @@
#include "pratom.h"
#include "nsIComponentManager.h"
#include "nsIComponentManager.h"
#include "nsIDialogParamBlock.h"
#include "nsIPromptService.h"
#include "nsIServiceManager.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptContext.h"
@ -212,7 +212,6 @@
#define PREF_FILE_NAME_IN_5x "prefs.js"
#define PREF_MIGRATION_PROGRESS_URL "chrome://communicator/content/profile/profileMigrationProgress.xul"
#define PREF_MIGRATION_NO_SPACE_URL "chrome://communicator/content/profile/no_space.xul"
typedef struct
{
@ -425,7 +424,7 @@ extern "C" void ProfileMigrationController(void *data)
migrator->mErrorCode = rv;
return;
}
choice++;// Increment choice to match the RETRY=1, CREATE_NEW=2 and CANCEL=3 format
choice++;// Increment choice to match the RETRY=1, CANCEL=2 and CREATE_NEW=3 format
}
}
@ -466,29 +465,33 @@ NS_IMETHODIMP
nsPrefMigration::ShowSpaceDialog(PRInt32 *choice)
{
nsresult rv;
nsCOMPtr<nsIWindowWatcher> windowWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(kStringBundleServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv));
if (NS_FAILED(rv)) return rv;
ioParamBlock->SetInt(0,3); //set the Retry, CreateNew and Cancel buttons
// WindowWatcher can work with or without parent window
nsCOMPtr<nsIDOMWindow> newWindow;
rv = windowWatcher->OpenWindow(mPMProgressWindow,
PREF_MIGRATION_NO_SPACE_URL,
"_blank",
"dialog,chrome,centerscreen,modal,titlebar",
ioParamBlock,
getter_AddRefs(newWindow));
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle(MIGRATION_PROPERTIES_URL, getter_AddRefs(bundle));
if (NS_FAILED(rv)) return rv;
// Now get which button was pressed from the ParamBlock
if (NS_SUCCEEDED(rv))
ioParamBlock->GetInt( 0, choice );
return NS_OK;
nsXPIDLString noSpaceTitle, noSpaceText, retryLabel, createNewLabel;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("noSpace.title").get(), getter_Copies(noSpaceTitle));
if (NS_FAILED(rv)) return rv;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("noSpace.text").get(), getter_Copies(noSpaceText));
if (NS_FAILED(rv)) return rv;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("retry.label").get(), getter_Copies(retryLabel));
if (NS_FAILED(rv)) return rv;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("createNew.label").get(), getter_Copies(createNewLabel));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIPromptService> promptService = do_GetService("@mozilla.org/embedcomp/prompt-service;1", &rv);
if (NS_FAILED(rv)) return rv;
const PRUint32 buttons =
(nsIPromptService::BUTTON_TITLE_IS_STRING * nsIPromptService::BUTTON_POS_0)+
(nsIPromptService::BUTTON_TITLE_CANCEL * nsIPromptService::BUTTON_POS_1)+
(nsIPromptService::BUTTON_TITLE_IS_STRING * nsIPromptService::BUTTON_POS_2);
return promptService->ConfirmEx(mPMProgressWindow, noSpaceTitle, noSpaceText,
buttons, retryLabel, nsnull, createNewLabel,
nsnull, nsnull, choice);
}

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

@ -55,8 +55,8 @@
#define MIGRATION_SUCCESS 0
#define MIGRATION_RETRY 1
#define MIGRATION_CREATE_NEW 2
#define MIGRATION_CANCEL 3
#define MIGRATION_CANCEL 2
#define MIGRATION_CREATE_NEW 3
#define MAX_DRIVES 4

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

@ -1,15 +0,0 @@
# LOCALIZATION NOTE: Do not translate Unicode characters such as \u00a9
dialogTitle=Confirm Migration
confirmMigration=You are about to create a %S profile based on your Netscape 4 profile.\u000a\u000aThis will copy and convert some of your Netscape 4 files to work with %S. Your Netscape 4 profile data will not be modified.
migrate=Convert Profile
manage=Manage Profiles...
# mailDirName needs to be set to the same value as in 4.x
# see bug #55449
mailDirName=Mail
# newsDirName needs to be set to the same value as in 4.x
# see bug #55449
newsDirName=News
# see nsAppShellService::CheckAndRemigrateDefunctProfile()
# for where the confirmRemigration entries are used
# LOCALIZATION NOTE: Do not translate Unicode characters such as \u00a9
confirmRemigration=A more recent Netscape 4.5+ version of this profile (which contains your bookmarks, email settings, address books and preferences) was found.\u000aWould you like to use the more recent profile?