X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsource-list-window.vala;h=0a44248ad83d0f87c51193f425430dc2280eb3f3;hb=78c931962726c369c51ec1dac623b57647a4227d;hp=2e3eb3b790b723a159c522c4b6f72a4cefb53913;hpb=31be57d9aa82e066d314830924815821c9aa9a13;p=cinaest diff --git a/src/source-list-window.vala b/src/source-list-window.vala index 2e3eb3b..0a44248 100644 --- a/src/source-list-window.vala +++ b/src/source-list-window.vala @@ -20,11 +20,18 @@ using Gtk; using Hildon; public class SourceListWindow : StackableWindow { - SourceListView source_list; + private SourceListView source_list; + private bool start_movies; + private string default_source; construct { set_title ("Cinæst"); + // View menu + var menu = new SourceListMenu (this); + + set_main_menu (menu); + var sources = new List (); source_list = new SourceListView (sources); @@ -34,11 +41,27 @@ public class SourceListWindow : StackableWindow { source_list.source_activated.connect (on_source_activated); + var gc = GConf.Client.get_default (); + try { + start_movies = gc.get_bool ("/apps/cinaest/start_movies"); + default_source = gc.get_string ("/apps/cinaest/default_source"); + } catch (Error e) { + stdout.printf ("Error getting GConf option: %s\n", e.message); + } + show_all (); } public void add_sources (List list) { source_list.add_sources (list); + if (start_movies) { + foreach (MovieSource source in list) { + if (default_source == source.get_name ()) { + var window = new MovieListWindow (source); + break; + } + } + } } private void on_source_activated (MovieSource source) {