summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-04-14 21:07:32 +0100
committerCarl Hetherington <cth@carlh.net>2019-04-14 21:07:32 +0100
commit183b5597f73b85c0d6d29db8f6ed519386d07aa9 (patch)
tree65e865ac842b9241377af62a263a7fa5eb0d1e55 /src/tools
parent985e727e001e1a92ae035364a9cbf1ff99522ff1 (diff)
Add donation nag after 20 successful DCP encodes.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 1db6b2d0f..cd21d8080 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -46,10 +46,12 @@
#include "wx/export_dialog.h"
#include "wx/paste_dialog.h"
#include "wx/focus_manager.h"
+#include "wx/html_dialog.h"
#include "wx/initial_setup_dialog.h"
#include "wx/send_i18n_dialog.h"
#include "wx/i18n_hook.h"
#include "lib/film.h"
+#include "lib/analytics.h"
#include "lib/emailer.h"
#include "lib/config.h"
#include "lib/util.h"
@@ -87,6 +89,7 @@
#include <wx/cmdline.h>
#include <wx/preferences.h>
#include <wx/splash.h>
+#include <wx/wxhtml.h>
#ifdef __WXMSW__
#include <shellapi.h>
#endif
@@ -290,6 +293,8 @@ public:
_config_changed_connection = Config::instance()->Changed.connect (boost::bind (&DOMFrame::config_changed, this, _1));
config_changed (Config::OTHER);
+ _analytics_message_connection = Analytics::instance()->Message.connect(boost::bind(&DOMFrame::analytics_message, this, _1, _2));
+
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_new, this), ID_file_new);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_open, this), ID_file_open);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_save, this), ID_file_save);
@@ -1105,6 +1110,9 @@ private:
*/
_config_changed_connection.disconnect ();
+ /* Also stop hearing about analytics-related stuff */
+ _analytics_message_connection.disconnect ();
+
ev.Skip ();
}
@@ -1403,6 +1411,13 @@ private:
_film_viewer->seek_by (_film_viewer->one_video_frame(), true);
}
+ void analytics_message (string title, string html)
+ {
+ HTMLDialog* d = new HTMLDialog(this, std_to_wx(title), std_to_wx(html));
+ d->ShowModal();
+ d->Destroy();
+ }
+
FilmEditor* _film_editor;
boost::shared_ptr<FilmViewer> _film_viewer;
StandardControls* _controls;
@@ -1418,6 +1433,7 @@ private:
int _history_position;
wxMenuItem* _history_separator;
boost::signals2::scoped_connection _config_changed_connection;
+ boost::signals2::scoped_connection _analytics_message_connection;
bool _update_news_requested;
shared_ptr<Content> _clipboard;
};