From 10fa94f768adfc2f62be97bc2a3088e7064071ea Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Sun, 13 Jan 2008 06:42:34 +0000 Subject: [PATCH] "Copy to storage" in the styles manager now prompts the user if he wants to overwrite if the style already exists in the storage (previously it would do nothing, goggles etc.). Fixes #573. Originally committed to SVN as r1697. --- aegisub/changelog.txt | 4 ++-- aegisub/dialog_style_manager.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/aegisub/changelog.txt b/aegisub/changelog.txt index 66802feb4..0f15cb5d2 100644 --- a/aegisub/changelog.txt +++ b/aegisub/changelog.txt @@ -70,7 +70,7 @@ Please visit http://aegisub.net to download latest version o Style storages with invalid characters are now caught, and the invalid characters replaced with safe ones. Previously such storages seemed to be created correctly but were never stored to disk. (jfs) o Added long-missing Edit buttons. (jfs) o Renaming a style will now ask you if you want to rename all instances of it on the script. (AMZ) - o Style name collisions (when moving from storage, creating or renaming) will now prompt the user before performing the action. (AMZ) + o Style name collisions (when moving from/to storage, creating or renaming) will now prompt the user before performing the action. (AMZ) o Added an "Import from script..." button to import styles directly from other subtitle files. (AMZ) o Added buttons to move styles up, down, to top or to bottom, on both storage and current script. (AMZ) o Added sorting functionality for both storage and current script. (AMZ) @@ -123,7 +123,7 @@ Please visit http://aegisub.net to download latest version o Tweaked the behavior of the margin boxes, now they no longer show padding zeros. (AMZ) o Actor and Effect fields now show a "ghosted" caption saying their name when they are not focused on and blank. (AMZ) o Added a "Commit" button that duplicates the Enter/Ctrl+Enter functionality, since those shortcuts were not obvious to everyone. (AMZ) - o The "Split at cursor" functions now trims off leading/trailing whitespace around the split point. (TheFluff) + o Improved the "split at cursor" functions so that they now split what you see (instead of splitting the committed line) and trim off leading/trailing whitespace. (TheFluff) - Changes to Fonts Collector: o Changed the font searching engine to something slower, but far more reliable. (jfs/AMZ) o Added option to just verify if you have the fonts. (AMZ) diff --git a/aegisub/dialog_style_manager.cpp b/aegisub/dialog_style_manager.cpp index 34adc849a..66d12ede6 100644 --- a/aegisub/dialog_style_manager.cpp +++ b/aegisub/dialog_style_manager.cpp @@ -562,7 +562,17 @@ void DialogStyleManager::OnCopyToStorage (wxCommandEvent &event) { Store.style.push_back(temp); } else { - // Bug user? + int answer = wxMessageBox(wxString::Format(_T("There is already a style with the name \"%s\" on the current storage. Proceed and overwrite anyway?"),CurrentList->GetString(selections[i]).c_str()),_T("Style name collision."),wxYES_NO); + if (answer == wxYES) { + // Remove the old style + temp = styleStorageMap.at(selections[i]); + Store.style.remove(temp); + // And save the new one instead + temp = new AssStyle; + *temp = *styleMap.at(selections[i]); + Store.style.push_back(temp); + } + // else do nothing } } Store.Save(CatalogList->GetString(CatalogList->GetSelection()));