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 SourceDialog : Gtk.Dialog {
23 List<MovieSource> sources;
25 public SourceDialog (Gtk.Window window) {
26 set_transient_for (window);
27 set_title (_("Select movie source"));
29 var content = (VBox) get_content_area ();
30 content.set_size_request (-1, 5*70);
32 sources = new List<MovieSource> ();
33 foreach (Plugin plugin in CinaestProgram.plugins) {
34 foreach (MovieSource source in plugin.get_sources ()) {
35 sources.append (source);
39 var source_list = new SourceListView (sources, true, window);
40 content.pack_start (source_list, true, true, 0);
42 source_list.source_activated.connect (on_source_activated);
45 public void on_source_activated (MovieSource source) {
46 int n = sources.index (source);
51 public new int run (ref MovieSource source) {
60 source = sources.nth_data (res);