Beispiel #1
0
        public Actions(HomeSource source)
            : base("InternetArchive")
        {
            Add (
                new ActionEntry ("IaResultPopup", null, null, null, null, (o, a) => {
                    ShowContextMenu ("/IaResultPopup");
                }),
                new ActionEntry ("ViewItemDetails", null, Catalog.GetString ("View Item Details"), null, null, (o, a) => {
                    var item = source.SearchSource.FocusedItem;
                    if (item != null && item.Id != null) {
                        string id = item.Id;
                        var src = new DetailsSource (id, item.Title, item.MediaType);
                        source.AddChildSource (src);
                        Banshee.ServiceStack.ServiceManager.SourceManager.SetActiveSource (src);
                    }
                }),
                new ActionEntry ("OpenItemWebsite", Stock.JumpTo, Catalog.GetString ("Open Webpage"), null, null, (o, a) => {
                    string uri = null;
                    var src = ActiveSource as DetailsSource;
                    if (src != null) {
                        uri = src.Item.Details.WebpageUrl;
                    } else {
                        var item = source.SearchSource.FocusedItem;
                        if (item != null) {
                            uri = item.WebpageUrl;
                        }
                    }

                    if (uri != null) {
                        Banshee.Web.Browser.Open (uri);
                    }
                })
            );

            AddImportant (
                new ActionEntry ("VisitInternetArchive", Stock.JumpTo, Catalog.GetString ("Visit Archive.org"), null, null, (o, a) => {
                    Banshee.Web.Browser.Open ("http://archive.org");
                }),
                new ActionEntry ("SubscribeToIASearch", Stock.Add,
                    Catalog.GetString ("Subscribe"), null,
                    Catalog.GetString ("Subscribe to this search as a podcast"), (o, a) => {
                        var desc = source.SearchSource.SearchDescription;
                        var podcast = new Hyena.Json.JsonObject ();
                        podcast["uri"] = source.SearchSource.Search.RssUrl;
                        podcast["name"] = String.Format (Catalog.GetString ("Internet Archive: {0}"), desc.Name ?? desc.Query);
                        Log.DebugFormat ("InternetArchive: subscribing to search: {0} ({1})", podcast["name"], podcast["uri"]);

                        ServiceManager.Get<DBusCommandService> ().PushArgument ("podcast", podcast.ToString ());
                    }
                )
            );

            AddUiFromFile ("GlobalUI.xml");

            Register ();
        }
Beispiel #2
0
        public HomeView (HomeSource source)
        {
            this.source = source;

            //var sw = new Gtk.ScrolledWindow ();
            //sw.BorderWidth = 4;
            //sw.AddWithViewport (Build ());

            var frame = new Hyena.Widgets.RoundedFrame ();
            frame.Child = Build ();

            PackStart (frame, true, true, 0);
            ShowAll ();
        }
Beispiel #3
0
        public Actions(HomeSource source) : base("InternetArchive")
        {
            Add(
                new ActionEntry("IaResultPopup", null, null, null, null, (o, a) => {
                ShowContextMenu("/IaResultPopup");
            }),
                new ActionEntry("ViewItemDetails", null, Catalog.GetString("View Item Details"), null, null, (o, a) => {
                var item = source.SearchSource.FocusedItem;
                if (item != null && item.Id != null)
                {
                    string id = item.Id;
                    var src   = new DetailsSource(id, item.Title, item.MediaType);
                    source.AddChildSource(src);
                    Banshee.ServiceStack.ServiceManager.SourceManager.SetActiveSource(src);
                }
            }),
                new ActionEntry("OpenItemWebsite", Stock.JumpTo, Catalog.GetString("Open Webpage"), null, null, (o, a) => {
                string uri = null;
                var src    = ActiveSource as DetailsSource;
                if (src != null)
                {
                    uri = src.Item.Details.WebpageUrl;
                }
                else
                {
                    var item = source.SearchSource.FocusedItem;
                    if (item != null)
                    {
                        uri = item.WebpageUrl;
                    }
                }

                if (uri != null)
                {
                    Banshee.Web.Browser.Open(uri);
                }
            })
                );

            AddImportant(
                new ActionEntry("VisitInternetArchive", Stock.JumpTo, Catalog.GetString("Visit Archive.org"), null, null, (o, a) => {
                Banshee.Web.Browser.Open("http://archive.org");
            })
                );

            AddUiFromFile("GlobalUI.xml");

            Register();
        }
Beispiel #4
0
        public HomeView(HomeSource source)
        {
            this.source = source;

            //var sw = new Gtk.ScrolledWindow ();
            //sw.BorderWidth = 4;
            //sw.AddWithViewport (Build ());

            var frame = new Hyena.Widgets.RoundedFrame();

            frame.Child = Build();

            PackStart(frame, true, true, 0);
            ShowAll();
        }
        public Actions (HomeSource source) : base ("InternetArchive")
        {
            Add (
                new ActionEntry ("IaResultPopup", null, null, null, null, (o, a) => {
                    ShowContextMenu ("/IaResultPopup");
                }),
                new ActionEntry ("ViewItemDetails", null, Catalog.GetString ("View Item Details"), null, null, (o, a) => {
                    var item = source.SearchSource.FocusedItem;
                    if (item != null && item.Id != null) {
                        string id = item.Id;
                        var src = new DetailsSource (id, item.Title, item.MediaType);
                        source.AddChildSource (src);
                        Banshee.ServiceStack.ServiceManager.SourceManager.SetActiveSource (src);
                    }
                }),
                new ActionEntry ("OpenItemWebsite", Stock.JumpTo, Catalog.GetString ("Open Webpage"), null, null, (o, a) => {
                    string uri = null;
                    var src = ActiveSource as DetailsSource;
                    if (src != null) {
                        uri = src.Item.Details.WebpageUrl;
                    } else {
                        var item = source.SearchSource.FocusedItem;
                        if (item != null) {
                            uri = item.WebpageUrl;
                        }
                    }

                    if (uri != null) {
                        Banshee.Web.Browser.Open (uri);
                    }
                })
            );

            AddImportant (
                new ActionEntry ("VisitInternetArchive", Stock.JumpTo, Catalog.GetString ("Visit Archive.org"), null, null, (o, a) => {
                    Banshee.Web.Browser.Open ("http://archive.org");
                })
            );

            AddUiFromFile ("GlobalUI.xml");

            Register ();
        }
Beispiel #6
0
 public void ResetSource()
 {
     source = null;
 }
Beispiel #7
0
 public bool SetSource(ISource source)
 {
     this.source = source as HomeSource;
     return(this.source != null);
 }
Beispiel #8
0
 public void ResetSource ()
 {
     source = null;
 }
Beispiel #9
0
 public bool SetSource (ISource source)
 {
     this.source = source as HomeSource;
     return this.source != null;
 }
Beispiel #10
0
        public Actions(HomeSource source) : base("InternetArchive")
        {
            Add(
                new ActionEntry("IaResultPopup", null, null, null, null, (o, a) => {
                ShowContextMenu("/IaResultPopup");
            }),
                new ActionEntry("ViewItemDetails", null, Catalog.GetString("View Item Details"), null, null, (o, a) => {
                var item = source.SearchSource.FocusedItem;
                if (item != null && item.Id != null)
                {
                    string id = item.Id;
                    var src   = new DetailsSource(id, item.Title, item.MediaType);
                    source.AddChildSource(src);
                    Banshee.ServiceStack.ServiceManager.SourceManager.SetActiveSource(src);
                }
            }),
                new ActionEntry("OpenItemWebsite", Stock.JumpTo, Catalog.GetString("Open Webpage"), null, null, (o, a) => {
                string uri = null;
                var src    = ActiveSource as DetailsSource;
                if (src != null)
                {
                    uri = src.Item.Details.WebpageUrl;
                }
                else
                {
                    var item = source.SearchSource.FocusedItem;
                    if (item != null)
                    {
                        uri = item.WebpageUrl;
                    }
                }

                if (uri != null)
                {
                    Banshee.Web.Browser.Open(uri);
                }
            })
                );

            AddImportant(
                new ActionEntry("VisitInternetArchive", Stock.JumpTo, Catalog.GetString("Visit Archive.org"), null, null, (o, a) => {
                Banshee.Web.Browser.Open("http://archive.org");
            }),
                new ActionEntry("SubscribeToIASearch", Stock.Add,
                                Catalog.GetString("Subscribe"), null,
                                Catalog.GetString("Subscribe to this search as a podcast"), (o, a) => {
                var desc        = source.SearchSource.SearchDescription;
                var podcast     = new Hyena.Json.JsonObject();
                podcast["uri"]  = source.SearchSource.Search.RssUrl;
                podcast["name"] = String.Format(Catalog.GetString("Internet Archive: {0}"), desc.Name ?? desc.Query);
                Log.DebugFormat("InternetArchive: subscribing to search: {0} ({1})", podcast["name"], podcast["uri"]);

                ServiceManager.Get <DBusCommandService> ().PushArgument("podcast", podcast.ToString());
            }
                                )
                );

            AddUiFromFile("GlobalUI.xml");

            Register();
        }