зеркало из https://github.com/mozilla/pjs.git
fix for b28186, rename to existing profile does not re-prompt for correct profile name
This commit is contained in:
Родитель
4ee95726ba
Коммит
6fe6fc6ad0
|
@ -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();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче