Remove annoying modal dialogs
This commit is contained in:
parent
cb1157a308
commit
54d8bde136
2 changed files with 6 additions and 13 deletions
|
@ -245,9 +245,7 @@ void add_styles(Func1 name_checker, Func2 style_adder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int confirm_delete(int n, wxWindow *parent, wxString const& title) {
|
int confirm_delete(int n, wxWindow *parent, wxString const& title) {
|
||||||
return wxMessageBox(
|
return wxYES;
|
||||||
fmt_plural(n, "Are you sure you want to delete this style?", "Are you sure you want to delete these %d styles?", n),
|
|
||||||
title, wxYES_NO | wxICON_EXCLAMATION, parent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_single_sel(wxListBox *lb) {
|
int get_single_sel(wxListBox *lb) {
|
||||||
|
@ -507,10 +505,8 @@ void DialogStyleManager::OnCopyToStorage() {
|
||||||
wxString styleName = CurrentList->GetString(selections[i]);
|
wxString styleName = CurrentList->GetString(selections[i]);
|
||||||
|
|
||||||
if (AssStyle *style = Store.GetStyle(from_wx(styleName))) {
|
if (AssStyle *style = Store.GetStyle(from_wx(styleName))) {
|
||||||
if (wxYES == wxMessageBox(fmt_tl("There is already a style with the name \"%s\" in the current storage. Overwrite?", styleName), _("Style name collision"), wxYES_NO)) {
|
*style = *styleMap.at(selections[i]);
|
||||||
*style = *styleMap.at(selections[i]);
|
copied.push_back(styleName);
|
||||||
copied.push_back(styleName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Store.push_back(agi::make_unique<AssStyle>(*styleMap.at(selections[i])));
|
Store.push_back(agi::make_unique<AssStyle>(*styleMap.at(selections[i])));
|
||||||
|
@ -534,10 +530,8 @@ void DialogStyleManager::OnCopyToCurrent() {
|
||||||
wxString styleName = StorageList->GetString(selections[i]);
|
wxString styleName = StorageList->GetString(selections[i]);
|
||||||
|
|
||||||
if (AssStyle *style = c->ass->GetStyle(from_wx(styleName))) {
|
if (AssStyle *style = c->ass->GetStyle(from_wx(styleName))) {
|
||||||
if (wxYES == wxMessageBox(fmt_tl("There is already a style with the name \"%s\" in the current script. Overwrite?", styleName), _("Style name collision"), wxYES_NO)) {
|
*style = *Store[selections[i]];
|
||||||
*style = *Store[selections[i]];
|
copied.push_back(styleName);
|
||||||
copied.push_back(styleName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
c->ass->Styles.push_back(*new AssStyle(*Store[selections[i]]));
|
c->ass->Styles.push_back(*new AssStyle(*Store[selections[i]]));
|
||||||
|
|
|
@ -252,7 +252,7 @@ void Project::DoLoadAudio(agi::fs::path const& path, bool quiet) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (agi::fs::FileNotFound const& e) {
|
catch (agi::fs::FileNotFound const& e) {
|
||||||
return ShowError(_("The audio file was not found: ") + to_wx(e.GetMessage()));
|
return;
|
||||||
}
|
}
|
||||||
catch (agi::AudioDataNotFound const& e) {
|
catch (agi::AudioDataNotFound const& e) {
|
||||||
if (quiet) {
|
if (quiet) {
|
||||||
|
@ -294,7 +294,6 @@ bool Project::DoLoadVideo(agi::fs::path const& path) {
|
||||||
catch (agi::UserCancelException const&) { return false; }
|
catch (agi::UserCancelException const&) { return false; }
|
||||||
catch (agi::fs::FileSystemError const& err) {
|
catch (agi::fs::FileSystemError const& err) {
|
||||||
config::mru->Remove("Video", path);
|
config::mru->Remove("Video", path);
|
||||||
ShowError(to_wx(err.GetMessage()));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (VideoProviderError const& err) {
|
catch (VideoProviderError const& err) {
|
||||||
|
|
Loading…
Reference in a new issue