bld.install_files('${PREFIX}/share/dcpomatic2', 'select.png')
bld.install_files('${PREFIX}/share/dcpomatic2', 'snap.png')
bld.install_files('${PREFIX}/share/dcpomatic2', 'sequence.png')
+ bld.install_files('${PREFIX}/share/dcpomatic2', 'me.jpg')
bld.install_files('${PREFIX}/share/dcpomatic2', 'tick.png')
bld.install_files('${PREFIX}/share/dcpomatic2', 'no_tick.png')
cp $ROOT/32/src/dcpomatic/graphics/select.png "$dest"
cp $ROOT/32/src/dcpomatic/graphics/snap.png "$dest"
cp $ROOT/32/src/dcpomatic/graphics/sequence.png "$dest"
+ cp $ROOT/32/src/dcpomatic/graphics/me.jpg "$dest"
# i18n: DCP-o-matic .mo files
for lang in de_DE es_ES fr_FR it_IT sv_SE nl_NL ru_RU pl_PL da_DK pt_PT pt_BR sk_SK cs_CZ uk_UA zh_CN tr_TR; do
File "%graphics%/select.png"
File "%graphics%/snap.png"
File "%graphics%/sequence.png"
+File "%graphics%/me.jpg"
File "%graphics%/tick.png"
File "%graphics%/no_tick.png"
#include "analytics.h"
#include "exceptions.h"
+#include "compose.hpp"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
+#include "i18n.h"
+
using std::string;
using dcp::raw_convert;
using boost::algorithm::trim;
{
++_successful_dcp_encodes;
write ();
+
+ if (_successful_dcp_encodes == 20) {
+ emit (
+ boost::bind(
+ boost::ref(Message),
+ _("Congratulations!"),
+ String::compose (_(
+ "<h2>You have made %1 DCPs with DCP-o-matic!</h2>"
+ "<img width=\"20%%\" src=\"memory:me.jpg\" align=\"center\">"
+ "<p>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."
+
+ "<p>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!"
+
+ "<p><ul>"
+ "<li><a href=\"https://dcpomatic.com/donate_amount?amount=40\">Go to Paypal to donate £40</a>"
+ "<li><a href=\"https://dcpomatic.com/donate_amount?amount=20\">Go to Paypal to donate £20</a>"
+ "<li><a href=\"https://dcpomatic.com/donate_amount?amount=10\">Go to Paypal to donate £10</a>"
+ "</ul>"
+
+ "<p>Thank you!"), _successful_dcp_encodes
+ )
+ )
+ );
+ }
}
void
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
#include "state.h"
+#include "signaller.h"
+#include <boost/signals2.hpp>
-class Analytics : public State
+class Analytics : public State, public Signaller
{
public:
Analytics ();
void write () const;
void read ();
+ boost::signals2::signal<void (std::string, std::string)> Message;
+
static Analytics* instance ();
private:
*/
+#ifndef DCPOMATIC_STATE_H
+#define DCPOMATIC_STATE_H
+
#include <boost/noncopyable.hpp>
#include <boost/filesystem.hpp>
#include <boost/optional.hpp>
protected:
static boost::filesystem::path path (std::string file, bool create_directories = true);
};
+
+#endif
#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"
#include <wx/cmdline.h>
#include <wx/preferences.h>
#include <wx/splash.h>
+#include <wx/wxhtml.h>
#ifdef __WXMSW__
#include <shellapi.h>
#endif
_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);
*/
_config_changed_connection.disconnect ();
+ /* Also stop hearing about analytics-related stuff */
+ _analytics_message_connection.disconnect ();
+
ev.Skip ();
}
_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;
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;
};
--- /dev/null
+/*
+ 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 "html_dialog.h"
+#include "wx_util.h"
+#include "lib/cross.h"
+#include <boost/filesystem.hpp>
+#include <wx/wxhtml.h>
+#include <wx/fs_mem.h>
+#include <iostream>
+
+HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
+ : wxDialog (parent, wxID_ANY, title)
+{
+ wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+
+ wxFileSystem::AddHandler(new wxMemoryFSHandler);
+
+ /* Add some resources that are used by HTML passed into this dialog */
+ wxMemoryFSHandler::AddFile(
+ "me.jpg",
+ wxBitmap(std_to_wx(boost::filesystem::path(shared_path() / "me.jpg").string()), wxBITMAP_TYPE_JPEG), wxBITMAP_TYPE_JPEG
+ );
+
+ wxHtmlWindow* h = new wxHtmlWindow (this);
+ h->SetPage (html);
+ sizer->Add (h, 1, wxEXPAND | wxALL, 6);
+
+ h->Bind (wxEVT_HTML_LINK_CLICKED, boost::bind(&HTMLDialog::link_clicked, this, _1));
+
+ SetSizer (sizer);
+ sizer->Layout ();
+
+ /* Set width */
+ SetSize (800, -1);
+
+ /* Set height */
+ SetSize (h->GetInternalRepresentation()->GetWidth(), h->GetInternalRepresentation()->GetHeight() + 64);
+}
+
+void
+HTMLDialog::link_clicked (wxHtmlLinkEvent& ev)
+{
+ wxLaunchDefaultBrowser(ev.GetLinkInfo().GetHref());
+}
--- /dev/null
+/*
+ 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 <wx/wx.h>
+
+class wxHtmlLinkEvent;
+
+class HTMLDialog : public wxDialog
+{
+public:
+ HTMLDialog (wxWindow* parent, wxString title, wxString html);
+
+private:
+ void link_clicked (wxHtmlLinkEvent& ev);
+};
gain_calculator_dialog.cc
gdc_certificate_panel.cc
hints_dialog.cc
+ html_dialog.cc
initial_setup_dialog.cc
instant_i18n_dialog.cc
i18n_hook.cc