#include "wx/wx_util.h"
#include "wx/film_name_location_dialog.h"
#include "wx/wx_signal_manager.h"
+#include "wx/recreate_chain_dialog.h"
#include "wx/about_dialog.h"
#include "wx/kdm_dialog.h"
#include "wx/self_dkdm_dialog.h"
class FilmChangedClosingDialog : public boost::noncopyable
{
public:
- FilmChangedClosingDialog (string name)
+ explicit FilmChangedClosingDialog (string name)
{
_dialog = new wxMessageDialog (
0,
class FilmChangedDuplicatingDialog : public boost::noncopyable
{
public:
- FilmChangedDuplicatingDialog (string name)
+ explicit FilmChangedDuplicatingDialog (string name)
{
_dialog = new wxMessageDialog (
0,
ID_help_report_a_problem,
/* IDs for shortcuts (with no associated menu item) */
ID_add_file,
- ID_remove
+ ID_remove,
+ ID_start_stop,
+ ID_timeline,
+ ID_back_frame,
+ ID_forward_frame
};
class DOMFrame : public wxFrame
{
public:
- DOMFrame (wxString const & title)
+ explicit DOMFrame (wxString const & title)
: wxFrame (NULL, -1, title)
, _video_waveform_dialog (0)
, _hints_dialog (0)
overall_panel->SetSizer (main_sizer);
#ifdef __WXOSX__
- int accelerators = 3;
+ int accelerators = 7;
#else
- int accelerators = 2;
+ int accelerators = 6;
#endif
wxAcceleratorEntry* accel = new wxAcceleratorEntry[accelerators];
accel[0].Set (wxACCEL_CTRL, static_cast<int>('A'), ID_add_file);
accel[1].Set (wxACCEL_NORMAL, WXK_DELETE, ID_remove);
+ accel[2].Set (wxACCEL_NORMAL, WXK_SPACE, ID_start_stop);
+ accel[3].Set (wxACCEL_CTRL, static_cast<int>('T'), ID_timeline);
+ accel[4].Set (wxACCEL_NORMAL, WXK_LEFT, ID_back_frame);
+ accel[5].Set (wxACCEL_NORMAL, WXK_RIGHT, ID_forward_frame);
#ifdef __WXOSX__
- accel[2].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_EXIT);
+ accel[6].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_EXIT);
#endif
Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::remove_clicked, this, _1), ID_remove);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::start_stop_pressed, this, _1), ID_start_stop);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::timeline_pressed, this), ID_timeline);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::back_frame, this, _1), ID_back_frame);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::forward_frame, this, _1), ID_forward_frame);
wxAcceleratorTable accel_table (accelerators, accel);
SetAcceleratorTable (accel_table);
delete[] accel;
int const r = d->ShowModal ();
if (r == wxID_OK && d->check_path() && maybe_save_then_delete_film<FilmChangedClosingDialog>()) {
- new_film (d->path(), d->template_name());
+ try {
+ new_film (d->path(), d->template_name());
+ } catch (boost::filesystem::filesystem_error& e) {
+ error_dialog (this, _("Could not create folder to store film"), std_to_wx(e.what()));
+ }
}
d->Destroy ();
d->cpl (),
dcp::LocalTime ("2012-01-01T01:00:00+00:00"),
dcp::LocalTime ("2112-01-01T01:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1
+ dcp::MODIFIED_TRANSITIONAL_1,
+ true,
+ 0
);
} catch (dcp::NotEncryptedError& e) {
error_dialog (this, _("CPL's content is not encrypted."));
add_item (jobs_menu, _("&Make DCP\tCtrl-M"), ID_jobs_make_dcp, NEEDS_FILM | NOT_DURING_DCP_CREATION);
add_item (jobs_menu, _("Make DCP in &batch converter\tCtrl-B"), ID_jobs_make_dcp_batch, NEEDS_FILM | NOT_DURING_DCP_CREATION);
jobs_menu->AppendSeparator ();
- add_item (jobs_menu, _("Make &KDMs...\tCtrl-K"), ID_jobs_make_kdms, NEEDS_FILM | NEEDS_ENCRYPTION);
+ add_item (jobs_menu, _("Make &KDMs...\tCtrl-K"), ID_jobs_make_kdms, NEEDS_FILM);
add_item (jobs_menu, _("Make DKDM for DCP-o-matic..."), ID_jobs_make_self_dkdm, NEEDS_FILM | NEEDS_ENCRYPTION);
jobs_menu->AppendSeparator ();
add_item (jobs_menu, _("Export...\tCtrl-E"), ID_jobs_export, NEEDS_FILM);
_update_news_requested = false;
}
+ /** Skip the given event if we're focussed in a TextCtrl, so that hotkeys don't
+ * steal from text controls.
+ */
+ bool maybe_pass (wxCommandEvent& ev)
+ {
+ wxWindow* f = wxWindow::FindFocus();
+ if (!f || !dynamic_cast<wxTextCtrl*>(f)) {
+ return false;
+ }
+
+ ev.Skip();
+ return true;
+ }
+
+ void start_stop_pressed (wxCommandEvent& ev)
+ {
+ if (maybe_pass(ev)) {
+ return;
+ }
+
+ if (_film_viewer->playing()) {
+ _film_viewer->stop();
+ } else {
+ _film_viewer->start();
+ }
+ }
+
+ void timeline_pressed ()
+ {
+ _film_editor->content_panel()->timeline_clicked ();
+ }
+
+ void back_frame (wxCommandEvent& ev)
+ {
+ if (maybe_pass(ev)) {
+ return;
+ }
+
+ _film_viewer->back_frame ();
+ }
+
+ void forward_frame (wxCommandEvent& ev)
+ {
+ if (maybe_pass(ev)) {
+ return;
+ }
+
+ _film_viewer->forward_frame ();
+ }
+
FilmEditor* _film_editor;
FilmViewer* _film_viewer;
VideoWaveformDialog* _video_waveform_dialog;
*/
Config::drop ();
+ Config::BadSignerChain.connect (boost::bind (&App::config_bad_signer_chain, this));
+
_frame = new DOMFrame (_("DCP-o-matic"));
SetTopWindow (_frame);
_frame->Maximize ();
message_dialog (_frame, std_to_wx (m));
}
+ bool config_bad_signer_chain ()
+ {
+ if (Config::instance()->nagged(Config::NAG_BAD_SIGNER_CHAIN)) {
+ return false;
+ }
+
+ RecreateChainDialog* d = new RecreateChainDialog (_frame);
+ int const r = d->ShowModal ();
+ d->Destroy ();
+ return r == wxID_OK;
+ }
+
DOMFrame* _frame;
shared_ptr<wxTimer> _timer;
string _film_to_load;