+ icons.set_selection_mode (SelectionMode.MULTIPLE);
+ }
+ }
+
+ private Pango.AttrList get_attributes (Gtk.Window window, string font_name, string color_name) {
+ Pango.AttrList attr_list = new Pango.AttrList ();
+ var style = Gtk.rc_get_style_by_paths (Gtk.Settings.get_default (), font_name, null, typeof (void));
+ if (style != null) {
+ var attr_font_desc = new Pango.AttrFontDesc (style.font_desc.copy ());
+ attr_list.insert ((owned) attr_font_desc);
+ }
+ Gdk.Color color;
+ window.ensure_style ();
+ if (window.style.lookup_color (color_name, out color)) {
+ Pango.Attribute attr_color = Pango.attr_foreground_new (color.red, color.green, color.blue);
+ attr_list.insert ((owned) attr_color);
+ }
+ return attr_list;
+ }
+
+ public void unselect_all () {
+ tree.get_selection ().unselect_all ();
+ icons.unselect_all ();
+ }
+
+ public List<Movie> get_selected_movies () {
+ var movies = new List<Movie> ();
+ List<TreePath> paths;
+
+ if (poster_mode_)
+ paths = icons.get_selected_items ();
+ else
+ paths = tree.get_selection ().get_selected_rows (null);
+
+ // get selected movies from the store
+ foreach (TreePath path in paths) {
+ TreeIter iter;
+
+ if (store.get_iter (out iter, path)) {
+ Movie movie;
+
+ store.get (iter, MovieListStore.Columns.MOVIE, out movie);
+ if (movie != null) {
+ movies.append (movie);
+ }
+ }