No-op; fix GPL address and use the explicit-program-name version.
[dcpomatic.git] / src / lib / send_kdm_email_job.cc
1 /*
2     Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 #include "send_kdm_email_job.h"
22 #include "compose.hpp"
23 #include "film.h"
24 #include "cinema_kdms.h"
25 #include <list>
26
27 #include "i18n.h"
28
29 using std::string;
30 using std::list;
31 using boost::shared_ptr;
32
33 /** @param log Log to write to, or 0 */
34 SendKDMEmailJob::SendKDMEmailJob (
35         string film_name,
36         string cpl_name,
37         boost::posix_time::ptime from,
38         boost::posix_time::ptime to,
39         list<CinemaKDMs> cinema_kdms,
40         shared_ptr<Log> log
41         )
42         : Job (shared_ptr<Film>())
43         , _film_name (film_name)
44         , _cpl_name (cpl_name)
45         , _from (from)
46         , _to (to)
47         , _cinema_kdms (cinema_kdms)
48         , _log (log)
49 {
50
51 }
52
53 string
54 SendKDMEmailJob::name () const
55 {
56         if (_film_name.empty ()) {
57                 return _("Email KDMs");
58         }
59
60         return String::compose (_("Email KDMs for %1"), _film_name);
61 }
62
63 string
64 SendKDMEmailJob::json_name () const
65 {
66         return N_("send_kdm_email");
67 }
68
69 void
70 SendKDMEmailJob::run ()
71 {
72         set_progress_unknown ();
73         CinemaKDMs::email (_film_name, _cpl_name, _cinema_kdms, _from, _to, _log);
74         set_progress (1);
75         set_state (FINISHED_OK);
76 }