projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Trim spaces from entries to certificate download pages.
[dcpomatic.git]
/
src
/
wx
/
dolby_doremi_certificate_panel.cc
diff --git
a/src/wx/dolby_doremi_certificate_panel.cc
b/src/wx/dolby_doremi_certificate_panel.cc
index 68be51a07eac06b52f9b78808c6f680d3a4dd76e..7cab6b24b6a87dcfe37dcd920e50a722dd1670aa 100644
(file)
--- a/
src/wx/dolby_doremi_certificate_panel.cc
+++ b/
src/wx/dolby_doremi_certificate_panel.cc
@@
-23,19
+23,19
@@
#include "download_certificate_dialog.h"
#include "wx_util.h"
#include "lib/compose.hpp"
#include "download_certificate_dialog.h"
#include "wx_util.h"
#include "lib/compose.hpp"
-#include "lib/util.h"
-#include "lib/signal_manager.h"
#include "lib/internet.h"
#include "lib/internet.h"
+#include "lib/signal_manager.h"
+#include "lib/util.h"
#include <dcp/raw_convert.h>
#include <curl/curl.h>
#include <zip.h>
#include <dcp/raw_convert.h>
#include <curl/curl.h>
#include <zip.h>
-#include <
iostream
>
+#include <
boost/algorithm/string.hpp
>
-using std::string;
-using std::cout;
+using std::function;
using std::list;
using std::list;
-using boost::function;
+using std::string;
+using namespace boost::algorithm;
using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
@@
-162,7
+162,8
@@
try_ims3000 (list<string>& urls, list<string>& files, string prefix, string seri
void
DolbyDoremiCertificatePanel::do_download ()
{
void
DolbyDoremiCertificatePanel::do_download ()
{
- string const serial = wx_to_std (_serial->GetValue());
+ string serial = wx_to_std(_serial->GetValue());
+ trim(serial);
/* Try dcp2000, imb and ims prefixes (see mantis #375) */
/* Try dcp2000, imb and ims prefixes (see mantis #375) */
@@
-181,6
+182,8
@@
DolbyDoremiCertificatePanel::do_download ()
}
}
}
}
+ list<string> errors;
+
if (starts_with_digit) {
try_dcp2000 (urls, files, prefix, serial);
try_imb (urls, files, prefix, serial);
if (starts_with_digit) {
try_dcp2000 (urls, files, prefix, serial);
try_imb (urls, files, prefix, serial);
@@
-192,14
+195,15
@@
DolbyDoremiCertificatePanel::do_download ()
try_cat745 (urls, files, prefix, serial);
} else if (starting_char == 'F') {
try_cp850 (urls, files, prefix, serial);
try_cat745 (urls, files, prefix, serial);
} else if (starting_char == 'F') {
try_cp850 (urls, files, prefix, serial);
+ } else {
+ errors.push_back(wx_to_std(_("Unrecognised serial number format (does not start with a number, H or F)")));
}
}
- list<string> errors;
bool ok = false;
auto i = urls.begin ();
auto j = files.begin ();
while (!ok && i != urls.end ()) {
bool ok = false;
auto i = urls.begin ();
auto j = files.begin ();
while (!ok && i != urls.end ()) {
- auto error = get_from_zip_url (*i++, *j++, true, true, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1));
+ auto error = get_from_zip_url (*i++, *j++, true, true, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1
, _2
));
if (error) {
errors.push_back (error.get ());
} else {
if (error) {
errors.push_back (error.get ());
} else {