MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / OnProcess

Method OnProcess

src/dialog_export.cpp:184–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void DialogExport::OnProcess(wxCommandEvent &) {
185 if (!d.TransferDataFromWindow()) return;
186
187 auto filename = SaveFileSelector(_("Export subtitles file"), "", "", "", SubtitleFormat::GetWildcards(1), &d);
188 if (filename.empty()) return;
189
190 for (size_t i = 0; i < filter_list->GetCount(); ++i) {
191 if (filter_list->IsChecked(i))
192 exporter.AddFilter(from_wx(filter_list->GetString(i)));
193 }
194
195 try {
196 wxBusyCursor busy;
197 c->ass->Properties.export_encoding = from_wx(charset_list->GetStringSelection());
198 exporter.Export(filename, charset_list->GetStringSelection().utf8_str().data(), &d);
199 }
200 catch (agi::UserCancelException const&) { }
201 catch (agi::Exception const& err) {
202 wxMessageBox(to_wx(err.GetMessage()), "Error exporting subtitles", wxOK | wxICON_ERROR | wxCENTER, &d);
203 }
204 catch (std::exception const& err) {
205 wxMessageBox(to_wx(err.what()), "Error exporting subtitles", wxOK | wxICON_ERROR | wxCENTER, &d);
206 }
207 catch (...) {
208 wxMessageBox("Unknown error", "Error exporting subtitles", wxOK | wxICON_ERROR | wxCENTER, &d);
209 }
210
211 d.EndModal(0);
212}
213
214void DialogExport::OnChange(wxCommandEvent &) {
215 wxString sel = filter_list->GetStringSelection();

Callers

nothing calls this directly

Calls 5

SaveFileSelectorFunction · 0.85
from_wxFunction · 0.85
AddFilterMethod · 0.80
ExportMethod · 0.80
to_wxFunction · 0.70

Tested by

no test coverage detected