GNOME Bugzilla – Bug 326947
Visibility of Rating/Plays/LastPlayed columns are reset to default
Last modified: 2006-02-08 00:16:56 UTC
Visibility of Rating/Plays/LastPlayed columns are reset to default value on relaunch.
Created attachment 57333 [details] [review] patch v1
Patch works fine for me
This patch is missing some logic... rating, play count, and last played columns should never be shown. This patch leaves it up to global column preferences. While there is a bug, this patch does not address all the issues. The patch should check to see if the column is enabled by the user before restoring to a potentially visible state if the active source is not an audio cd.
Created attachment 58682 [details] [review] Correct patch Here is what I believe to be the "correct" patch, if I'm understanding the logic correctly. That is, if you're playing a CD then we can't keep track of the given fields so they should never be displayed, even if the user has their preferences set otherwise.
Oh, I see what's going on. I'll write a patch that is actually correct!
Created attachment 58862 [details] [review] banshee-column-preferences.patch Correctly handle column view preferences. PlayerInterface.cs | 15 +++++++++------ PlaylistColumns.cs | 32 ++++++++++++++++++++++++++++---- PlaylistView.cs | 22 ++++++++++------------ 3 files changed, 47 insertions(+), 22 deletions(-)
Abock asked me to take a look a this, hence I did: This problem is a lot complexer than if looks at first sight. Here's the problem: when calling "playlistView.RatingColumn.Visible = !(source is AudioCdSource)", the user preference is lost, as the Save method (which saves the column preferences) uses Column.Visible. This also means that it's not possible to fix this without doing some major surgery in PlaylistColumns.cs and PlaylistView.cs, patch PlayerInterface alone won't work (atleast not in a pretty manner). To fix this, I've split this data into two booleans: Hidden and VisibilityPreference. The latter obviously represents what the user wants. The first can be set by a source. A column will thus only be shown if VisibilityPreference is true and Hidden is false. Someone might want to check if this actually makes any sense.
Yep, that's what I thought, but unfortunately didn't know enough C#/Gtk# to do it properly. Looking at your patch will be helpful in that regard, at least!
(In reply to comment #8) > Yep, that's what I thought, but unfortunately didn't know enough C#/Gtk# to do > it properly. Looking at your patch will be helpful in that regard, at least! Didn't mean to steal your thunder with this patch though. If you have questions while hacking banshee, feel free to stop by on IRC, there's someone around most of the time and more helping hands means a better* banshee even faster! * not implying that banshee is bad though! ;-)
This seems to work fine. I'm going to commit. Koike, Jesse, Ruben... thanks!