projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
05b9552
)
Cope with bad DCPs better in the editor.
author
Carl Hetherington
<cth@carlh.net>
Sat, 3 Jun 2023 19:18:36 +0000
(21:18 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 4 Jun 2023 22:48:55 +0000
(
00:48
+0200)
src/tools/dcpomatic_editor.cc
patch
|
blob
|
history
diff --git
a/src/tools/dcpomatic_editor.cc
b/src/tools/dcpomatic_editor.cc
index 69fbe4643a1fa2dec5be43f748685fa0c472a8d2..eb968b1e8d5cd251a65e690fec45a584f14f2a0c 100644
(file)
--- a/
src/tools/dcpomatic_editor.cc
+++ b/
src/tools/dcpomatic_editor.cc
@@
-328,10
+328,15
@@
public:
void load_dcp (boost::filesystem::path path)
{
void load_dcp (boost::filesystem::path path)
{
- _notebook->DeleteAllPages();
+ try {
+ _dcp = dcp::DCP(path);
+ _dcp->read();
+ } catch (std::runtime_error& e) {
+ error_dialog(this, _("Could not load DCP"), std_to_wx(e.what()));
+ return;
+ }
- _dcp = dcp::DCP(path);
- _dcp->read();
+ _notebook->DeleteAllPages();
for (auto cpl: _dcp->cpls()) {
_notebook->AddPage(new CPLPanel(_notebook, cpl), wx_to_std(cpl->annotation_text().get_value_or(cpl->id())));
}
for (auto cpl: _dcp->cpls()) {
_notebook->AddPage(new CPLPanel(_notebook, cpl), wx_to_std(cpl->annotation_text().get_value_or(cpl->id())));
}