projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ec9f70
)
Catch exceptions from some calls to write_metadata().
author
Carl Hetherington
<cth@carlh.net>
Sun, 5 Mar 2023 10:48:46 +0000
(11:48 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 5 Mar 2023 10:48:46 +0000
(11:48 +0100)
src/tools/dcpomatic.cc
patch
|
blob
|
history
diff --git
a/src/tools/dcpomatic.cc
b/src/tools/dcpomatic.cc
index 1923a12a3f4305e964d53e6718ff6e1936680a85..d40976094a0b95125c533ee6789a588a92fbda61 100644
(file)
--- a/
src/tools/dcpomatic.cc
+++ b/
src/tools/dcpomatic.cc
@@
-614,14
+614,22
@@
private:
void file_save ()
{
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) {
}
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()));
+ }
}
}
}
}
@@
-633,7
+641,11
@@
private:
auto film = make_shared<Film>(dialog.path());
film->copy_from (_film);
film->set_name(dialog.path().filename().generic_string());
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()));
+ }
}
}
}
}
@@
-645,8
+657,12
@@
private:
auto film = make_shared<Film>(dialog.path());
film->copy_from (_film);
film->set_name(dialog.path().filename().generic_string());
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()));
+ }
}
}
}
}