From: Carl Hetherington Date: Sat, 2 Sep 2017 22:12:05 +0000 (+0100) Subject: Try to make Cmd+W work on OS X (#934). X-Git-Tag: v2.11.23~21 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=139917b9200bfa336078a00db5bb9a4add30cdcd Try to make Cmd+W work on OS X (#934). --- diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index f90f27c30..a0dde813d 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -314,13 +314,22 @@ public: overall_panel->SetSizer (main_sizer); - wxAcceleratorEntry accel[2]; +#ifdef __WXOSX__ + int accelerators = 3; +#else + int accelerators = 2; +#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); +#ifdef __WXOSX__ + accel[2].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); - wxAcceleratorTable accel_table (2, accel); + wxAcceleratorTable accel_table (accelerators, accel); SetAcceleratorTable (accel_table); + delete[] accel; UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this)); }