projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move ScopeGuard into libdcp.
[dcpomatic.git]
/
src
/
tools
/
dcpomatic_combiner.cc
diff --git
a/src/tools/dcpomatic_combiner.cc
b/src/tools/dcpomatic_combiner.cc
index 40587e23ad4b5f9fae1ea114fadc7ca824751d6b..c135184e6a7f04a5ce1eb94b45e1456cec0d3012 100644
(file)
--- a/
src/tools/dcpomatic_combiner.cc
+++ b/
src/tools/dcpomatic_combiner.cc
@@
-19,14
+19,15
@@
*/
*/
+#include "wx/dir_dialog.h"
#include "wx/dir_picker_ctrl.h"
#include "wx/editable_list.h"
#include "wx/wx_signal_manager.h"
#include "lib/combine_dcp_job.h"
#include "lib/config.h"
#include "wx/dir_picker_ctrl.h"
#include "wx/editable_list.h"
#include "wx/wx_signal_manager.h"
#include "lib/combine_dcp_job.h"
#include "lib/config.h"
+#include "lib/constants.h"
#include "lib/cross.h"
#include "lib/job_manager.h"
#include "lib/cross.h"
#include "lib/job_manager.h"
-#include "lib/util.h"
#include <dcp/combine.h>
LIBDCP_DISABLE_WARNINGS
#include <wx/filepicker.h>
#include <dcp/combine.h>
LIBDCP_DISABLE_WARNINGS
#include <wx/filepicker.h>
@@
-56,18
+57,23
@@
display_string (boost::filesystem::path p, int)
}
}
-class DirDialogWrapper : public
wx
DirDialog
+class DirDialogWrapper : public DirDialog
{
public:
DirDialogWrapper (wxWindow* parent)
{
public:
DirDialogWrapper (wxWindow* parent)
- :
wxDirDialog (parent, _("Choose a DCP folder"), wxT(""), wxDD_DIR_MUST_EXIST
)
+ :
DirDialog (parent, _("Choose a DCP folder"), wxDD_DIR_MUST_EXIST, "AddCombinerInputPath"
)
{
}
{
}
- boost::filesystem::path get () const
+ virtual int ShowModal() override
{
{
- return boost::filesystem::path(wx_to_std(GetPath()));
+ return DirDialog::show() ? wxID_OK : wxID_CANCEL;
+ }
+
+ optional<boost::filesystem::path> get () const
+ {
+ return path();
}
void set (boost::filesystem::path)
}
void set (boost::filesystem::path)
@@
-100,8
+106,8
@@
public:
boost::bind(&DOMFrame::inputs, this),
boost::bind(&DOMFrame::set_inputs, this, _1),
&display_string,
boost::bind(&DOMFrame::inputs, this),
boost::bind(&DOMFrame::set_inputs, this, _1),
&display_string,
-
false
,
- true
+
EditableListTitle::VISIBLE
,
+ EditableListButton::NEW | EditableListButton::REMOVE
);
auto output = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
);
auto output = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
@@
-169,7
+175,7
@@
private:
auto jm = JobManager::instance ();
jm->add (make_shared<CombineDCPJob>(_inputs, output, wx_to_std(_annotation_text->GetValue())));
auto jm = JobManager::instance ();
jm->add (make_shared<CombineDCPJob>(_inputs, output, wx_to_std(_annotation_text->GetValue())));
- bool const ok = display_progress
(_("DCP-o-matic Combine
"), _("Combining DCPs"));
+ bool const ok = display_progress
(_("DCP-o-matic Combiner
"), _("Combining DCPs"));
if (!ok) {
return;
}
if (!ok) {
return;
}
@@
-210,7
+216,7
@@
public:
bool OnInit () override
{
try {
bool OnInit () override
{
try {
- Config::FailedToLoad.connect
(boost::bind (&App::config_failed_to_load, this
));
+ Config::FailedToLoad.connect
(boost::bind(&App::config_failed_to_load, this, _1
));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
SetAppName (_("DCP-o-matic Combiner"));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
SetAppName (_("DCP-o-matic Combiner"));
@@
-247,7
+253,7
@@
public:
*/
Config::drop ();
*/
Config::drop ();
- _frame = new DOMFrame
(_("DCP-o-matic DCP
Combiner"));
+ _frame = new DOMFrame
(_("DCP-o-matic
Combiner"));
SetTopWindow (_frame);
_frame->Show ();
SetTopWindow (_frame);
_frame->Show ();
@@
-257,16
+263,16
@@
public:
}
catch (exception& e)
{
}
catch (exception& e)
{
- error_dialog
(nullptr, wxString::Format ("DCP-o-matic DCP
Combiner could not start."), std_to_wx(e.what()));
+ error_dialog
(nullptr, wxString::Format("DCP-o-matic
Combiner could not start."), std_to_wx(e.what()));
return false;
}
return true;
}
return false;
}
return true;
}
- void config_failed_to_load
(
)
+ void config_failed_to_load
(Config::LoadFailure what
)
{
{
-
message_dialog (_frame, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create.")
);
+
report_config_load_failure(_frame, what
);
}
void config_warning (string m)
}
void config_warning (string m)