From 183b5597f73b85c0d6d29db8f6ed519386d07aa9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 14 Apr 2019 21:07:32 +0100 Subject: Add donation nag after 20 successful DCP encodes. --- src/lib/analytics.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/lib/analytics.cc') diff --git a/src/lib/analytics.cc b/src/lib/analytics.cc index 74c21a29c..0bb8ada8c 100644 --- a/src/lib/analytics.cc +++ b/src/lib/analytics.cc @@ -20,12 +20,15 @@ #include "analytics.h" #include "exceptions.h" +#include "compose.hpp" #include #include #include #include #include +#include "i18n.h" + using std::string; using dcp::raw_convert; using boost::algorithm::trim; @@ -44,6 +47,35 @@ Analytics::successful_dcp_encode () { ++_successful_dcp_encodes; write (); + + if (_successful_dcp_encodes == 20) { + emit ( + boost::bind( + boost::ref(Message), + _("Congratulations!"), + String::compose (_( + "

You have made %1 DCPs with DCP-o-matic!

" + "" + "

Hello. I'm Carl and I'm the " + "developer of DCP-o-matic. I work on it in my spare time (with the help " + "of a fine volunteer team of testers and translators) and I release it " + "as free software." + + "

If you find DCP-o-matic useful, please consider a donation to the " + "project. Financial support will help me to spend more " + "time developing DCP-o-matic and making it better!" + + "

" + + "

Thank you!"), _successful_dcp_encodes + ) + ) + ); + } } void -- cgit v1.2.3