After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 326947 - Visibility of Rating/Plays/LastPlayed columns are reset to default
Visibility of Rating/Plays/LastPlayed columns are reset to default
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Linux
: Normal minor
: 2.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-01-14 11:19 UTC by Koike Kazuhiko
Modified: 2006-02-08 00:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch v1 (878 bytes, patch)
2006-01-14 11:20 UTC, Koike Kazuhiko
none Details | Review
Correct patch (1.09 KB, patch)
2006-02-04 02:18 UTC, Jesse Farmer
none Details | Review
banshee-column-preferences.patch (7.78 KB, patch)
2006-02-07 14:43 UTC, Ruben Vermeersch
committed Details | Review

Description Koike Kazuhiko 2006-01-14 11:19:52 UTC
Visibility of Rating/Plays/LastPlayed columns are reset to default value
on relaunch.
Comment 1 Koike Kazuhiko 2006-01-14 11:20:43 UTC
Created attachment 57333 [details] [review]
patch v1
Comment 2 Michael Monreal 2006-01-15 12:22:12 UTC
Patch works fine for me
Comment 3 Aaron Bockover 2006-01-15 15:44:52 UTC
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.
Comment 4 Jesse Farmer 2006-02-04 02:18:50 UTC
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.
Comment 5 Jesse Farmer 2006-02-04 02:21:40 UTC
Oh, I see what's going on.  I'll write a patch that is actually correct!
Comment 6 Ruben Vermeersch 2006-02-07 14:43:34 UTC
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(-)
Comment 7 Ruben Vermeersch 2006-02-07 14:53:49 UTC
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.
Comment 8 Jesse Farmer 2006-02-07 14:58:33 UTC
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!
Comment 9 Ruben Vermeersch 2006-02-07 15:09:16 UTC
(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! ;-)

Comment 10 Aaron Bockover 2006-02-08 00:16:56 UTC
This seems to work fine. I'm going to commit. Koike, Jesse, Ruben... thanks!