3 , _content_file_radio (_content_group)
4 , _content_file_chooser ("Content", Gtk::FILE_CHOOSER_ACTION_OPEN)
5 , _content_file_button (_content_file_chooser)
6 , _content_folder_radio (_content_group)
7 , _content_folder_chooser ("Content", Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)
8 , _content_folder_button (_content_folder_chooser)
10 , _deinterlace ("Deinterlace")
12 _table = manage (new Gtk::Table);
13 table->set_row_spacings (4);
14 table->set_col_spacings (12);
15 main_vbox->pack_start (*table, false, false);
19 table->attach (*left_aligned_label ("Content"), 0, 1, n, n + 1);
20 _content_file_chooser.add_button ("Select", Gtk::RESPONSE_OK);
21 _content_folder_chooser.add_button ("Select", Gtk::RESPONSE_OK);
22 Gtk::HBox* b = Gtk::manage (new Gtk::HBox);
24 _content_file_radio.set_label ("File");
25 b->pack_start (_content_file_radio, false, false);
26 b->pack_start (_content_file_button, true, true);
27 _content_folder_radio.set_label ("Folder");
28 b->pack_start (_content_folder_radio, false, false);
29 b->pack_start (_content_folder_button, true, true);
30 table->attach (*b, 1, 2, n, n + 1);
33 table->attach (*left_aligned_label ("Name"), 0, 1, n, n + 1);
34 table->attach (_name, 1, 2, n, n + 1);
37 table->attach (*left_aligned_label ("Ratio"), 0, 1, n, n + 1);
38 _ratio.append_text ("1.33:1 (4:3)");
39 _ratio.append_text ("1.78:1 (16:9)");
40 _ratio.append_text ("1.85:1 (Flat)");
41 _ratio.append_text ("2.39:1 (Scope)");
42 table->attach (_ratio, 1, 2, n, n + 1);
43 _ratio.set_active_text ("1.85:1 (Flat)");
46 table->attach (_dvd, 0, 2, n, n + 1);
49 table->attach (*left_aligned_label ("DVD title"), 0, 1, n, n + 1);
50 _dvd_title.set_range (1, 64);
51 _dvd_title.set_increments (1, 4);
52 _dvd_title.set_value (1);
53 table->attach (_dvd_title, 1, 2, n, n + 1);
56 table->attach (_deinterlace, 0, 2, n, n + 1);
59 table->attach (*left_aligned_label ("Left Crop"), 0, 1, n, n + 1);
60 _left_crop.set_range (0, 1024);
61 _left_crop.set_increments (1, 64);
62 _left_crop.set_value (0);
63 table->attach (_left_crop, 1, 2, n, n + 1);
66 table->attach (*left_aligned_label ("Right Crop"), 0, 1, n, n + 1);
67 _right_crop.set_range (0, 1024);
68 _right_crop.set_increments (1, 64);
69 _right_crop.set_value (0);
70 table->attach (_right_crop, 1, 2, n, n + 1);
73 table->attach (*left_aligned_label ("Top Crop"), 0, 1, n, n + 1);
74 _top_crop.set_range (0, 1024);
75 _top_crop.set_increments (1, 64);
76 _top_crop.set_value (0);
77 table->attach (_top_crop, 1, 2, n, n + 1);
80 table->attach (*left_aligned_label ("Bottom Crop"), 0, 1, n, n + 1);
81 _bottom_crop.set_range (0, 1024);
82 _bottom_crop.set_increments (1, 64);
83 _bottom_crop.set_value (0);
84 table->attach (_bottom_crop, 1, 2, n, n + 1);
87 table->attach (*left_aligned_label ("Size"), 0, 1, n, n + 1);
88 table->attach (_size, 1, 2, n, n + 1);
91 table->attach (*left_aligned_label ("Length"), 0, 1, n, n + 1);
92 table->attach (_length, 1, 2, n, n + 1);
95 /* We only need to connect to one of the radios in the group */
96 _content_file_radio.signal_toggled().connect (sigc::mem_fun (*this, &FilmView::content_radio_toggled));
97 _content_file_button.signal_file_set().connect (sigc::mem_fun (*this, &FilmView::content_changed));
98 _content_folder_button.signal_file_set().connect (sigc::mem_fun (*this, &FilmView::content_changed));
99 _dvd.signal_toggled().connect (sigc::mem_fun (*this, &FilmView::update_dvd_title_sensitivity));
101 update_content_radio_sensitivity ();
102 update_dvd_title_sensitivity ();
107 FilmView::left_aligned_label (string const & t) const
109 Gtk::Label* l = Gtk::manage (new Gtk::Label (t));
110 l->set_alignment (0, 0.5);
115 FilmView::content_radio_toggled ()
117 update_content_radio_sensitivity ();
122 FilmView::update_content_radio_sensitivity ()
124 _content_file_button.set_sensitive (_content_file_radio.get_active ());
125 _content_folder_button.set_sensitive (_content_folder_radio.get_active ());
129 FilmView::update_dvd_title_sensitivity ()
131 _dvd_title.set_sensitive (_dvd.get_active ());
135 FilmView::content_changed ()
137 cout << "Content changed.\n";
141 FilmView::set_film (Film* f)