2^10 GET! Style editor will no longer admit creation of styles with equal names. Also, hitting enter it will now "OK" it.

Originally committed to SVN as r1024.
This commit is contained in:
Rodrigo Braz Monteiro 2007-04-08 00:21:56 +00:00
parent 1c027dd44a
commit b1ce35f817
2 changed files with 7 additions and 5 deletions

View file

@ -107,6 +107,8 @@ Please visit http://aegisub.net to download latest version
- Changing script resolution when asked to on video loading will now set an undo point. (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) - 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) - Two storages with the same name can no longer be created in the styles manager. (AMZ)
- Style editor will no longer admit creation of styles with equal names. (AMZ)
- Hitting enter on style editor will now "OK" it. (AMZ)
= 1.10 beta - 2006.08.07 =========================== = 1.10 beta - 2006.08.07 ===========================

View file

@ -272,17 +272,17 @@ DialogStyleEditor::DialogStyleEditor (wxWindow *parent, AssStyle *_style, Subtit
// Buttons // Buttons
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL);
ButtonSizer->AddStretchSpacer(1); ButtonSizer->AddStretchSpacer(1);
wxButton *okButton = new wxButton(this, wxID_OK);
#ifndef __WXMAC__ #ifndef __WXMAC__
ButtonSizer->Add(new wxButton(this, wxID_OK),0,wxRIGHT,5); ButtonSizer->Add(okButton,0,wxRIGHT,5);
ButtonSizer->Add(new wxButton(this, wxID_CANCEL),0,wxRIGHT,5); ButtonSizer->Add(new wxButton(this, wxID_CANCEL),0,wxRIGHT,5);
ButtonSizer->Add(new wxButton(this, wxID_APPLY),0,wxRIGHT,5); ButtonSizer->Add(new wxButton(this, wxID_APPLY),0,wxRIGHT,5);
#else #else
wxButton *okButton = new wxButton(this, wxID_OK);
ButtonSizer->Add(new wxButton(this, wxID_APPLY),0,wxRIGHT,5); ButtonSizer->Add(new wxButton(this, wxID_APPLY),0,wxRIGHT,5);
ButtonSizer->Add(new wxButton(this, wxID_CANCEL),0,wxRIGHT,5); ButtonSizer->Add(new wxButton(this, wxID_CANCEL),0,wxRIGHT,5);
ButtonSizer->Add(okButton,0,wxRIGHT,5); ButtonSizer->Add(okButton,0,wxRIGHT,5);
okButton->SetDefault();
#endif #endif
okButton->SetDefault();
// General Layout // General Layout
MainSizer = new wxBoxSizer(wxVERTICAL); MainSizer = new wxBoxSizer(wxVERTICAL);
@ -360,8 +360,8 @@ void DialogStyleEditor::Apply (bool apply,bool close) {
for (unsigned int i=0;i<styles.Count();i++) { for (unsigned int i=0;i<styles.Count();i++) {
if (styles[i] == newStyleName) { if (styles[i] == newStyleName) {
if (grid->ass->GetStyle(styles[i]) != style) { 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); wxMessageBox(_T("There is already a style with this name. Please choose another name."),_T("Style name conflict."),wxICON_ERROR);
if (answer == wxNO) return; return;
} }
} }
} }