Separate readable error from technical detail in some places.
[dcpomatic.git] / src / wx / content_menu.cc
index 42969995643eb2d94ffa9c0066574720e53f063c..2a91831341fc506bbd1ed739febb19db3c02c946 100644 (file)
@@ -143,6 +143,8 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList
                                }
                        } catch (dcp::DCPReadError) {
                                /* The DCP is probably missing */
+                       } catch (dcp::KDMDecryptionError) {
+                               /* We have an incorrect KDM */
                        }
                } else {
                        _kdm->Enable (false);
@@ -300,7 +302,11 @@ ContentMenu::find_missing ()
        list<shared_ptr<Content> > content;
 
        if (r == wxID_OK) {
-               content = content_factory (film, path);
+               if (dc) {
+                       content.push_back (shared_ptr<DCPContent> (new DCPContent (film, path)));
+               } else {
+                       content = content_factory (film, path);
+               }
        }
 
        if (content.empty ()) {
@@ -355,7 +361,7 @@ ContentMenu::maybe_found_missing (weak_ptr<Job> j, weak_ptr<Content> oc, weak_pt
                return;
        }
 
-       old_content->set_path (new_content->path (0));
+       old_content->set_paths (new_content->paths());
 }
 
 void
@@ -371,7 +377,7 @@ ContentMenu::kdm ()
                try {
                        dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
                } catch (exception& e) {
-                       error_dialog (_parent, wxString::Format (_("Could not load KDM (%s)"), e.what ()));
+                       error_dialog (_parent, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
                        d->Destroy ();
                        return;
                }