#include "lib/exceptions.h"
#include "lib/ffmpeg_encoder.h"
#include "lib/film.h"
+#include "lib/font_config.h"
#include "lib/hints.h"
#include "lib/job_manager.h"
#include "lib/kdm_with_metadata.h"
void file_save ()
{
- _film->write_metadata ();
+ try {
+ _film->write_metadata ();
+ } catch (exception& e) {
+ error_dialog(this, _("Could not save project."), std_to_wx(e.what()));
+ }
}
void file_save_as_template ()
{
SaveTemplateDialog dialog(this);
if (dialog.ShowModal() == wxID_OK) {
- Config::instance()->save_template(_film, dialog.name());
+ try {
+ Config::instance()->save_template(_film, dialog.name());
+ } catch (exception& e) {
+ error_dialog(this, _("Could not save template."), std_to_wx(e.what()));
+ }
}
}
auto film = make_shared<Film>(dialog.path());
film->copy_from (_film);
film->set_name(dialog.path().filename().generic_string());
- film->write_metadata ();
+ try {
+ film->write_metadata();
+ } catch (exception& e) {
+ error_dialog(this, _("Could not duplicate project."), std_to_wx(e.what()));
+ }
}
}
auto film = make_shared<Film>(dialog.path());
film->copy_from (_film);
film->set_name(dialog.path().filename().generic_string());
- film->write_metadata ();
- set_film (film);
+ try {
+ film->write_metadata ();
+ set_film (film);
+ } catch (exception& e) {
+ error_dialog(this, _("Could not duplicate project."), std_to_wx(e.what()));
+ }
}
}
/* Also stop hearing about analytics-related stuff */
_analytics_message_connection.disconnect ();
+ FontConfig::drop();
+
ev.Skip ();
}
}
if (_film->dirty ()) {
- T d (_film->name ());
- switch (d.run ()) {
+ T dialog(_film->name());
+ switch (dialog.run()) {
case wxID_NO:
return true;
case wxID_YES: