Playlist editor: update content list when configuration changes.
[dcpomatic.git] / src / tools / dcpomatic_playlist.cc
index 04950028af6dcfaec08a5ed663ebe4fb4f1391eb..6a0281505b793a91799ea5bd9f5c5d35ead9d446 100644 (file)
@@ -36,9 +36,6 @@
 #include <wx/imaglist.h>
 #include <wx/spinctrl.h>
 #include <wx/preferences.h>
-#ifdef __WXOSX__
-#include <ApplicationServices/ApplicationServices.h>
-#endif
 #include <boost/foreach.hpp>
 
 using std::exception;
@@ -52,6 +49,9 @@ using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::bind;
 using boost::dynamic_pointer_cast;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 class ContentDialog : public wxDialog, public ContentStore
 {
@@ -73,6 +73,8 @@ public:
                }
 
                overall_sizer->Layout ();
+
+               _config_changed_connection = Config::instance()->Changed.connect(boost::bind(&ContentView::update, _content_view));
        }
 
        shared_ptr<Content> selected () const
@@ -87,6 +89,7 @@ public:
 
 private:
        ContentView* _content_view;
+       boost::signals2::scoped_connection _config_changed_connection;
 };
 
 
@@ -273,15 +276,8 @@ public:
                wxImageList* images = new wxImageList (16, 16);
                wxIcon tick_icon;
                wxIcon no_tick_icon;
-#ifdef DCPOMATIC_OSX
-               tick_icon.LoadFile ("tick.png", wxBITMAP_TYPE_PNG_RESOURCE);
-               no_tick_icon.LoadFile ("no_tick.png", wxBITMAP_TYPE_PNG_RESOURCE);
-#else
-               boost::filesystem::path tick_path = shared_path() / "tick.png";
-               tick_icon.LoadFile (std_to_wx(tick_path.string()), wxBITMAP_TYPE_PNG);
-               boost::filesystem::path no_tick_path = shared_path() / "no_tick.png";
-               no_tick_icon.LoadFile (std_to_wx(no_tick_path.string()), wxBITMAP_TYPE_PNG);
-#endif
+               tick_icon.LoadFile (bitmap_path("tick"), wxBITMAP_TYPE_PNG);
+               no_tick_icon.LoadFile (bitmap_path("no_tick"), wxBITMAP_TYPE_PNG);
                images->Add (tick_icon);
                images->Add (no_tick_icon);
 
@@ -518,7 +514,7 @@ private:
        {
                optional<boost::filesystem::path> dir = Config::instance()->player_playlist_directory();
                if (!dir) {
-                       error_dialog (this, _("No playlist folder is specified in preferences.  Please set on and then try again."));
+                       error_dialog (this, _("No playlist folder is specified in preferences.  Please set one and then try again."));
                        return;
                }
                playlist->write (*dir / (playlist->id() + ".xml"));
@@ -585,10 +581,8 @@ private:
                unsetenv ("UBUNTU_MENUPROXY");
 #endif
 
-#ifdef __WXOSX__
-               ProcessSerialNumber serial;
-               GetCurrentProcess (&serial);
-               TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+               make_foreground_application ();
 #endif
 
                dcpomatic_setup_path_encoding ();