1 /* This file is part of Cinaest.
3 * Copyright (C) 2009 Philipp Zabel
5 * Cinaest is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * Cinaest is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with Cinaest. If not, see <http://www.gnu.org/licenses/>.
22 class IMDbDownloadDialog : Note {
25 public IMDbDownloadDialog (Gtk.Window window, bool _plots) {
26 transient_parent = window;
31 note_type = NoteType.PROGRESSBAR;
32 progressbar = new ProgressBar ();
35 public new void run (dynamic DBus.Object server, string mirror) {
38 server.Progress.connect (this.on_progress);
39 server.DescriptionChanged.connect (this.on_description_changed);
40 int flags = IMDbDownloader.MOVIES | IMDbDownloader.GENRES | IMDbDownloader.RATINGS | IMDbDownloader.AKAS;
42 flags |= IMDbDownloader.PLOTS;
44 server.download (mirror, flags);
45 } catch (DBus.Error e) {
46 warning ("Failed to invoke IMDb downloader: %s", e.message);
52 if (res == ResponseType.CANCEL)
56 private void on_progress (dynamic DBus.Object server, int percent) {
58 progressbar.set_fraction (0.01 * percent);
64 private void on_description_changed (dynamic DBus.Object server, string _description) {
65 description = _description;