summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-07-07 15:21:19 +0200
committerCarl Hetherington <cth@carlh.net>2022-07-20 10:38:17 +0200
commitf706bbb9afd10472e81a051cd5db601d6404377c (patch)
treee55e0c1c72d71c1eec008f3527757293c942c9b7
parent704bc0f8be05ddca94a3853a6e112f22f8f2df70 (diff)
Basic release notes support (#2282).
-rw-r--r--src/lib/config.cc5
-rw-r--r--src/lib/config.h9
-rw-r--r--src/lib/release_notes.cc55
-rw-r--r--src/lib/release_notes.h26
-rw-r--r--src/lib/wscript1
-rw-r--r--src/tools/dcpomatic.cc9
6 files changed, 105 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index aacc71edf..cb2ec8885 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -193,6 +193,7 @@ Config::set_defaults ()
_default_kdm_type = dcp::Formulation::MODIFIED_TRANSITIONAL_1;
_default_kdm_duration = RoughDuration(1, RoughDuration::Unit::WEEKS);
_auto_crop_threshold = 0.1;
+ _last_release_notes_version = boost::none;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
@@ -593,6 +594,7 @@ try
_default_kdm_duration = RoughDuration(1, RoughDuration::Unit::WEEKS);
}
_auto_crop_threshold = f.optional_number_child<double>("AutoCropThreshold").get_value_or(0.1);
+ _last_release_notes_version = f.optional_string_child("LastReleaseNotesVersion");
_export.read(f.optional_node_child("Export"));
@@ -1034,6 +1036,9 @@ Config::write_config () const
root->add_child("EmailKDMs")->add_child_text(_email_kdms ? "1" : "0");
root->add_child("DefaultKDMType")->add_child_text(dcp::formulation_to_string(_default_kdm_type));
root->add_child("AutoCropThreshold")->add_child_text(raw_convert<string>(_auto_crop_threshold));
+ if (_last_release_notes_version) {
+ root->add_child("LastReleaseNotesVersion")->add_child_text(*_last_release_notes_version);
+ }
_export.write(root->add_child("Export"));
diff --git a/src/lib/config.h b/src/lib/config.h
index f53b8986e..9727bac1a 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -586,6 +586,10 @@ public:
return _auto_crop_threshold;
}
+ boost::optional<std::string> last_release_notes_version () const {
+ return _last_release_notes_version;
+ }
+
/* SET (mostly) */
void set_master_encoding_threads (int n) {
@@ -1122,6 +1126,10 @@ public:
maybe_set (_auto_crop_threshold, threshold, AUTO_CROP_THRESHOLD);
}
+ void set_last_release_notes_version (std::string version) {
+ maybe_set (_last_release_notes_version, version);
+ }
+
ExportConfig& export_config() {
return _export;
}
@@ -1349,6 +1357,7 @@ private:
dcp::Formulation _default_kdm_type;
RoughDuration _default_kdm_duration;
double _auto_crop_threshold;
+ boost::optional<std::string> _last_release_notes_version;
ExportConfig _export;
diff --git a/src/lib/release_notes.cc b/src/lib/release_notes.cc
new file mode 100644
index 000000000..b1eb95257
--- /dev/null
+++ b/src/lib/release_notes.cc
@@ -0,0 +1,55 @@
+/*
+ Copyright (C) 2022 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 "config.h"
+#include "release_notes.h"
+#include "version.h"
+
+#include "i18n.h"
+
+
+using std::string;
+using boost::optional;
+
+
+optional<string>
+find_release_notes()
+{
+ auto last = Config::instance()->last_release_notes_version();
+ auto current = string(dcpomatic_version);
+ if (last && *last == current) {
+ return {};
+ }
+
+ Config::instance()->set_last_release_notes_version(current);
+
+ const string header = String::compose("<h1>DCP-o-matic %1 release notes</h1>", current);
+
+ if (current == "2.16.18") {
+ return header +
+ _("In this version there are changes to the way that subtitles are positioned. "
+ "Positioning should now be more correct, with respect to the standards, but you "
+ "should check any subtitles in your project to make sure that they are placed "
+ "where you want them.");
+ }
+
+ return {};
+}
diff --git a/src/lib/release_notes.h b/src/lib/release_notes.h
new file mode 100644
index 000000000..36f66d257
--- /dev/null
+++ b/src/lib/release_notes.h
@@ -0,0 +1,26 @@
+/*
+ Copyright (C) 2022 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 <boost/optional.hpp>
+#include <string>
+
+
+extern boost::optional<std::string> find_release_notes();
diff --git a/src/lib/wscript b/src/lib/wscript
index 8d3bb8eb5..b566a960c 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -152,6 +152,7 @@ sources = """
ratio.cc
raw_image_proxy.cc
reel_writer.cc
+ release_notes.cc
render_text.cc
resampler.cc
rgba.cc
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index ebcd05a68..6f55b1771 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -78,6 +78,7 @@
#include "lib/kdm_with_metadata.h"
#include "lib/log.h"
#include "lib/make_dcp.h"
+#include "lib/release_notes.h"
#include "lib/screen.h"
#include "lib/send_kdm_email_job.h"
#include "lib/signal_manager.h"
@@ -1686,6 +1687,14 @@ private:
if (Config::instance()->check_for_updates ()) {
UpdateChecker::instance()->run ();
}
+
+ auto release_notes = find_release_notes();
+ if (release_notes) {
+ auto notes = new HTMLDialog(nullptr, _("Release notes"), std_to_wx(*release_notes), true);
+ notes->Centre();
+ notes->ShowModal();
+ notes->Destroy();
+ }
}
catch (exception& e)
{