fix for b28186, rename to existing profile does not re-prompt for correct profile name

This commit is contained in:
ben%netscape.com 2000-07-12 07:20:06 +00:00
Родитель 4ee95726ba
Коммит 6fe6fc6ad0
1 изменённых файлов: 31 добавлений и 29 удалений

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

@ -68,11 +68,11 @@ function RenameProfile()
var result = { }; var result = { };
var dialogTitle = bundle.GetStringFromName("renameprofiletitle"); var dialogTitle = bundle.GetStringFromName("renameprofiletitle");
var msg = bundle.GetStringFromName("renameprofilepromptA") + oldName + bundle.GetStringFromName("renameprofilepromptB"); var msg = bundle.GetStringFromName("renameprofilepromptA") + oldName + bundle.GetStringFromName("renameprofilepromptB");
if (commonDialogService.Prompt(window, dialogTitle, msg, oldName, result)) { while (1) {
var rv = commonDialogService.Prompt(window, dialogTitle, msg, oldName, result);
if (rv) {
var newName = result.value; var newName = result.value;
dump("*** newName = |" + newName + "|\n"); if (!newName) return false;
if (!newName)
return false;
var invalidChars = ["/", "\\", "*", ":"]; var invalidChars = ["/", "\\", "*", ":"];
for( var i = 0; i < invalidChars.length; i++ ) for( var i = 0; i < invalidChars.length; i++ )
{ {
@ -87,7 +87,6 @@ function RenameProfile()
} }
var migrate = selected.firstChild.firstChild.getAttribute("rowMigrate"); var migrate = selected.firstChild.firstChild.getAttribute("rowMigrate");
dump("*** oldName = "+ oldName+ ", newName = "+ newName+ ", migrate = "+ migrate+ "\n");
try { try {
profile.renameProfile(oldName, newName); profile.renameProfile(oldName, newName);
selected.firstChild.firstChild.setAttribute( "value", newName ); selected.firstChild.firstChild.setAttribute( "value", newName );
@ -98,8 +97,11 @@ function RenameProfile()
var lString = bundle.GetStringFromName("profileExists"); var lString = bundle.GetStringFromName("profileExists");
var profileExistsTitle = bundle.GetStringFromName("profileExistsTitle"); var profileExistsTitle = bundle.GetStringFromName("profileExistsTitle");
commonDialogService.Alert(window, profileExistsTitle, lString); commonDialogService.Alert(window, profileExistsTitle, lString);
continue;
} }
} }
break;
}
} }
// set the button state // set the button state
DoEnabling(); DoEnabling();