summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-03-23 00:44:59 +0000
committerCarl Hetherington <cth@carlh.net>2018-03-23 00:44:59 +0000
commite2361edc2fc2c07d6474bf5a7f76dc2a5b55ee81 (patch)
tree9428755e228b97249fa1aab0ec20d08653fb379f
parentf20f6531533c7dda18e4d916feb6a4294702aa76 (diff)
Ctrl-T to open timeline (#1201).
-rw-r--r--ChangeLog3
-rw-r--r--src/tools/dcpomatic.cc16
-rw-r--r--src/wx/content_panel.cc4
-rw-r--r--src/wx/content_panel.h2
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 <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>
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<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;
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<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 ();