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 SettingsDialog : Gtk.Dialog {
23 List<Gtk.Button> buttons;
24 Gtk.Window movie_list_window;
26 public SettingsDialog (Gtk.Window window) {
27 movie_list_window = window;
28 set_transient_for (window);
32 set_title (_("Settings"));
35 if (CinaestProgram.plugins.length () > 5) {
36 vbox = new VBox (true, 0);
38 var pannable = new PannableArea ();
39 pannable.add_with_viewport (vbox);
41 VBox area = (VBox) get_content_area ();
42 area.pack_start (pannable, true, true, 0);
43 area.set_size_request (-1, 5*70);
45 vbox = (VBox) get_content_area ();
48 buttons = new List<Hildon.Button> ();
49 foreach (Plugin plugin in CinaestProgram.plugins) {
50 var button = new Gtk.Button.with_label (plugin.get_name ());
52 Hildon.gtk_widget_set_theme_size (button, SizeType.FINGER_HEIGHT);
53 button.set_alignment(0, 0.5f);
55 vbox.pack_start (button, true, true, 0);
57 button.clicked.connect (on_plugin_settings);
59 buttons.append (button);
63 public void on_plugin_settings (Gtk.Button button) {
64 int n = buttons.index (button);
69 public new int run () {
77 var plugin = CinaestProgram.plugins.nth_data (res);
78 plugin.settings_dialog (movie_list_window);