Esempio n. 1
0
        public QueryBox (QueryFieldSet fieldSet, QueryOrder [] orders, QueryLimit [] limits) : base ()
        {
            //this.sorted_fields = fieldSet.Fields;
            this.field_set = fieldSet;
            terms_box = new QueryTermsBox (field_set);
            limit_box = new QueryLimitBox (orders, limits);

            BuildInterface ();
        }
 public SmartPlaylistDefinition (string name, string description, string condition,
     int limit_number, QueryLimit limit, QueryOrder order)
 {
     Name = name;
     Description = description;
     Condition = condition;
     LimitNumber = new IntegerQueryValue ();
     LimitNumber.SetValue (limit_number);
     Limit = limit;
     Order = order;
 }
Esempio n. 3
0
        public QueryLimitBox(QueryOrder [] orders, QueryLimit [] limits)
            : base()
        {
            this.orders = orders;
            this.limits = limits;

            Spacing = 5;

            enabled_checkbox = new CheckButton (Catalog.GetString ("_Limit to"));
            enabled_checkbox.Toggled += OnEnabledToggled;

            count_spin = new SpinButton (0, Double.MaxValue, 1);
            count_spin.Numeric = true;
            count_spin.Digits = 0;
            count_spin.Value = 25;
            count_spin.SetSizeRequest (60, -1);

            limit_combo = new ComboBoxText ();
            foreach (QueryLimit limit in limits) {
                limit_combo.AppendText (limit.Label);
            }

            order_combo = new ComboBoxText ();
            order_combo.RowSeparatorFunc = IsRowSeparator;
            foreach (QueryOrder order in orders) {
                if (order == null) {
                    order_combo.AppendText (String.Empty);
                } else {
                    order_combo.AppendText (order.Label);
                }
            }

            PackStart (enabled_checkbox, false, false, 0);
            PackStart (count_spin, false, false, 0);
            PackStart (limit_combo, false, false, 0);
            PackStart (new Label (Catalog.GetString ("selected by")), false, false, 0);
            PackStart (order_combo, false, false, 0);

            enabled_checkbox.Active = false;
            limit_combo.Active = 0;
            order_combo.Active = 0;

            OnEnabledToggled (null, null);

            ShowAll ();
        }
        // Type Initializer
        static BansheeQuery ()
        {
            // Translators: noun
            BpmField.ShortLabel         = Catalog.GetString ("BPM");
            SkipCountField.ShortLabel   = Catalog.GetString ("Skips");
            PlayCountField.ShortLabel   = Catalog.GetString ("Plays");

            default_sort = String.Format (default_sort_template, "");
            default_sort_by_year = String.Format (default_sort_template, "CoreTracks.Year ASC, ");

            RandomOrder = CreateQueryOrder ("Random", asc, Catalog.GetString ("Random"), null);

            Orders = new QueryOrder [] {
                RandomOrder,
                CreateQueryOrder ("Album",      asc,  Catalog.GetString ("Album"), AlbumField),
                CreateQueryOrder ("Artist",     asc,  Catalog.GetString ("Artist"), ArtistField),
                // Translators: noun
                CreateQueryOrder ("Title",      asc,  Catalog.GetString ("Name"), TitleField),
                CreateQueryOrder ("Genre",      asc,  Catalog.GetString ("Genre"), GenreField),
                null,
                CreateQueryOrder ("Rating",     desc, Catalog.GetString ("Highest Rating"), RatingField),
                CreateQueryOrder ("Rating",     asc,  Catalog.GetString ("Lowest Rating"), RatingField),
                null,
                CreateQueryOrder ("Score",      desc, Catalog.GetString ("Highest Score"), ScoreField),
                CreateQueryOrder ("Score",      asc,  Catalog.GetString ("Lowest Score"), ScoreField),
                null,
                CreateQueryOrder ("PlayCount",  desc, Catalog.GetString ("Most Often Played"), PlayCountField),
                CreateQueryOrder ("PlayCount",  asc,  Catalog.GetString ("Least Often Played"), PlayCountField),
                null,
                CreateQueryOrder ("LastPlayedStamp", desc, Catalog.GetString ("Most Recently Played"), LastPlayedField),
                CreateQueryOrder ("LastPlayedStamp", asc,  Catalog.GetString ("Least Recently Played"), LastPlayedField),
                null,
                CreateQueryOrder ("DateAddedStamp",  desc, Catalog.GetString ("Most Recently Added"), DateAddedField),
                CreateQueryOrder ("DateAddedStamp",  asc,  Catalog.GetString ("Least Recently Added"), DateAddedField)
            };
        }
 public SmartPlaylistDefinition(string name, string description, string condition,
     int limit_number, QueryLimit limit, QueryOrder order)
     : this(name, description, condition, limit_number, limit, order, false)
 {
 }