*/
-#include "wx/full_config_dialog.h"
#include "wx/about_dialog.h"
-#include "wx/report_problem_dialog.h"
+#include "wx/dcpomatic_button.h"
+#include "wx/editable_list.h"
#include "wx/file_picker_ctrl.h"
-#include "wx/wx_util.h"
-#include "wx/wx_signal_manager.h"
-#include "wx/screens_panel.h"
-#include "wx/kdm_timing_panel.h"
-#include "wx/kdm_output_panel.h"
+#include "wx/full_config_dialog.h"
#include "wx/job_view_dialog.h"
-#include "wx/file_dialog_wrapper.h"
+#include "wx/kdm_output_panel.h"
+#include "wx/kdm_timing_panel.h"
+#include "wx/nag_dialog.h"
#include "wx/new_dkdm_folder_dialog.h"
-#include "wx/editable_list.h"
+#include "wx/report_problem_dialog.h"
+#include "wx/screens_panel.h"
#include "wx/static_text.h"
-#include "wx/dcpomatic_button.h"
-#include "wx/nag_dialog.h"
+#include "wx/wx_signal_manager.h"
+#include "wx/wx_util.h"
+#include "lib/cinema.h"
+#include "lib/compose.hpp"
#include "lib/config.h"
-#include "lib/util.h"
-#include "lib/screen.h"
+#include "lib/cross.h"
+#include "lib/dcpomatic_log.h"
+#include "lib/dkdm_wrapper.h"
+#include "lib/exceptions.h"
+#include "lib/file_log.h"
#include "lib/job_manager.h"
#include "lib/kdm_with_metadata.h"
-#include "lib/exceptions.h"
+#include "lib/screen.h"
#include "lib/send_kdm_email_job.h"
-#include "lib/compose.hpp"
-#include "lib/cinema.h"
-#include "lib/dkdm_wrapper.h"
-#include "lib/cross.h"
+#include "lib/util.h"
#include <dcp/encrypted_kdm.h>
#include <dcp/decrypted_kdm.h>
#include <dcp/exceptions.h>
-#include "lib/warnings.h"
-DCPOMATIC_DISABLE_WARNINGS
-#include <wx/wx.h>
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
+#include <wx/filepicker.h>
#include <wx/preferences.h>
#include <wx/splash.h>
-#include <wx/filepicker.h>
-DCPOMATIC_ENABLE_WARNINGS
+#include <wx/treectrl.h>
+#include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
#ifdef __WXOSX__
#include <ApplicationServices/ApplicationServices.h>
#endif
using std::exception;
using std::list;
-using std::string;
-using std::vector;
-using std::pair;
+using std::make_shared;
using std::map;
+using std::pair;
using std::shared_ptr;
+using std::string;
+using std::vector;
using boost::bind;
using boost::optional;
using boost::ref;
{
public:
explicit DOMFrame (wxString const & title)
- : wxFrame (0, -1, title)
+ : wxFrame (nullptr, -1, title)
, _config_dialog (nullptr)
, _job_view (nullptr)
{
h = new StaticText (overall_panel, _("Output"));
h->SetFont (subheading_font);
right->Add (h, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
- /* XXX: hard-coded non-interop here */
- _output = new KDMOutputPanel (overall_panel, false);
+ _output = new KDMOutputPanel (overall_panel);
right->Add (_output, 0, wxALL, DCPOMATIC_SIZER_Y_GAP);
_create = new Button (overall_panel, _("Create KDMs"));
_export_dkdm->Bind (wxEVT_BUTTON, bind (&DOMFrame::export_dkdm_clicked, this));
setup_sensitivity ();
+
+ dcpomatic_log = make_shared<FileLog>(State::write_path("kdm.log"));
}
private:
begin,
end,
decrypted.annotation_text().get_value_or (""),
- decrypted.content_title_text(),
+ title,
dcp::LocalTime().as_string()
);
name_values['i'] = encrypted.cpl_id ();
/* Encrypt */
- kdms.push_back (
- KDMWithMetadataPtr(
- new KDMWithMetadata(name_values, i->cinema.get(), i->cinema->emails, encrypted)
- )
- );
+ kdms.push_back (make_shared<KDMWithMetadata>(name_values, i->cinema.get(), i->cinema->emails, encrypted));
}
}
_output->setup_sensitivity ();
wxArrayTreeItemIds sel;
_dkdm->GetSelections (sel);
- shared_ptr<DKDMGroup> group = dynamic_pointer_cast<DKDMGroup>(selected_dkdm());
- shared_ptr<DKDM> dkdm = dynamic_pointer_cast<DKDM>(selected_dkdm());
- _create->Enable (!_screens->screens().empty() && sel.GetCount() > 0);
+ auto group = dynamic_pointer_cast<DKDMGroup>(selected_dkdm());
+ auto dkdm = dynamic_pointer_cast<DKDM>(selected_dkdm());
+ _create->Enable (!_screens->screens().empty() && sel.GetCount() > 0 && dkdm);
_remove_dkdm->Enable (sel.GetCount() > 0 && (!group || group->name() != "root"));
_export_dkdm->Enable (sel.GetCount() > 0 && dkdm);
}
/* Decrypt the DKDM to make sure that we can */
dcp::DecryptedKDM dkdm(ekdm, chain->key().get());
- shared_ptr<DKDMBase> new_dkdm(new DKDM(ekdm));
- auto group = dynamic_pointer_cast<DKDMGroup> (selected_dkdm ());
+ auto new_dkdm = make_shared<DKDM>(ekdm);
+ auto group = dynamic_pointer_cast<DKDMGroup> (selected_dkdm());
if (!group) {
group = Config::instance()->dkdms ();
}
{
auto d = new NewDKDMFolderDialog (this);
if (d->ShowModal() == wxID_OK) {
- shared_ptr<DKDMBase> new_dkdm (new DKDMGroup (wx_to_std (d->get ())));
- auto parent = dynamic_pointer_cast<DKDMGroup> (selected_dkdm ());
+ auto new_dkdm = make_shared<DKDMGroup>(wx_to_std(d->get()));
+ auto parent = dynamic_pointer_cast<DKDMGroup>(selected_dkdm());
if (!parent) {
parent = Config::instance()->dkdms ();
}
JobViewDialog* _job_view;
};
+
/** @class App
* @brief The magic App class for wxWidgets.
*/
public:
App ()
: wxApp ()
- , _frame (0)
+ , _frame (nullptr)
{}
private:
- bool OnInit ()
+ bool OnInit () override
{
wxSplashScreen* splash = nullptr;
_frame->Maximize ();
if (splash) {
splash->Destroy ();
- splash = 0;
+ splash = nullptr;
}
_frame->Show ();
}
/* An unhandled exception has occurred inside the main event loop */
- bool OnExceptionInMainLoop ()
+ bool OnExceptionInMainLoop () override
{
try {
throw;
);
} catch (exception& e) {
error_dialog (
- 0,
+ nullptr,
wxString::Format (
_("An exception occurred: %s.\n\n") + " " + REPORT_PROBLEM,
- std_to_wx (e.what ())
+ std_to_wx(e.what())
)
);
} catch (...) {
return false;
}
- void OnUnhandledException ()
+ void OnUnhandledException () override
{
- error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM);
+ error_dialog (nullptr, _("An unknown exception occurred.") + " " + REPORT_PROBLEM);
}
void idle ()
void config_warning (string m)
{
- message_dialog (_frame, std_to_wx (m));
+ message_dialog (_frame, std_to_wx(m));
}
DOMFrame* _frame;