Prompt for category removal

This commit is contained in:
OmrSi 2021-02-21 15:45:14 +02:00
parent e947bd87ac
commit 4c93edefe8
5 changed files with 15 additions and 5 deletions

View File

@ -2609,6 +2609,7 @@ Continue?</RestoreDefaultSettingsMsg>
<CategoryName>Category name</CategoryName>
<CategorySetDefault>Set as default</CategorySetDefault>
<CategoryNote>Note: "Default" styles will be applied to new ASSA files</CategoryNote>
<CategoryDelete>Are you sure you want to delete this category?</CategoryDelete>
</SubStationAlphaStyles>
<PointSync>
<Title>Point synchronization</Title>

View File

@ -1977,10 +1977,14 @@ namespace Nikse.SubtitleEdit.Forms.Styles
private void buttonStorageCategoryDelete_Click(object sender, EventArgs e)
{
_storageCategories.Remove(_currentCategory);
comboboxStorageCategories.Items.Remove(_currentCategory.Name);
_currentCategory = _storageCategories.Single(x => x.IsDefault);
comboboxStorageCategories.SelectedItem = _currentCategory.Name;
var result = MessageBox.Show(LanguageSettings.Current.SubStationAlphaStyles.CategoryDelete, string.Empty, MessageBoxButtons.YesNoCancel);
if (result == DialogResult.Yes)
{
_storageCategories.Remove(_currentCategory);
comboboxStorageCategories.Items.Remove(_currentCategory.Name);
_currentCategory = _storageCategories.Single(x => x.IsDefault);
comboboxStorageCategories.SelectedItem = _currentCategory.Name;
}
}
private void buttonStorageCategorySetDefault_Click(object sender, EventArgs e)

View File

@ -2947,7 +2947,8 @@ can edit in same subtitle file (collaboration)",
NewCategory = "New category",
CategoryName = "Category name",
CategorySetDefault = "Set as default",
CategoryNote = "Note: \"Default\" styles will be applied to new ASSA files"
CategoryNote = "Note: \"Default\" styles will be applied to new ASSA files",
CategoryDelete = "Are you sure you want to delete this category?"
};
PointSync = new LanguageStructure.PointSync

View File

@ -7141,6 +7141,9 @@ namespace Nikse.SubtitleEdit.Logic
case "SubStationAlphaStyles/CategoryNote":
language.SubStationAlphaStyles.CategoryNote = reader.Value;
break;
case "SubStationAlphaStyles/CategoryDelete":
language.SubStationAlphaStyles.CategoryDelete = reader.Value;
break;
case "PointSync/Title":
language.PointSync.Title = reader.Value;
break;

View File

@ -2804,6 +2804,7 @@
public string CategoryName { get; set; }
public string CategorySetDefault { get; set; }
public string CategoryNote { get; set; }
public string CategoryDelete { get; set; }
}
public class PointSync