projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add missing file=f so that all desktop shortcuts are uninstalled.
[dcpomatic.git]
/
src
/
tools
/
dcpomatic_editor.cc
diff --git
a/src/tools/dcpomatic_editor.cc
b/src/tools/dcpomatic_editor.cc
index 51135ef462372f38750aa22f3452d49ce1a1ac36..eb968b1e8d5cd251a65e690fec45a584f14f2a0c 100644
(file)
--- a/
src/tools/dcpomatic_editor.cc
+++ b/
src/tools/dcpomatic_editor.cc
@@
-147,10
+147,10
@@
public:
ReelEditor(wxWindow* parent)
: wxDialog(parent, wxID_ANY, _("Edit reel"))
{
ReelEditor(wxWindow* parent)
: wxDialog(parent, wxID_ANY, _("Edit reel"))
{
-
auto
sizer = new wxBoxSizer(wxVERTICAL);
+
_
sizer = new wxBoxSizer(wxVERTICAL);
_notebook = new wxNotebook(this, wxID_ANY);
_notebook = new wxNotebook(this, wxID_ANY);
- sizer->Add(_notebook, wxEXPAND | wxALL, 1, DCPOMATIC_DIALOG_BORDER);
- SetSizerAndFit(sizer);
+
_
sizer->Add(_notebook, wxEXPAND | wxALL, 1, DCPOMATIC_DIALOG_BORDER);
+ SetSizerAndFit(
_
sizer);
}
optional<shared_ptr<dcp::Reel>> get() {
}
optional<shared_ptr<dcp::Reel>> get() {
@@
-171,10
+171,14
@@
public:
if (_reel->main_subtitle()) {
_notebook->AddPage(new AssetPanel(_notebook, _reel->main_subtitle()), _("Subtitle"));
}
if (_reel->main_subtitle()) {
_notebook->AddPage(new AssetPanel(_notebook, _reel->main_subtitle()), _("Subtitle"));
}
+
+ _sizer->Layout();
+ _sizer->SetSizeHints(this);
}
private:
wxNotebook* _notebook = nullptr;
}
private:
wxNotebook* _notebook = nullptr;
+ wxSizer* _sizer = nullptr;
shared_ptr<dcp::Reel> _reel;
};
shared_ptr<dcp::Reel> _reel;
};
@@
-324,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())));
}
@@
-362,12
+371,12
@@
private:
void file_open ()
{
auto d = wxStandardPaths::Get().GetDocumentsDir();
void file_open ()
{
auto d = wxStandardPaths::Get().GetDocumentsDir();
-
auto c = new wxDirDialog
(this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
+
wxDirDialog dialog
(this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
int r;
while (true) {
int r;
while (true) {
- r =
c->ShowModal
();
- if (r == wxID_OK &&
c->
GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
+ r =
dialog.ShowModal
();
+ if (r == wxID_OK &&
dialog.
GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
error_dialog (this, _("You did not select a folder. Make sure that you select a folder before clicking Open."));
} else {
break;
error_dialog (this, _("You did not select a folder. Make sure that you select a folder before clicking Open."));
} else {
break;
@@
-375,11
+384,9
@@
private:
}
if (r == wxID_OK) {
}
if (r == wxID_OK) {
- boost::filesystem::path const dcp
(wx_to_std (c->GetPath
()));
+ boost::filesystem::path const dcp
(wx_to_std(dialog.GetPath
()));
load_dcp (dcp);
}
load_dcp (dcp);
}
-
- c->Destroy ();
}
void file_save ()
}
void file_save ()
@@
-394,9
+401,8
@@
private:
void help_about ()
{
void help_about ()
{
- auto d = new AboutDialog (this);
- d->ShowModal ();
- d->Destroy ();
+ AboutDialog dialog(this);
+ dialog.ShowModal();
}
wxPanel* _overall_panel = nullptr;
}
wxPanel* _overall_panel = nullptr;
@@
-431,7
+437,7
@@
private:
bool OnInit () override
{
bool OnInit () override
{
- wxSplashScreen* splash
= nullptr
;
+ wxSplashScreen* splash;
try {
wxInitAllImageHandlers ();
try {
wxInitAllImageHandlers ();