예제 #1
0
        public SearchSource()
            : base(name, name, 190, "internet-archive-search")
        {
            IA.Search.UserAgent = Banshee.Web.Browser.UserAgent;
            IA.Search.TimeoutMs = 12*1000;

            search = new IA.Search () { NumResults = 100 };

            Properties.SetStringList ("Icon.Name", "search", "gtk-search");

            Properties.SetString ("ActiveSourceUIResource", "SearchSourceActiveUI.xml");
            Properties.SetString ("GtkActionPath", "/IaSearchSourcePopup");

            if (header_widget == null) {
                header_widget = new HeaderFilters (this);
                header_widget.ShowAll ();
                Properties.Set<Gtk.Widget> ("Nereid.SourceContents.HeaderWidget", header_widget);
            }

            Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new Banshee.Sources.Gui.LazyLoadSourceContents<SearchView> (this));
        }
예제 #2
0
        public void ApplyTo(IA.Search search)
        {
            search.Sorts.Clear();

            search.Sorts.Add(Sort);

            // And if the above sort value is the same for two items, sort by creator then by title
            search.Sorts.Add(IA.Sort.CreatorAsc);
            search.Sorts.Add(IA.Sort.TitleAsc);

            string query = MediaType != null?MediaType.ToString() + " AND " : "";

            // Remove medialess 'collection' results
            query += "-mediatype:collection";

            if (!String.IsNullOrEmpty(Query))
            {
                query += String.Format(" AND {0}", Query);
            }

            search.Query = query;
        }
예제 #3
0
        public SearchSource() : base(name, name, 190, "internet-archive-search")
        {
            IA.Search.UserAgent = Banshee.Web.Browser.UserAgent;
            IA.Search.TimeoutMs = 12 * 1000;

            search = new IA.Search()
            {
                NumResults = 100
            };

            Properties.SetStringList("Icon.Name", "search", "gtk-search");

            Properties.SetString("ActiveSourceUIResource", "SearchSourceActiveUI.xml");
            Properties.SetString("GtkActionPath", "/IaSearchSourcePopup");

            if (header_widget == null)
            {
                header_widget = new HeaderFilters(this);
                header_widget.ShowAll();
                Properties.Set <Gtk.Widget> ("Nereid.SourceContents.HeaderWidget", header_widget);
            }

            Properties.Set <Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new Banshee.Sources.Gui.LazyLoadSourceContents <SearchView> (this));
        }