From e2361edc2fc2c07d6474bf5a7f76dc2a5b55ee81 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 Mar 2018 00:44:59 +0000 Subject: [PATCH] Ctrl-T to open timeline (#1201). --- ChangeLog | 3 ++- src/tools/dcpomatic.cc | 16 ++++++++++++---- src/wx/content_panel.cc | 4 ++++ src/wx/content_panel.h | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c59092e9..a4855f297 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2018-03-23 Carl Hetherington - * Add space shortcut to start/stop playback (#1201). + * Add space shortcut to start/stop playback and + Ctrl-T to open timeline (#1201). 2018-03-22 Carl Hetherington diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 982e38e67..4d888b3fa 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -219,7 +219,8 @@ enum { /* IDs for shortcuts (with no associated menu item) */ ID_add_file, ID_remove, - ID_start_stop + ID_start_stop, + ID_timeline }; class DOMFrame : public wxFrame @@ -329,20 +330,22 @@ public: overall_panel->SetSizer (main_sizer); #ifdef __WXOSX__ - int accelerators = 4; + int accelerators = 5; #else - int accelerators = 3; + int accelerators = 4; #endif wxAcceleratorEntry* accel = new wxAcceleratorEntry[accelerators]; accel[0].Set (wxACCEL_CTRL, static_cast('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('T'), ID_timeline); #ifdef __WXOSX__ - accel[3].Set (wxACCEL_CTRL, static_cast('W'), wxID_EXIT); + accel[4].Set (wxACCEL_CTRL, static_cast('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), ID_start_stop); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::timeline_pressed, this), ID_timeline); wxAcceleratorTable accel_table (accelerators, accel); SetAcceleratorTable (accel_table); delete[] accel; @@ -1213,6 +1216,11 @@ private: } } + void timeline_pressed () + { + _film_editor->content_panel()->timeline_clicked (); + } + FilmEditor* _film_editor; FilmViewer* _film_viewer; VideoWaveformDialog* _video_waveform_dialog; diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 6bcffd377..1680e5926 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -409,6 +409,10 @@ ContentPanel::remove_clicked (bool hotkey) void ContentPanel::timeline_clicked () { + if (!_film) { + return; + } + if (_timeline_dialog) { _timeline_dialog->Destroy (); _timeline_dialog = 0; diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index 475567d28..15e0fb6e1 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -69,6 +69,7 @@ public: void add_file_clicked (); bool remove_clicked (bool hotkey); + void timeline_clicked (); boost::signals2::signal SelectionChanged; @@ -80,7 +81,6 @@ private: void later_clicked (); void right_click (wxListEvent &); void files_dropped (wxDropFilesEvent &); - void timeline_clicked (); void setup (); void setup_sensitivity (); -- 2.30.2