Tidy and fix up the playlist editor menu on macOS.
[dcpomatic.git] / src / tools / dcpomatic_playlist.cc
index e4ad3c6585cf3776dd3e10732537ab630b112640..d092ca5136f68d8e185f7a51ede4f7b9fd30ca55 100644 (file)
@@ -223,13 +223,15 @@ private:
 
                _list->DeleteAllItems ();
                _playlists.clear ();
-               for (auto i: dcp::filesystem::directory_iterator(*path)) {
-                       auto spl = make_shared<SignalSPL>();
-                       try {
-                               spl->read (i, _content_store);
-                               add_playlist_to_model (spl);
-                       } catch (...) {}
-               }
+               try {
+                       for (auto i: dcp::filesystem::directory_iterator(*path)) {
+                               auto spl = make_shared<SignalSPL>();
+                               try {
+                                       spl->read (i, _content_store);
+                                       add_playlist_to_model (spl);
+                               } catch (...) {}
+                       }
+               } catch (...) {}
 
                for (auto i: _playlists) {
                        add_playlist_to_view (i);
@@ -329,16 +331,6 @@ public:
                _list->AppendColumn (_("Type"), wxLIST_FORMAT_LEFT, 100);
                _list->AppendColumn (_("Encrypted"), wxLIST_FORMAT_CENTRE, 90);
 
-               auto images = new wxImageList (16, 16);
-               wxIcon tick_icon;
-               wxIcon no_tick_icon;
-               tick_icon.LoadFile (bitmap_path("tick.png"), wxBITMAP_TYPE_PNG);
-               no_tick_icon.LoadFile (bitmap_path("no_tick.png"), wxBITMAP_TYPE_PNG);
-               images->Add (tick_icon);
-               images->Add (no_tick_icon);
-
-               _list->SetImageList (images, wxIMAGE_LIST_SMALL);
-
                list->Add (_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
 
                auto button_sizer = new wxBoxSizer (wxVERTICAL);
@@ -575,34 +567,32 @@ private:
 
        void setup_menu (wxMenuBar* m)
        {
-               auto file = new wxMenu;
-#ifdef __WXOSX__
-               file->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P"));
-               file->Append (wxID_EXIT, _("&Exit"));
+#ifdef DCPOMATIC_OSX
+               auto help = new wxMenu;
+               /* These just need to be appended somewhere, it seems - they magically
+                * get moved to the right place.
+                */
+               help->Append(wxID_PREFERENCES, _("&Preferences...\tCtrl-,"));
+               help->Append(wxID_EXIT, _("&Exit"));
+               help->Append(wxID_ABOUT, _("About DCP-o-matic"));
+
+               m->Append(help, _("&Help"));
 #else
-               file->Append (wxID_EXIT, _("&Quit"));
-#endif
+               auto file = new wxMenu;
+               file->Append(wxID_EXIT, _("&Quit"));
 
-#ifndef __WXOSX__
                auto edit = new wxMenu;
-               edit->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P"));
-#endif
+               edit->Append(wxID_PREFERENCES, _("&Preferences...\tCtrl-P"));
 
                auto help = new wxMenu;
-#ifdef __WXOSX__
-               help->Append (wxID_ABOUT, _("About DCP-o-matic"));
-#else
-               help->Append (wxID_ABOUT, _("About"));
-#endif
+               help->Append(wxID_ABOUT, _("About"));
 
-               m->Append (file, _("&File"));
-#ifndef __WXOSX__
-               m->Append (edit, _("&Edit"));
+               m->Append(file, _("&File"));
+               m->Append(edit, _("&Edit"));
+               m->Append(help, _("&Help"));
 #endif
-               m->Append (help, _("&Help"));
        }
 
-
        void config_changed ()
        {
                try {