mirror of https://github.com/odrling/Aegisub
Style name collisions (when moving from storage, creating or renaming) will now prompt the user before performing the action.
Originally committed to SVN as r568.
This commit is contained in:
parent
73fdf2a9d3
commit
25120f8461
|
@ -30,6 +30,7 @@ Please visit http://aegisub.net to download latest version
|
|||
- Plain-text lines can now be pasted into the grid. They will be inserted as default lines with the text as their content. (AMZ)
|
||||
- Added Paste Over function, which allows you to paste subtitle lines over others, overwriting the fields of your choice. (AMZ)
|
||||
- Renaming a style will now ask you if you want to rename all instances of it on the script. (AMZ)
|
||||
- Style name collisions (when moving from storage, creating or renaming) will now prompt the user before performing the action. (AMZ)
|
||||
|
||||
|
||||
= 1.10 beta - 2006.08.07 ===========================
|
||||
|
|
|
@ -379,6 +379,19 @@ void DialogStyleEditor::Apply (bool apply,bool close) {
|
|||
if (apply) {
|
||||
// Style name
|
||||
wxString newStyleName = StyleName->GetValue();
|
||||
|
||||
// Check if style name is unique
|
||||
wxArrayString styles = grid->ass->GetStyles();
|
||||
for (unsigned int i=0;i<styles.Count();i++) {
|
||||
if (styles[i] == newStyleName) {
|
||||
if (grid->ass->GetStyle(styles[i]) != style) {
|
||||
int answer = wxMessageBox(_T("There is already a style with this name. Proceed anyway?"),_T("Style name conflict."),wxYES_NO);
|
||||
if (answer == wxNO) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Style name change
|
||||
if (work->name != newStyleName) {
|
||||
// See if user wants to update style name through script
|
||||
int answer = wxMessageBox(_T("Do you want to change all instances of this style in the script to this new name?"),_T("Update script?"),wxYES_NO | wxCANCEL);
|
||||
|
|
|
@ -489,15 +489,23 @@ void DialogStyleManager::OnCopyToCurrent (wxCommandEvent &event) {
|
|||
int n = StorageList->GetSelections(selections);
|
||||
AssStyle *temp;
|
||||
for (int i=0;i<n;i++) {
|
||||
// Check if there is already a style with that name
|
||||
int test = CurrentList->FindString(StorageList->GetString(selections[i]));
|
||||
if (test == wxNOT_FOUND) {
|
||||
bool proceed = test==-1;
|
||||
if (!proceed) {
|
||||
int answer = wxMessageBox(_T("There is already a style with that name on the current script. Proceed anyway?"),_T("Style name collision."),wxYES_NO);
|
||||
if (answer == wxYES) proceed = true;
|
||||
}
|
||||
|
||||
// Copy
|
||||
if (proceed) {
|
||||
temp = new AssStyle;
|
||||
*temp = *styleStorageMap.at(selections[i]);
|
||||
AssFile::top->InsertStyle(temp);
|
||||
}
|
||||
else {
|
||||
// Bug user?
|
||||
}
|
||||
|
||||
// Return
|
||||
else return;
|
||||
}
|
||||
LoadCurrentStyles(AssFile::top);
|
||||
grid->ass->FlagAsModified();
|
||||
|
|
Loading…
Reference in New Issue