Inheritance: Gtk.Entry
Example #1
0
            public FramelessEntry(SearchEntry parent) : base()
            {
                this.parent = parent;
                HasFrame    = false;

                layout = new Pango.Layout(PangoContext);
                layout.FontDescription = PangoContext.FontDescription.Copy();

                parent.StyleSet += OnParentStyleSet;
                WidthChars       = 1;
            }
Example #2
0
        public BaseDialog(PlaylistSource queue, string title, WindowConfiguration windowConfig)
            : base(title)
        {
            this.queue = queue;
            VBox.Spacing = 6;

            HBox filter_box = new HBox ();
            filter_box.Spacing = 6;

            Label search_label = new Label ("_Search:");
            filter_box.PackStart (search_label, false, false, 0);

            search_entry = new MuinsheeSearchEntry ();
            search_entry.Show ();
            search_entry.Changed += OnFilterChanged;
            search_entry.Ready = true;
            OnFilterChanged (null, null);
            filter_box.PackStart (search_entry, true, true, 0);

            VBox.PackStart (filter_box, false, false, 0);

            Hyena.Widgets.ScrolledWindow sw = new Hyena.Widgets.ScrolledWindow ();
            sw.Add (GetItemWidget ());
            VBox.PackStart (sw, true, true, 0);

            AddDefaultCloseButton ();

            Button queue_button = new ImageButton (Catalog.GetString ("En_queue"), "gtk-add");
            AddActionWidget (queue_button, Gtk.ResponseType.Apply);

            Button play_button = new ImageButton (Catalog.GetString ("_Play"), "media-playback-start");
            AddButton (play_button, Gtk.ResponseType.Ok, true);

            window_controller = new PersistentWindowController (this, windowConfig, WindowPersistOptions.Size);
            window_controller.Restore ();
            ShowAll ();

            Response += OnResponse;
        }
Example #3
0
            public FramelessEntry(SearchEntry parent) : base()
            {
                this.parent = parent;
                HasFrame = false;

                parent.StyleSet += OnParentStyleSet;
                WidthChars = 1;
            }
Example #4
0
        private Widget BuildCenter ()
        {
            var vbox = new VBox () { Spacing = 2 };

            // Search entry/button
            var search_box = new HBox () { Spacing = 6, BorderWidth = 4 };
            var entry = new SearchEntry () {
                Visible = true,
                EmptyMessage = String.Format (Catalog.GetString ("Search..."))
            };

            source.Properties.Set<SearchEntry> ("Nereid.SearchEntry", entry);

            // Make the search entry text nice and big
            var font = entry.InnerEntry.Style.FontDescription.Copy ();
            font.Size = (int) (font.Size * Pango.Scale.XLarge);
            entry.InnerEntry.ModifyFont (font);
            font.Dispose ();

            var button = new Hyena.Widgets.ImageButton (Catalog.GetString ("_Go"), Stock.Find);
            entry.Activated += (o, a) => { button.Activate (); };
            button.Clicked += (o, a) => source.SetSearch (new SearchDescription (null, entry.Query, IA.Sort.DownloadsDesc, null));

            search_box.PackStart (entry, true, true, 0);
            search_box.PackStart (button, false, false, 0);

            var example_searches = new SearchDescription [] {
                new SearchDescription (Catalog.GetString ("Staff Picks"), "pick:1", IA.Sort.WeekDesc, null),
                new SearchDescription (Catalog.GetString ("Creative Commons"), "license:creativecommons", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("History"), "subject:history", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("Classic Cartoons"), "", IA.Sort.DateCreatedAsc, IA.MediaType.Get ("animationandcartoons")),
                new SearchDescription (Catalog.GetString ("Speeches"), "subject:speeches OR title:speech", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("For Children"), "subject:children", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("Poetry"), "subject:poetry", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("Creator is United States"), "creator:\"United States\"", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("Old Movies"), "", IA.Sort.DateCreatedAsc, IA.MediaType.Get ("moviesandfilms")),
                new SearchDescription (Catalog.GetString ("New From LibriVox"), "publisher:LibriVox", IA.Sort.DateAddedDesc, IA.MediaType.Get ("audio")),
                new SearchDescription (Catalog.GetString ("Old Texts"), "", IA.Sort.DateCreatedAsc, IA.MediaType.Get ("texts")),
                new SearchDescription (Catalog.GetString ("Charlie Chaplin"), "\"Charlie Chaplin\"", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("NASA"), "NASA", IA.Sort.DownloadsDesc, null),
                new SearchDescription (Catalog.GetString ("Library of Congress"), "creator:\"Library of Congress\"", IA.Sort.DownloadsDesc, null)
            };

            var examples = new FlowBox () { Spacing = 0 };
            examples.Add (PaddingBox (new Label () { Markup = "Examples:" }));

            foreach (var search in example_searches) {
                var this_search = search;
                var link = CreateLink (search.Name, search.Query);
                link.TooltipText = search.Query;
                link.Clicked += (o, a) => source.SetSearch (this_search);
                examples.Add (link);
            }

            // Intro text and visit button
            var intro_label = new Hyena.Widgets.WrapLabel () {
                Markup = Catalog.GetString ("The Internet Archive, a 501(c)(3) non-profit, is building a digital library of Internet sites and other cultural artifacts in digital form. Like a paper library, we provide free access to researchers, historians, scholars, and the general public.")
            };

            var visit_button = new LinkButton ("http://archive.org/", Catalog.GetString ("Visit the Internet Archive online at archive.org"));
            visit_button.Clicked += (o, a) => Banshee.Web.Browser.Open ("http://archive.org/");
            visit_button.Xalign = 0f;
            var visit_box = new HBox ();
            visit_box.PackStart (visit_button, false, false, 0);
            visit_box.PackStart (new Label () { Visible = true }, true, true, 0);

            // Packing
            vbox.PackStart (search_box, false, false, 0);
            vbox.PackStart (examples, false, false, 0);
            vbox.PackStart (PaddingBox (new HSeparator ()), false, false, 6);
            vbox.PackStart (PaddingBox (intro_label), false, false, 0);
            vbox.PackStart (visit_box, false, false, 0);

            return vbox;
        }
Example #5
0
        private void BuildSearchEntry ()
        {
            AddSearchFilter (TrackFilterType.None, String.Empty, Catalog.GetString ("Artist, Album, or Title"));
            AddSearchFilter (TrackFilterType.SongName, "title", Catalog.GetString ("Track Title"));
            AddSearchFilter (TrackFilterType.ArtistName, "artist", Catalog.GetString ("Artist Name"));
            AddSearchFilter (TrackFilterType.AlbumArtist, "albumartist", Catalog.GetString ("Album Artist"));
            AddSearchFilter (TrackFilterType.AlbumTitle, "album", Catalog.GetString ("Album Title"));
            AddSearchFilter (TrackFilterType.Composer, "composer", Catalog.GetString ("Composer"));
            AddSearchFilter (TrackFilterType.Genre, "genre", Catalog.GetString ("Genre"));
            AddSearchFilter (TrackFilterType.Year, "year", Catalog.GetString ("Year"));
            AddSearchFilter (TrackFilterType.Comment, "comment", Catalog.GetString ("Comment"));

            search_entry = new SearchEntry ();
            search_entry.SetSizeRequest (260, -1);

            foreach (SearchFilter filter in search_filters.Values) {
                search_entry.AddFilterOption (filter.Id, filter.Title);
                if (filter.Id == (int)TrackFilterType.None) {
                    search_entry.AddFilterSeparator ();
                }
            }

            search_entry.FilterChanged += OnSearchEntryFilterChanged;
            search_entry.ActivateFilter ((int)TrackFilterType.None);

            OnSearchEntryFilterChanged (search_entry, EventArgs.Empty);
        }
Example #6
0
            public FramelessEntry(SearchEntry parent)
                : base()
            {
                this.parent = parent;
                HasFrame = false;

                layout = new Pango.Layout(PangoContext);
                layout.FontDescription = PangoContext.FontDescription.Copy();

                parent.StyleSet += OnParentStyleSet;
                WidthChars = 1;
            }
Example #7
0
        private Widget BuildCenter()
        {
            var vbox = new VBox()
            {
                Spacing = 2
            };

            // Search entry/button
            var search_box = new HBox()
            {
                Spacing = 6, BorderWidth = 4
            };
            var entry = new Banshee.Widgets.SearchEntry()
            {
                Visible      = true,
                EmptyMessage = String.Format(Catalog.GetString("Search..."))
            };

            // Make the search entry text nice and big
            var font = entry.InnerEntry.Style.FontDescription.Copy();

            font.Size = (int)(font.Size * Pango.Scale.XLarge);
            entry.InnerEntry.ModifyFont(font);

            var button = new Hyena.Widgets.ImageButton(Catalog.GetString("_Go"), Stock.Find);

            entry.Activated += (o, a) => { button.Activate(); };
            button.Clicked  += (o, a) => source.SetSearch(new SearchDescription(null, entry.Query, IA.Sort.DownloadsDesc, null));

            search_box.PackStart(entry, true, true, 0);
            search_box.PackStart(button, false, false, 0);

            var example_searches = new SearchDescription [] {
                new SearchDescription(Catalog.GetString("Staff Picks"), "pick:1", IA.Sort.WeekDesc, null),
                new SearchDescription(Catalog.GetString("Creative Commons"), "license:creativecommons", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("History"), "subject:history", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("Classic Cartoons"), "", IA.Sort.DateCreatedAsc, IA.MediaType.Get("animationandcartoons")),
                new SearchDescription(Catalog.GetString("Speeches"), "subject:speeches OR title:speech", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("For Children"), "subject:children", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("Poetry"), "subject:poetry", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("Creator is United States"), "creator:\"United States\"", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("Old Movies"), "", IA.Sort.DateCreatedAsc, IA.MediaType.Get("moviesandfilms")),
                new SearchDescription(Catalog.GetString("New From LibriVox"), "publisher:LibriVox", IA.Sort.DateAddedDesc, IA.MediaType.Get("audio")),
                new SearchDescription(Catalog.GetString("Old Texts"), "", IA.Sort.DateCreatedAsc, IA.MediaType.Get("texts")),
                new SearchDescription(Catalog.GetString("Charlie Chaplin"), "\"Charlie Chaplin\"", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("NASA"), "NASA", IA.Sort.DownloadsDesc, null),
                new SearchDescription(Catalog.GetString("Library of Congress"), "creator:\"Library of Congress\"", IA.Sort.DownloadsDesc, null)
            };

            var examples = new FlowBox()
            {
                Spacing = 0
            };

            examples.Add(PaddingBox(new Label()
            {
                Markup = "Examples:"
            }));

            foreach (var search in example_searches)
            {
                var this_search = search;
                var link        = CreateLink(search.Name, search.Query);
                link.TooltipText = search.Query;
                link.Clicked    += (o, a) => source.SetSearch(this_search);
                examples.Add(link);
            }

            // Intro text and visit button
            var intro_label = new Hyena.Widgets.WrapLabel()
            {
                Markup = Catalog.GetString("The Internet Archive, a 501(c)(3) non-profit, is building a digital library of Internet sites and other cultural artifacts in digital form. Like a paper library, we provide free access to researchers, historians, scholars, and the general public.")
            };

            var visit_button = new LinkButton("http://archive.org/", Catalog.GetString("Visit the Internet Archive online at archive.org"));

            visit_button.Clicked += (o, a) => Banshee.Web.Browser.Open("http://archive.org/");
            visit_button.Xalign   = 0f;
            var visit_box = new HBox();

            visit_box.PackStart(visit_button, false, false, 0);
            visit_box.PackStart(new Label()
            {
                Visible = true
            }, true, true, 0);

            // Packing
            vbox.PackStart(search_box, false, false, 0);
            vbox.PackStart(examples, false, false, 0);
            vbox.PackStart(PaddingBox(new HSeparator()), false, false, 6);
            vbox.PackStart(PaddingBox(intro_label), false, false, 0);
            vbox.PackStart(visit_box, false, false, 0);

            return(vbox);
        }