Skip to content

Enhancement: Custom icons for genres #151

Closed
jrbastien opened this Issue Jan 29, 2013 · 20 comments

4 participants

@jrbastien

I have music that I have tagged as "Quebecois" (or French Canadian if you prefer) no matter what genre it is exactly. That would be nice if I could use a custom icon for this. I thought it could be possible with the current implementation by simply playing around popups.xml but that did not work.

@hdave
hdave commented Feb 22, 2013

I've thought about this too for my off-the-beaten-path genres. As non-programmers, can we just submit our icons here? What are the size and encoding and/or other requirements?

@fossfreedom
Owner

Icons will need to be 128x128 pixels in a PNG format.

I haven't as yet thought through the design - its likely though that I'll make this both a user orientated configuration and a system orientated configuration - i.e. you should be able to define your own icons and genres and be able to define icons and genres submitted here so that it can be distributed to all users.

Once I've considered this further, I'll drop a comment here inviting both of you to create and submit icons.

Cheers.

@jrbastien

2 considerations:

The custom icon should be tied to a theme. Perhaps the GUI should show a list of defined custom icons when selecting a theme.

The custom genre feature could allow to overwrite a defined genre. For instance if i want to replace the Rock icon by one of my own, I could simply add a custom one and set the genre as Rock.

@fossfreedom fossfreedom was assigned Mar 2, 2013
@fossfreedom
Owner

ok - progress to date -

I've implemented the following so far (not checked in as yet):

  1. User Defineable popups.xml - this file will exist in its own folder (./img/usericons) and is editable by the user.
  2. This popups.xml will have a list of alternative genre names - you can choose between standard genre icons and you can add your own genre icons
  3. each new user defineable genre icon will exist in this folder.
  4. a template directory (./template) will hold the master user popups.xml which is copied to ./img/usericons if the popups.xml file is deleted manually or does not exist on first use of the plugin.
  5. the alternative genre names now take precedent over the standard spritesheet names. Thus you can now override a genre spritesheet name with your own icon.

I'm not going to tie the custom user genre icons to a theme - its an unnecessary complication IMHO - I doubt people will define icons for each custom genre for each theme available.

Still to-do - work out a GUI method to:

  1. list alternative genres,
  2. choose a picture file to copy to ./img/usericons,
  3. edit an existing alternative genre - change its match against default genre names or use a custom icon
  4. add a new alternative genre
  5. delete an alternative genre.
@jrbastien

Thank you for this. When you have a version (even without the GUI), let me know and I will experiment with it.

@fossfreedom
Owner

@asermax

need a bit of inspiration.

I need to send a signal from the coverart-preferences dialog to the genre_controller when the new genre-user-configuration file is amended. Any thoughts how to do this?

I thought that I could create a gsignals on coverart_browser.py which maybe the coverart-controller could connect to ... but how would I emit the signal from the preferences window to the coverart plugin itself?

@asermax
asermax commented Mar 21, 2013

So far I always had problem connecting the preference's window with the plugin they belong to. Idk if that's by design or the libpeas developers didn't take that use case into account :/
That's why I've always relied on the GSettings signals to get configurations to be aplied on the plugin.
I can think of two ways to doing the connection:

  1. Make some component of the plugin (the source, the toolbar, or some other element that can connec to the controller) globally accessible, through a module variable or something alike. I personally am against this approach since it's ugly and is completelly different to most of the way the application manages signals so far.
  2. Use a dummy setting key on GSettings to make use of it's signal. It could be a boolean property which you just would have to toggle whenever you need the signal to be fired and the genre controller to get updated. This is still kinda ugly, but keeps using the same mechanism we've used so far.
@fossfreedom
Owner

cheers - I was originally thinking along the lines covered by your first point, but I take your consistency point on-board. I'll add a notification via GSettings instead.

@fossfreedom
Owner

@jrbastien

hi - this enhancement was more involved than I thought.

It has touched more areas than I was hoping hence the regression potential is much higher :/

There is a new tab in the preferences window where you can now add/delete/modify alternative genre names. You can also load new custom icons in the tab itself.

The implementation is a little changed from what I described above.

Instead, custom icons are stored automatically by the plugin into the folder ~/.cache/rhythmbox/cb_genre
Your alternative genre names are stored in the plugin folder img/usericons in a file called popups.xml

This folder is created automatically the first time you use the preferences window. if you need to cleanup - delete the folder img/usericons as well as ~/.cache/rhythmbox/cb_genre

If you are installing a clean plugin install - remember to save img/usericons/popups.xml in a safe place first - you can copy this folder and file back after a new install.

For the moment the enhancement is in the branch "custom_genre".

I need to go through the changes, add comments/split long lines etc. and myself test more thoroughly.

If you do have some time in the next week or so, feel free to checkout this branch and let me know your thoughts.

Thanks.

@jrbastien

I'm testing the custom_genre branch right now on Ubuntu 12.04 French CDN and don't see this additional tab. The 4 tabs that I have are: General, Cover, Toolbars and Providers. From what I can see it rolled me back to pretty much version 0.7.

I don't see any problem in the terminal. I installed using my usual script:

#!/bin/bash
sudo rm -rf /home/jrbastien/.local/share/rhythmbox/plugins/coverart_browser
cd /home/jrbastien/Téléchargements
rm -rf coverart-browser
git clone https://github.com/fossfreedom/coverart-browser.git -b custom_genre
cd coverart-browser
sh ./install.sh

@fossfreedom
Owner

oops ... one too many _ characters - sorry about that - customgenre NOT custom_genre

#!/bin/bash
sudo rm -rf /home/jrbastien/.local/share/rhythmbox/plugins/coverart_browser
cd /home/jrbastien/Téléchargements
rm -rf coverart-browser
git clone https://github.com/fossfreedom/coverart-browser.git -b customgenre
cd coverart-browser
sh ./install.sh

@jrbastien

OK, I should have figured out myself... I did not expect GIT to not complain about the invalid name and to give me the default branch instead.

Anyway, I now have the additional tab. I must admit that I was at lost at first but I think I'm starting to understand how it works. I loaded 3 times the same icons before realizing that it was added to the mini spritesheet!

So far, I have been able to:

  • load new custom icons
  • delete the "First alternate genre"

I was not able to add an additional alternate genre. If I type the name in the text box and select the custom icon I have loaded, I don't understand how to add it to the list. When I click save, it simply disappears.

I will look at this further this weekend.

@fossfreedom
Owner

We'll that's a design flaw if its not obvious :/

you type the name - select the icon and then click the "apply"/tick button to save.

... but if its "just disappearing" after a save - that's a bug.

Anything reported in the terminal (launch from a terminal "rhythmbox") ?

EDIT:

I've added some labels etc - does this make stuff more clearer?

@jrbastien

Yes, this is much better. I recognize that it is a lot of hard work for a function that is mostly cosmetic. Here are my suggestions/observations/bug reports:

  1. Since it is part of the toolbar look, perhaps these options could be added to the toolbar tab rather than creating a new one?

  2. The load new icon function does not work anymore. It let me navigate to the icon but there is no way to select it.

  3. I'm not sure for this version since I can no longer load icons but the previous version would load the same custom icons multiple time instead of overriding it.

  4. Deleting the First Alternate Genre demo entry removes the Martini icon association to the Lounge genre. After deleting the entry, it only displays the unknown icon for the Lounge genre.

  5. The reason why I could not add a genre the first time I tried was that I used a word with accents (i.e. Québécois). I workaround this by simply adding Quebecois which still maps fine but I we can assume that people using the alternate genre are likely to be people from different languages than English.

  6. As for the GUI, I suggest to re-organize the objects in order of operation:
    -First load new icon
    -Add a new genre or edit an existing one
    -Save the added/edited genre

See proposal on this mockup:

Custom Icons Genre screen

  1. Currently, the "add new alternative genre" button does nothing else than clearing the text box to enter the genre. The save button is effectively the button to add genre. What was the intended behavior?

  2. I would expect that selecting a genre in "Current User-defined genres" list would bring it up to the name box and would let me edit it and save it. Right now, I believe that the only way to do this is to delete the genre first then create a new one with the correction.

@fossfreedom
Owner

@jrbastien

thanks for the feedback - yep - I rather screwed up the last commit you tested - it removed alot of obvious functionality.

ok - fixes done:

  1. I've moved this to the toolbar tab as you requested.
  2. fixed
  3. fixed
  4. try again - suggest remove usericons/popups.xml as well as the folder ~/.cache/rhythmbox/cb_genre
  5. fixed 6 & (1). I've made the add button more obvious - it creates a blank row with a selection highlight to make it more obvious you are adding (2) - fixed - just select the genre and you should be able to edit it.
@jrbastien
  1. Ok.
  2. Ok.
  3. The problem persists. See screenshot below. You will notice 2 Fleurs-de-lys at the end. This is what happens if i load twice the same icon.
  4. I have delete the requested files and folder and I still have the problem. I incorrectly reported the issue the first time. In reality, by default now after a fresh install the lounge genre is unknown.
  5. Ok
  6. The load new icon function still appears after editing the name. See screenshot below.
  7. Ok, this is much more obvious.
  8. OK.

Duplicate icons

@fossfreedom
Owner

the "duplicate" icon issue is in-fact the same as the "how to delete an album cover" issue - both use the same rhythmbox database to hold its pictures. Until we figure out the best way to implement the "delete a picture" mechanism that the Rhythmbox developers did not implement, this "fix" will have to wait.

I've moved the load icon above the edit name as requested. Also fixed the "lounge" issue.

BTW - that new icon looks great - that is the Quebecois icon? Nice!

@jrbastien

The duplicate issue may not be an issue finally. Given there is no delete icon function, if you make an enhancement to the icon, this is not a bad thing that you can load it again.

Yes, the lounge issue is fixed and the load icon function now appears prior to the edit name box but unfortunately, the custom icons no longer appears in RB. It just displays the previous icon when switching to the custom genre.

Yes, the Fleur-de-Lys is the Quebecois icon. I know the guy who made your icons so it is very easy for me to draw one that matches the theme :) Someday, I might expand the set by adding some flags of the world.

@jrbastien

That works pretty well now. 2 last observations:

  • The label "Alternative Genres" is slightly offset from the other labels "Position" and "Look & Feel".
  • The "Theme" label and drop down box could be moved further to the right as it seems like a weird long label "Flat button style Icon Theme"
@jrbastien

Everything looks pretty good and is working well. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.