fossfreedom / coverart-browser

Browse your cover-art albums in Rhythmbox v2.96 - 3.0+
http://xpressubuntu.wordpress.com/
GNU General Public License v3.0
74 stars 19 forks source link

RB 2.99 Menu changes #171

Closed fossfreedom closed 11 years ago

fossfreedom commented 11 years ago

Potential impact - need to watch this one:

"I'm going to release a new version of Rhythmbox this weekend. People who watch commits will know that since 2.98 I've converted everything to use GMenu rather than GtkUIManager and GtkAction and friends. This of course has some implications for plugins.

As part of this, the menu structure changed a little. The traditional menu bar is gone, replaced by an app menu (or an app menu button in environments that don't support that). Not all of the menu bar went into the app menu. The 'control' menu was redundant, so it just disappeared (its accelerator keys remain). The 'edit' menu moved into source toolbars. Parts of the 'music' menu went elsewhere too. This of course has some implications for plugins.

Popup menus in the source list also went away, since they were mostly short, redundant, or both, and they're not particularly discoverable. Instead, source-specific actions should go in a source toolbar. A toolbar at the bottom of the source list handles some common actions such as adding a new instance of a source (playlists, network shares etc.), deleting a source (playlists again) or ejecting a device. This of course has some implications for plugins.

Plugins now have two courses of action:

Plugin menu items go in specific places (not just anywhere you like, as with GtkUIManager merges), which you can locate by looking for menu sections with rb-plugin-menu-link attributes. They mostly match the name of the toolbar or popup they're inside. Plugins specify an item id (only used to remove the item later), the item itself as a GMenuItem instance, and the name of the plugin menu to add it to.

Of course, plugins must also create and register any actions they want to expose in menus. They can be added to the application instance (available through g_application_get_default()) or the window, using g_action_map_add_action(). The menu item then refers to the action by name, prefixing it with "app." if added to the application or "win." if added to the window.

Source toolbars can include submenus, which show up as menu buttons, can bind buttons to properties and signals of the source itself, and can link to existing menus, such as the 'edit' menu. Most of this is Rhythmbox specific, using custom GMenu attributes (rb-menu-link, rb-property-bind, rb-signal-bind, rb-plugin-menu-link).

The library source toolbar demonstrates most of these things: https://git.gnome.org/browse/rhythmbox/tree/data/ui/library-toolbar.ui

As always, the in-tree plugins should serve as useful examples for most of this."

fossfreedom commented 11 years ago

Some notes:

  1. shell.props.ui_manager is no longer valid. Thus you cannot create actionsgroups and add this to the UI. This screws up our right-click menu where we create playlists in coverart_browser_source.py and coverart_entry_view.py
  2. in coverart_controllers.py the playlist_manager (line 119) has lost the property display_page_model
  3. rightclick menu now crashes in cover_external_plugins.py - again same issue as 1 - no ui_manager and thus cannot use actiongroups. This screws up all of the integration work this time - all the "supported plugins" also fail to work - @asermax this also includes your plugins sendfirst and lastfmextension
  4. the right-click menu on the source to download all covers is no longer valid
  5. magnatune plugin is perhaps the most useful resource now - dont know when the online documentation is going to be updated.
asermax commented 11 years ago

I don't even know what Rhythmbox's devs are thinking... instead of fixing the massive backlog of bugs they have on bugzilla, they keep making backward incompatible changes :S as far as I know, there wasn't even a deprecation warning, they just rip all those bits without giving it a second thought from one version to another.

Anyway, I don't see why we should adapt to this changes yet. We can make a branch to start looking into this issues, but until 2.99 hits mainstream it would be kinda pointless to concentrate on this.

fossfreedom commented 11 years ago

@asermax - fully agree with you - on everything you said.

The above was just a heads up. I strongly suspect webupd8 will update their PPA for Ubuntu to 2.99. Knowing ubuntu users as I do - they'll be the first to "upgrade" ... and then come calling "blaming" us plugin developers :(

Anyway, I'm not going to worry too much - branch would be advisable. I've no idea how - at the moment - the independent plugin devs are supposed to keep backward compatibility with earlier versions as well as the new distros such ubuntu 13.10 and Fedora 19 in October onwards.

asermax commented 11 years ago

I've no idea how - at the moment - the independent plugin devs are supposed to keep backward compatibility with earlier versions [...]

Hm you're right. I'm still using v2.97 since Debian always takes its time to update stuff (and since testing is freezed right now, it would take more time for updates to keep flowing, unless I start pointing at unstable), so I would like to keep "backporting" new features. In our case, we may have to change the structure of the repository to support this kind of thing. Or (maybe a better solution) keep working as we have been doing but create a couple of classes that take care of abstracting this changes and a factory to detect the current version and return the correct instance to manage this stuff.

fossfreedom commented 11 years ago

For info - Some new docs are becoming available on the python changes required:

l300lvl commented 11 years ago

I only wish I had read this before updating gtsreamer+rhythmbox to work under suse 12.3/g:s 3.8 stable. I totally expected the plugin to just work under 2.99, how foolish of me.

For anyone else trying to do so you have the option of either 2.98+coverart browser OR 2.99 with fixed G:S resident notifications but NO coverart browser.

Oddly enough, there did seem to be a 2.99 release that loaded the browser as expected, but that could be my imagination as I went through a long process of trying different rhythmbox 2.99 releases for my distro along with different gstreamer releases(newer gstreamer fluendo was needed for 2.99, but the older fluendo didn't even work for me on < 2.98 so I never had it installed)

This is very painful, since 2.97-2.98 had broken gnome 3.8 functionality.

fossfreedom commented 11 years ago

@l300lvl - yep - not a lot I can do immediately. Myself and the rest of the external plugin developers only were formally notified a week before RB2.99 release.

I'm looking at the moment on the best way to resolve this - all of the menu stuff will need to be reworked :/

Its more difficult for the external plugin developers because we have to make a conscious decision - either try and keep compatibility with older RB versions which means quite a bit of work ... or just move forward and support RB2.99 users leaving older RB users behind :/

I'm going to try in the next few weeks to do the former rather than the latter.

l300lvl commented 11 years ago

I agree with doing the former, as leaving people behind never sits well with those people, not that it's all about them or anything. But at least we have a choice.

For the time being the functionality of coverart-browser has more advantages over 2.99, so I'm going back to 2.98 or so. At least now I know how to get 2.99 working properly, albeit the fact that it's probably breaking a lot of plugins. I'll probably wait a long time to actually go back to 2.99 until all the plugins work again.

fossfreedom commented 11 years ago

@asermax - one of the things forced upon us is the loss of the right-click menu on a source - as you know we use this for the "Download all covers" menu option.

Thus - in harmonising/backward compatability we either should lose this menu option and depend upon users highlighting all albums and using the right-click Search Covers option - or move this to some other visual "button" on the actual source toolbar.

Any thoughts? Maybe the first button on the toolbar should be a "properties/edit" button which when clicked displays menu options such as "download all covers" - it seems any source that has a menu can either right click within the source or click the "edit" button as per

pic

EDIT:

Notes to myself:

iradio plugin looks like a good source of the way to proceed with this:

 builder = rb_builder_load_plugin_file (plugin, "iradio-popup.ui", NULL);
source->priv->popup = G_MENU_MODEL (gtk_builder_get_object (builder, "iradio-popup"));
menu = gtk_menu_new_from_model (source->priv->popup);
    gtk_menu_attach_to_widget (GTK_MENU (menu), GTK_WIDGET (source), NULL);
    gtk_menu_popup (GTK_MENU (menu),
            NULL,
            NULL,
            NULL,
            NULL,
            3,
            gtk_get_current_event_time ());
asermax commented 11 years ago

I would move it to the preferences window. Is something you would use only once or twice, I don't think it's worth adding an extra button or a menu just for it. If there is some other stuff to add to the menu, then it could work.

fossfreedom commented 11 years ago

I think you are correct - if you struggle hard we could invent possible menu options, such as

  1. Search for All Covers
  2. Export and Embed Covers
  3. Properties - display preferences dialog

Could also invent "Play random album" or similar new functionality.

Anyway - none of the above is urgent enough to warrant a new button at the moment.

I'll have a further think during development of the menu changes for RB2.99

l300lvl commented 11 years ago

I installed from the latest tree and I must say I'm relieved you got it working in 2.99 so fast. I haven't seen any problems but I suspect you probably already know what they are if there are any.

When do you think 0.9 might be released and more specifically when might we see any of the work on album grouping? I was wondering if there might be any info on #103 I'd love to do some testing on the new views..

fossfreedom commented 11 years ago

@l300lvl - hi

the menu rework is still ongoing. Some of it works - so - thanks for the feedback. I'll be working on the external plugin integration this & next week. Hopefully I will complete all of this by the end-of-this month.

milestone 0.9 shows what is the scope and the release date - https://github.com/fossfreedom/coverart-browser/issues/milestones

Stuff is only progressing slowly I'm afraid. Heavy commitments elsewhere and all that.

Obviously - if you are a coder yourself, or know of someone who is interested in this area, stuff would progress much faster :)

fossfreedom commented 11 years ago

@l300lvl - if you have switched back to RB2.99 I would welcome some feedback with regards to the current changes in the "menu" branch.

I've refactored the code and I think this branch is compatible with both RB2.99 and RB2.96-2.98

Some notes:

  1. The only external plugin that is visible on the right-click menu is "send to" if enabled in the plugins menu. As (or if) other plugins [OpenContainingFolder, LastFMExtension - Fingerprinter, FileOrganizer, lLyrics, WikipediaSearch] are converted to RB2.99 then I'll add support. I'm only aware of one other external plugin that has been converted to RB2.99 and that is @asermax "send-first" plugin (I've done this conversion myself here: https://github.com/fossfreedom/send_first).
  2. The original "download all covers" option that was originally available on right-click of the coverart-browser source has been removed. I havent yet replaced that with something else - thus to download all covers you need to select multiple icons and choose "search for covers". You can select all icons by first highlighting one icon and pressing CTRL+A.

to install:

rm -rf ~/.local/share/rhythmbox/plugins/coverart-browser
git clone https://github.com/fossfreedom/coverart-browser.git -b menu
cd coverart-browser
./install.sh
fossfreedom commented 11 years ago

ok - I'm fairly happy with stuff now so I've gone ahead and merged into master.

I've done some testing of the merge and stuff looks like its still hanging together nicely.

I'll continue now working on the master branch for the remaining part of the "menu" work which is what to do with the "download all covers" functionality since this is not really controversial.