Add GDC and accounts icon.
authorCarl Hetherington <cth@carlh.net>
Wed, 15 Aug 2018 09:51:16 +0000 (10:51 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 15 Aug 2018 09:57:07 +0000 (10:57 +0100)
graphics/src/accounts.svg [new file with mode: 0644]
graphics/update
src/lib/config.cc
src/lib/config.h
src/wx/download_certificate_dialog.cc
src/wx/gdc_certificate_panel.cc [new file with mode: 0644]
src/wx/gdc_certificate_panel.h [new file with mode: 0644]
src/wx/wscript

diff --git a/graphics/src/accounts.svg b/graphics/src/accounts.svg
new file mode 100644 (file)
index 0000000..9200518
--- /dev/null
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg5816"
+   viewBox="0 0 48 48"
+   sodipodi:version="0.32"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:version="0.92.3 (2405546, 2018-03-11)"
+   sodipodi:docname="accounts.svg"
+   version="1.1">
+  <defs
+     id="defs3">
+    <linearGradient
+       id="linearGradient2152">
+      <stop
+         id="stop2154"
+         style="stop-color:#9aa29a"
+         offset="0" />
+      <stop
+         id="stop2156"
+         style="stop-color:#b5beb5"
+         offset="1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3601"
+       y2="613.94"
+       gradientUnits="userSpaceOnUse"
+       x2="385.04001"
+       gradientTransform="matrix(0.04860254,-0.04951283,0.04860254,0.04951283,-9.7664634,27.282)"
+       y1="63.870998"
+       x1="386.39001">
+      <stop
+         id="stop3797"
+         stop-color="#ffe800"
+         offset="0" />
+      <stop
+         id="stop3799"
+         stop-color="#dfb300"
+         offset="1" />
+    </linearGradient>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     bordercolor="#666666"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     pagecolor="#ffffff"
+     inkscape:grid-bbox="true"
+     inkscape:zoom="5.6568542"
+     inkscape:pageshadow="2"
+     showgrid="false"
+     borderopacity="1.0"
+     inkscape:current-layer="layer1"
+     inkscape:cx="-28.201318"
+     inkscape:cy="3.7247721"
+     inkscape:window-width="1366"
+     inkscape:pageopacity="0.0"
+     inkscape:window-height="704"
+     inkscape:document-units="px"
+     inkscape:snap-global="false"
+     inkscape:window-maximized="1" />
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <g
+       id="g1455"
+       transform="translate(0.88388348)">
+      <g
+         id="g1449">
+        <path
+           style="fill:#b3b3b3;stroke:#808080;stroke-width:0.98399496px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="m 29.978487,33.024462 h 16.06181 v -3.097551 c 0,-16.716246 -16.06181,-15.645777 -16.06181,-0.0014 z"
+           id="path280-9-0"
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="ccccc" />
+      </g>
+      <g
+         id="g1446">
+        <ellipse
+           style="opacity:1;vector-effect:none;fill:#b3b3b3;fill-opacity:1;stroke:#808080;stroke-width:0.73654598px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+           id="path282-3-6"
+           cx="38.009392"
+           cy="11.693348"
+           rx="4.6944504"
+           ry="5.4944878" />
+      </g>
+    </g>
+    <g
+       id="g1459">
+      <path
+         sodipodi:nodetypes="ccccc"
+         inkscape:connector-curvature="0"
+         id="path280-9"
+         d="M 1.1590826,33.024462 H 17.220893 v -3.097551 c 0,-16.716246 -16.0618104,-15.645777 -16.0618104,-0.0014 z"
+         style="fill:#b3b3b3;stroke:#808080;stroke-width:0.98399496px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <ellipse
+         ry="5.4944878"
+         rx="4.6944504"
+         cy="11.693348"
+         cx="9.1899881"
+         id="path282-3"
+         style="opacity:1;vector-effect:none;fill:#b3b3b3;fill-opacity:1;stroke:#808080;stroke-width:0.73654598px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    </g>
+    <g
+       id="g1443"
+       transform="translate(-1.0044895)">
+      <path
+         sodipodi:nodetypes="ccccc"
+         inkscape:connector-curvature="0"
+         id="path280"
+         d="m 13.185526,45.935377 h 23.637927 v -5.599269 c 0,-30.217034 -23.637927,-28.282004 -23.637927,-0.0024 z"
+         style="fill:#1a1a1a;stroke:#000000;stroke-width:1.60493279px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <ellipse
+         ry="8.1366978"
+         rx="6.9519358"
+         cy="9.6214514"
+         cx="25.00449"
+         id="path282"
+         style="opacity:1;vector-effect:none;fill:#1a1a1a;fill-opacity:1;stroke:#000000;stroke-width:1.09073901px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    </g>
+  </g>
+  <metadata
+     id="metadata53">
+    <rdf:RDF>
+      <cc:Work>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+        <dc:publisher>
+          <cc:Agent
+             rdf:about="http://openclipart.org/">
+            <dc:title>Openclipart</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:title></dc:title>
+        <dc:date>2010-03-29T08:04:16</dc:date>
+        <dc:description>&quot;E-mail&quot; icon from &lt;a href=&quot;http://tango.freedesktop.org/Tango_Desktop_Project&quot;&gt; Tango Project &lt;/a&gt; 
+\n&lt;br&gt;&lt;br&gt;
+\nSince version 0.8.90 Tango Project icons are Public Domain: &lt;a href=&quot;http://tango.freedesktop.org/Frequently_Asked_Questions#Terms_of_Use.3F&quot;&gt; Tango Project FAQ &lt;/a&gt;</dc:description>
+        <dc:source>https://openclipart.org/detail/35215/tango-internet-mail-by-warszawianka</dc:source>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>warszawianka</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:subject>
+          <rdf:Bag>
+            <rdf:li>email</rdf:li>
+            <rdf:li>envelope</rdf:li>
+            <rdf:li>externalsource</rdf:li>
+            <rdf:li>icon</rdf:li>
+            <rdf:li>letter</rdf:li>
+            <rdf:li>tango</rdf:li>
+          </rdf:Bag>
+        </dc:subject>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+</svg>
index 9815cf9a74ae9222e87399f7b810f2069601f966..51336745e7f7b9250c17ee06819394491e06e170 100755 (executable)
@@ -55,7 +55,7 @@ else
     # OS X preferences icons
     # servers.png does not have an SVG version
     mkdir -p osx/preferences
-    for i in colour_conversions defaults email kdm_email cover_sheet keys tms notifications; do
+    for i in colour_conversions defaults email kdm_email cover_sheet keys tms notifications accounts; do
        $INKSCAPE osx/preferences/$i.png src/$i.svg -w 32 -h 32
     done
 
index 28af9b30334b8ee6caf4c599df20666738d1ec65..76c70ed5dacbf75ca78b66f0077e18af1ba78de8 100644 (file)
@@ -160,6 +160,8 @@ Config::set_defaults ()
        _barco_password = optional<string>();
        _christie_username = optional<string>();
        _christie_password = optional<string>();
+       _gdc_username = optional<string>();
+       _gdc_password = optional<string>();
 
        _allowed_dcp_frame_rates.clear ();
        _allowed_dcp_frame_rates.push_back (24);
@@ -471,6 +473,8 @@ try
        _barco_password = f.optional_string_child("BarcoPassword");
        _christie_username = f.optional_string_child("ChristieUsername");
        _christie_password = f.optional_string_child("ChristiePassword");
+       _gdc_username = f.optional_string_child("GDCUsername");
+       _gdc_password = f.optional_string_child("GDCPassword");
 
        /* Replace any cinemas from config.xml with those from the configured file */
        if (boost::filesystem::exists (_cinemas_file)) {
@@ -829,6 +833,13 @@ Config::write_config () const
                root->add_child("ChristiePassword")->add_child_text(*_christie_password);
        }
 
+       if (_gdc_username) {
+               root->add_child("GDCUsername")->add_child_text(*_gdc_username);
+       }
+       if (_gdc_password) {
+               root->add_child("GDCPassword")->add_child_text(*_gdc_password);
+       }
+
        try {
                doc.write_to_file_formatted(config_file().string());
        } catch (xmlpp::exception& e) {
index b710f537dd15a962451d9bb0772da5d7dc6f70a0..0be3b20b9740c2e435c2adf986bb7f2545812ef4 100644 (file)
@@ -439,6 +439,14 @@ public:
                return _christie_password;
        }
 
+       boost::optional<std::string> gdc_username () const {
+               return _gdc_username;
+       }
+
+       boost::optional<std::string> gdc_password () const {
+               return _gdc_password;
+       }
+
        /* SET (mostly) */
 
        void set_master_encoding_threads (int n) {
@@ -817,6 +825,22 @@ public:
                maybe_set (_christie_password, boost::optional<std::string>());
        }
 
+       void set_gdc_username (std::string u) {
+               maybe_set (_gdc_username, u);
+       }
+
+       void unset_gdc_username () {
+               maybe_set (_gdc_username, boost::optional<std::string>());
+       }
+
+       void set_gdc_password (std::string p) {
+               maybe_set (_gdc_password, p);
+       }
+
+       void unset_gdc_password () {
+               maybe_set (_gdc_password, boost::optional<std::string>());
+       }
+
        void changed (Property p = OTHER);
        boost::signals2::signal<void (Property)> Changed;
        /** Emitted if read() failed on an existing Config file.  There is nothing
@@ -996,6 +1020,8 @@ private:
        boost::optional<std::string> _barco_password;
        boost::optional<std::string> _christie_username;
        boost::optional<std::string> _christie_password;
+       boost::optional<std::string> _gdc_username;
+       boost::optional<std::string> _gdc_password;
 
        static int const _current_version;
 
index dfafee36c48a9455b271ea00ca7566cbd007a3ea..a1209700166524051984049ced10917ff475f211 100644 (file)
@@ -21,6 +21,7 @@
 #include "dolby_doremi_certificate_panel.h"
 #include "barco_alchemy_certificate_panel.h"
 #include "christie_certificate_panel.h"
+#include "gdc_certificate_panel.h"
 #include "download_certificate_dialog.h"
 #include "wx_util.h"
 
@@ -47,6 +48,7 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
        _pages.push_back (new DolbyDoremiCertificatePanel (this));
        _pages.push_back (new BarcoAlchemyCertificatePanel (this));
        _pages.push_back (new ChristieCertificatePanel (this));
+       _pages.push_back (new GDCCertificatePanel (this));
 
        BOOST_FOREACH (DownloadCertificatePanel* i, _pages) {
                _notebook->AddPage (i, i->name(), true);
diff --git a/src/wx/gdc_certificate_panel.cc b/src/wx/gdc_certificate_panel.cc
new file mode 100644 (file)
index 0000000..b4352df
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "gdc_certificate_panel.h"
+#include "download_certificate_dialog.h"
+#include "wx_util.h"
+#include "lib/internet.h"
+#include "lib/compose.hpp"
+#include "lib/config.h"
+
+using std::string;
+using boost::optional;
+
+GDCCertificatePanel::GDCCertificatePanel (DownloadCertificateDialog* dialog)
+       : DownloadCertificatePanel (dialog)
+{
+
+}
+
+void
+GDCCertificatePanel::do_download ()
+{
+       Config* config = Config::instance ();
+       if (!config->gdc_username() || !config->gdc_password()) {
+               _dialog->message()->SetLabel(wxT(""));
+               error_dialog (this, _("No GDC username/password configured.  Add your account details to the Accounts page in Preferences."));
+               return;
+       }
+
+       string const url = String::compose(
+               "ftp://%1:%2@ftp.gdc-tech.com/SHA256/A%3",
+               Config::instance()->gdc_username().get(),
+               Config::instance()->gdc_password().get(),
+               serial
+               );
+
+       optional<string> error = get_from_url (url, true, boost::bind (&DownloadCertificatePanel::load, this, _1));
+
+       if (error) {
+               _dialog->message()->SetLabel(wxT(""));
+               error_dialog (this, std_to_wx(*error));
+       } else {
+               _dialog->message()->SetLabel (_("Certificate downloaded"));
+               _dialog->setup_sensitivity ();
+       }
+}
+
+wxString
+GDCCertificatePanel::name () const
+{
+       return _("GDC");
+}
diff --git a/src/wx/gdc_certificate_panel.h b/src/wx/gdc_certificate_panel.h
new file mode 100644 (file)
index 0000000..18a78e5
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "download_certificate_panel.h"
+
+class GDCCertificatePanel : public DownloadCertificatePanel
+{
+public:
+       GDCCertificatePanel (DownloadCertificateDialog* dialog);
+
+       void do_download ();
+       wxString name () const;
+};
index 560bfc1abe271d582f1a6e7fb62da029cf6fa074..d50286bf4cfdfa1e115ec54f364a4c45d1726860 100644 (file)
@@ -68,6 +68,7 @@ sources = """
           font_files_dialog.cc
           full_config_dialog.cc
           gain_calculator_dialog.cc
+          gdc_certificate_panel.cc
           hints_dialog.cc
           job_view.cc
           job_view_dialog.cc