Use dcp::filesystem to wrap filesystem calls and fix_long_path
[dcpomatic.git] / src / tools / dcpomatic_playlist.cc
index 175eafac7d1447328d369583581793e917d1a423..e4ad3c6585cf3776dd3e10732537ab630b112640 100644 (file)
 #include "wx/wx_signal_manager.h"
 #include "wx/wx_util.h"
 #include "lib/config.h"
+#include "lib/constants.h"
 #include "lib/cross.h"
 #include "lib/dcp_content.h"
 #include "lib/film.h"
 #include "lib/spl.h"
 #include "lib/spl_entry.h"
-#include "lib/util.h"
+#include <dcp/filesystem.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/imaglist.h>
@@ -90,6 +91,7 @@ public:
 
                overall_sizer->Layout ();
 
+               _content_view->Bind(wxEVT_LIST_ITEM_ACTIVATED, boost::bind(&ContentDialog::EndModal, this, wxID_OK));
                _config_changed_connection = Config::instance()->Changed.connect(boost::bind(&ContentView::update, _content_view));
        }
 
@@ -221,7 +223,7 @@ private:
 
                _list->DeleteAllItems ();
                _playlists.clear ();
-               for (auto i: boost::filesystem::directory_iterator(*path)) {
+               for (auto i: dcp::filesystem::directory_iterator(*path)) {
                        auto spl = make_shared<SignalSPL>();
                        try {
                                spl->read (i, _content_store);
@@ -270,7 +272,7 @@ private:
                        return;
                }
 
-               boost::filesystem::remove(*dir / (_playlists[*index]->id() + ".xml"));
+               dcp::filesystem::remove(*dir / (_playlists[*index]->id() + ".xml"));
                _list->DeleteItem(*index);
                _playlists.erase(_playlists.begin() + *index);
 
@@ -550,9 +552,8 @@ private:
 
        void help_about ()
        {
-               auto d = new AboutDialog (this);
+               auto d = make_wx<AboutDialog>(this);
                d->ShowModal ();
-               d->Destroy ();
        }
 
        void edit_preferences ()
@@ -576,6 +577,7 @@ private:
        {
                auto file = new wxMenu;
 #ifdef __WXOSX__
+               file->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P"));
                file->Append (wxID_EXIT, _("&Exit"));
 #else
                file->Append (wxID_EXIT, _("&Quit"));