Ctrl-T to open timeline (#1201).
authorCarl Hetherington <cth@carlh.net>
Fri, 23 Mar 2018 00:44:59 +0000 (00:44 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 23 Mar 2018 00:44:59 +0000 (00:44 +0000)
ChangeLog
src/tools/dcpomatic.cc
src/wx/content_panel.cc
src/wx/content_panel.h

index 9c59092e90cbdcf585b9ff9d8b636077520402cb..a4855f2975b2f31509c1ba638adfec9cadff76b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2018-03-23  Carl Hetherington  <cth@carlh.net>
 
-       * 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  <cth@carlh.net>
 
index 982e38e67cdc3213046f8a958db40007ca688fcd..4d888b3fa7806e9cb347ba4f12f51bf87a8522f9 100644 (file)
@@ -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<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);
 #ifdef __WXOSX__
-               accel[3].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_EXIT);
+               accel[4].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), 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;
index 6bcffd37772ecf44d724200ca1ee86514f16c73d..1680e5926b2a8d36e223401391199e43eee2c93b 100644 (file)
@@ -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;
index 475567d28e46e5ada0940e429fc34b1814d4d3eb..15e0fb6e1506d810a7d12bc9fe8ae947e68f5ff3 100644 (file)
@@ -69,6 +69,7 @@ public:
 
        void add_file_clicked ();
        bool remove_clicked (bool hotkey);
+       void timeline_clicked ();
 
        boost::signals2::signal<void (void)> 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 ();