Movie list window: make store private and add source property
authorPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 9 Nov 2009 17:31:26 +0000 (18:31 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 9 Nov 2009 17:46:45 +0000 (18:46 +0100)
The source property modifies the store's source and sets the window title.

src/main.vala
src/movie-list-window.vala

index 60fbfd9..9997eab 100644 (file)
@@ -65,7 +65,7 @@ public class CinaestProgram : Hildon.Program {
                if (plugins != null) {
                        var plugin = plugins.first ().data;
                        if (plugin != null)
-                               window.store.source = plugin.get_sources ().first ().data;
+                               window.source = plugin.get_sources ().first ().data;
                }
                Gtk.main ();
        }
index 3b74235..e0b2940 100644 (file)
@@ -24,7 +24,7 @@ public class MovieListWindow : StackableWindow {
        private Toolbar search_bar;
        private uint source_id;
        private MovieListView movie_list;
-       public MovieListStore store;
+       private MovieListStore store;
        private Label no_movies;
        private bool search_bar_visible;
 
@@ -83,6 +83,11 @@ public class MovieListWindow : StackableWindow {
                movie_list.hide ();
        }
 
+       public MovieSource source {
+               get { return store.source; }
+               set { store.source = value; set_title ("Cinæst: " + value.get_description ()); }
+       }
+
        private void on_close_button_clicked () {
                search_field.set_text ("");
                search_bar_visible = false;