Splash behaviour does not need to be branded after all.
[dcpomatic.git] / src / wx / content_view.cc
index 80256987971e654e6e1bdeb49c193e5cc94de80d..b2d6f86d11f0ed151f74d577ac71f8a0fce1ed5c 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "content_view.h"
 #include "wx_util.h"
+#include "wx_variant.h"
 #include "lib/config.h"
 #include "lib/content_factory.h"
 #include "lib/cross.h"
@@ -28,7 +29,9 @@
 #include "lib/dcpomatic_assert.h"
 #include "lib/examine_content_job.h"
 #include "lib/job_manager.h"
+#include "lib/util.h"
 #include <dcp/exceptions.h>
+#include <dcp/filesystem.h>
 #include <dcp/warnings.h>
 #include <boost/filesystem.hpp>
 #include <boost/optional.hpp>
@@ -80,11 +83,11 @@ ContentView::update ()
        DeleteAllItems ();
        _content.clear ();
        auto dir = Config::instance()->player_content_directory();
-       if (!dir || !boost::filesystem::is_directory(*dir)) {
+       if (!dir || !dcp::filesystem::is_directory(*dir)) {
                dir = home_directory ();
        }
 
-       wxProgressDialog progress (_("DCP-o-matic"), _("Reading content directory"));
+       wxProgressDialog progress(variant::wx::dcpomatic(), _("Reading content directory"));
        auto jm = JobManager::instance ();
 
        list<shared_ptr<ExamineContentJob>> jobs;
@@ -94,12 +97,12 @@ ContentView::update ()
                        progress.Pulse ();
 
                        shared_ptr<Content> content;
-                       if (is_directory(i) && (is_regular_file(i / "ASSETMAP") || is_regular_file(i / "ASSETMAP.xml"))) {
+                       if (is_directory(i) && contains_assetmap(i)) {
                                content = make_shared<DCPContent>(i);
                        } else if (i.path().extension() == ".mp4") {
                                auto all_content = content_factory(i);
                                if (!all_content.empty()) {
-                                       content = all_content.front();
+                                       content = all_content[0];
                                }
                        }
 
@@ -155,7 +158,7 @@ ContentView::add (shared_ptr<Content> content)
        if (dcp && dcp->content_kind()) {
                it.SetId(N);
                it.SetColumn(1);
-               it.SetText(std_to_wx(dcp::content_kind_to_string(*dcp->content_kind())));
+               it.SetText(std_to_wx(dcp->content_kind()->name()));
                SetItem(it);
        }