Re: [Rhythmbox-devel] UI mock up. No shell headers



On Sat, 2005-11-05 at 12:46 +0100, Martin Jeppesen wrote:
> On 11/5/05, Artem Baguinski <femistofel gmail com> wrote:
> > + you can add smarter sort orders, not just by single column.
> 
> Are you thinking of the bug about the album list sorted alphabetically
> or by year?

In most cases where you want to sort with multiple columns, it should
always do that. For example when you sort by artist, it then sorts by
album within a particular artist, and by track# within an album.

Probably what we should do is make it so when you sort by year, it sorts
by album within a particular year - I've whipped up a quick patch to
make it do that. There is a small caveat in that Rhythmbox doesn't
actually sort by year but by /date/, which could be different for
formats that let you store a day/month as well.


> > > Disadvantages:
> > > * No column titles.
> >
> > + hence can't add context menu for switching the columns on/off
> 
> I wouldn't vote for putting it in the context menu, but why wouldn't
> that be possible?

Presumably if we didn't have column headers you would change it in the
context menu you get when you click inside the entry view. Banshee has a
"visible columns" item in it's context menu which brings up a window.


James "Doc" Livingston
-- 
The human genome is about 3 gigabases long, which boils down to 750
megabytes. Depressingly enough, this is only 2.8 Mozilla browsers." --
Jamie Zawinski
Index: widgets/rb-entry-view.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-entry-view.c,v
retrieving revision 1.106
diff -u -u -r1.106 rb-entry-view.c
--- widgets/rb-entry-view.c	5 Nov 2005 05:03:19 -0000	1.106
+++ widgets/rb-entry-view.c	5 Nov 2005 12:56:30 -0000
@@ -893,6 +893,25 @@
 }
 
 static gint
+rb_entry_view_date_sort_func (RhythmDBEntry *a, RhythmDBEntry *b,
+			      RBEntryView *view)
+{
+	gulong a_val, b_val;
+	gint ret;
+
+	a_val = rhythmdb_entry_get_ulong (a, RHYTHMDB_PROP_DATE);
+	b_val = rhythmdb_entry_get_ulong (b, RHYTHMDB_PROP_DATE);
+
+	ret = (a_val == b_val ? 0 : (a_val > b_val ? 1 : -1));
+	if (a_val > b_val)
+		return 1;
+	else if (a_val < b_val)
+		return -1;
+	else
+		return rb_entry_view_album_sort_func (a, b, view);
+}
+
+static gint
 rb_entry_view_string_sort_func (RhythmDBEntry *a, RhythmDBEntry *b,
 				struct RBEntryViewCellDataFuncData *data)
 {
@@ -1352,7 +1371,7 @@
 		cell_data->propid = propid;
 		cell_data_func = (GtkTreeCellDataFunc) rb_entry_view_year_cell_data_func;
 		sort_data->propid = cell_data->propid;
-		sort_func = (GCompareDataFunc) rb_entry_view_ulong_sort_func;
+		sort_func = (GCompareDataFunc) rb_entry_view_date_sort_func;
 		title = _("_Year");
 		key = "Year";
 		break;

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]