| 1 | # Copyright 2008, 2009, 2010, 2011 Kevin Ryde | ||
| 2 | |||
| 3 | # This file is part of Chart. | ||
| 4 | # | ||
| 5 | # Chart is free software; you can redistribute it and/or modify it under the | ||
| 6 | # terms of the GNU General Public License as published by the Free Software | ||
| 7 | # Foundation; either version 3, or (at your option) any later version. | ||
| 8 | # | ||
| 9 | # Chart is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| 10 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| 11 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
| 12 | # details. | ||
| 13 | # | ||
| 14 | # You should have received a copy of the GNU General Public License along | ||
| 15 | # with Chart. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | |||
| 17 | package App::Chart::Gtk2::Job::Download; | ||
| 18 | use strict; | ||
| 19 | use warnings; | ||
| 20 | use Carp; | ||
| 21 | use Gtk2; | ||
| 22 | use List::Util; | ||
| 23 | use Locale::TextDomain ('App-Chart'); | ||
| 24 | |||
| 25 | use App::Chart::Gtk2::Job; | ||
| 26 | use App::Chart::Download; | ||
| 27 | |||
| 28 | use Glib::Object::Subclass | ||
| 29 | 'App::Chart::Gtk2::Job'; | ||
| 30 | |||
| 31 | sub start { | ||
| 32 | my ($class, $what, $when) = @_; | ||
| 33 | my @when; | ||
| 34 | my $name; | ||
| 35 | if ($when) { | ||
| 36 | @when = ('--backto', $when); | ||
| 37 | $name = __x('Download {what} backto {year}', | ||
| 38 | what => $what, | ||
| 39 | year => $when); | ||
| 40 | } else { | ||
| 41 | $name = __x('Download {what}', | ||
| 42 | what => $what); | ||
| 43 | } | ||
| 44 | my $job = $class->SUPER::start (args => [ 'download', @when, $what ], | ||
| 45 | name => $name); | ||
| 46 | return $job; | ||
| 47 | } | ||
| 48 | |||
| 49 | sub type { | ||
| 50 | return __('Download'); | ||
| 51 | } | ||
| 52 | |||
| 53 | 1; | ||
| 54 | __END__ |