Two storages with the same name can no longer be created in the styles manager.

Originally committed to SVN as r1023.
This commit is contained in:
Rodrigo Braz Monteiro 2007-04-08 00:10:42 +00:00
parent 9e4701cc61
commit 1c027dd44a
2 changed files with 14 additions and 2 deletions

View file

@ -105,6 +105,8 @@ Please visit http://aegisub.net to download latest version
- Added shortcut keys (escape to close and delete to delete a style, plus ctrl+c/v for copy/paste) to style manager. (Dansolo)
- Added a dummy video provider to create a blank video with customizeable options. (jfs & AMZ)
- Changing script resolution when asked to on video loading will now set an undo point. (AMZ)
- Frame number is now the default box on the "go to" dialog. (AMZ)
- Two storages with the same name can no longer be created in the styles manager. (AMZ)
= 1.10 beta - 2006.08.07 ===========================

View file

@ -391,16 +391,26 @@ void DialogStyleManager::OnCatalogNew (wxCommandEvent &event) {
}
}
}
if (badchars_removed > 0) {
wxLogWarning(_("The specified catalog name contains one or more illegal characters. They have been replaced with underscores instead.\nThe catalog has been renamed to \"%s\"."), name.c_str());
// Make sure that there is no storage with the same name
if (CatalogList->FindString(name) != wxNOT_FOUND) {
wxMessageBox(_("A catalog with that name already exists."),_("Catalog name conflict"),wxICON_ERROR);
return;
}
// Warn about bad characters
if (badchars_removed > 0) {
wxMessageBox(wxString::Format(_("The specified catalog name contains one or more illegal characters. They have been replaced with underscores instead.\nThe catalog has been renamed to \"%s\"."), name.c_str()),_("Invalid characters"));
}
// Add to list of storages
Store.Clear();
StorageList->Clear();
CatalogList->Append(name);
CatalogList->SetStringSelection(name);
StorageActions(true);
// Save
wxString dirname = AegisubApp::folderName;
dirname += _T("/catalog/");
if (!wxDirExists(dirname)) {