Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / wx / config_dialog.cc
index c18cf3c92eae46e788f573182d3772bbb4d42578..0369070a7c32edd900588ec56a6b5568e775a33b 100644 (file)
@@ -773,8 +773,9 @@ private:
 
                if (d->ShowModal() == wxID_OK) {
                        try {
-                               dcp::Certificate c (dcp::file_to_string (wx_to_std (d->GetPath ())));
-                               if (c.extra_data ()) {
+                               dcp::Certificate c;
+                               string const extra = c.read_string (dcp::file_to_string (wx_to_std (d->GetPath ())));
+                               if (!extra.empty ()) {
                                        message_dialog (
                                                this,
                                                _("This file contains other certificates (or other data) after its first certificate. "
@@ -829,7 +830,7 @@ private:
                if (d->ShowModal () == wxID_OK) {
                        FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "w");
                        if (!f) {
-                               throw OpenFileError (wx_to_std (d->GetPath ()));
+                               throw OpenFileError (wx_to_std (d->GetPath ()), errno, false);
                        }
 
                        string const s = j->certificate (true);
@@ -977,7 +978,7 @@ private:
                if (d->ShowModal () == wxID_OK) {
                        FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "w");
                        if (!f) {
-                               throw OpenFileError (wx_to_std (d->GetPath ()));
+                               throw OpenFileError (wx_to_std (d->GetPath ()), errno, false);
                        }
 
                        string const s = _chain->key().get ();
@@ -1060,7 +1061,7 @@ private:
                if (d->ShowModal () == wxID_OK) {
                        FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "w");
                        if (!f) {
-                               throw OpenFileError (wx_to_std (d->GetPath ()));
+                               throw OpenFileError (wx_to_std (d->GetPath ()), errno, false);
                        }
 
                        string const s = Config::instance()->decryption_chain()->leaf().certificate (true);
@@ -1080,7 +1081,7 @@ private:
                if (d->ShowModal () == wxID_OK) {
                        FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "w");
                        if (!f) {
-                               throw OpenFileError (wx_to_std (d->GetPath ()));
+                               throw OpenFileError (wx_to_std (d->GetPath ()), errno, false);
                        }
 
                        string const s = Config::instance()->decryption_chain()->chain();