OSX playlist editor build fix.
[dcpomatic.git] / src / tools / dcpomatic_player.cc
index 1cc53dafba2f6cf9aa95c52e39208f8576dab7dd..a1a5a59eb99db36a5190ff83076268692582bd8f 100644 (file)
@@ -612,7 +612,11 @@ private:
                vector<boost::filesystem::path> history = Config::instance()->player_history ();
                int n = event.GetId() - ID_file_history;
                if (n >= 0 && n < static_cast<int> (history.size ())) {
-                       load_dcp (history[n]);
+                       try {
+                               load_dcp (history[n]);
+                       } catch (exception& e) {
+                               error_dialog (0, std_to_wx(String::compose(wx_to_std(_("Could not load DCP %1.")), history[n])), std_to_wx(e.what()));
+                       }
                }
        }
 
@@ -844,6 +848,8 @@ private:
 
                int pos = _history_position;
 
+               /* Clear out non-existant history items before we re-build the menu */
+               Config::instance()->clean_player_history ();
                vector<boost::filesystem::path> history = Config::instance()->player_history ();
 
                if (!history.empty ()) {
@@ -869,7 +875,7 @@ private:
                        } else {
                                dcpomatic_log.reset (new NullLog());
                        }
-                       dcpomatic_log->set_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
+                       dcpomatic_log->set_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR | LogEntry::TYPE_DEBUG_PLAYER);
                }
        }