PATCH: Keyboard navigation features

Bug #906038 reported by Jens Li
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Wishlist
Unassigned

Bug Description

Ticket description
==================

The functionality for navigating the GUI with the keyboard is poor. There should be shotcuts starting, stopping playback, adjusting volume, seeking, giving focus to different GUI parts.

Version: v0.3.2.2
Revision number: 3898

Patch description
=================
Addition of keyboard navigation functionality

Made on revision number: 3898
Installed from repro, branch: lp:exaile
Tested on Ubuntu 11.10

Changes
=======

* Accelerator keys added in .ui files.
For English and Swedish language.

* Switch focus between panels:
focus() method added on Panel class and some subclasses.
Key combos added to switch to the different panels.

* Switch active playlist tab:
Methods added on PlaylistNotebock for this.
Alt+#, to a specific tab
Ctrl+PgUp/Down to next/prev.

* Keyboard shortcuts for seeking in tracks:
Methods added to player/_base.py for logic for this, instead of in gui.
Settings added (in file, not in gui).

* Keyboard volume change:
modify_volume added to player/_base.py

* Keyboard context menu (right click):
Added support to open with menu key, in files panel and playlist.
Still does not work on the playlist name tab, I didnt find a way to do it.

* Handle key actions in files panel on press instead of on release.
(This seems like the reasonably way to do it)

* Play/Pause-toggle key shortcut added. (Ctrl+P)

Notes
=====

I apologise for the size of this patch. It should have been delivered in smaller pieces, but it grew organically in many places at the same time. I unfortunately don't have time right now to take it apart. If you don't want to include everything I can try to take the time to take that away.

I was a little confused about when to add the glib.idle_add(...) calls. I think they are for switching to the GUI thread when handling events generated by other threads. Since my additions are always triggered by keyboard input, they are already on the GUI thread, so I have not used glib.idle_add(...).

There's a hack in ExailePlayer.modify_time to avoid a hang when seeking at the end of a track. Is there a better way to do this?

Related branches

Revision history for this message
Jens Li (lii) wrote :
Jens Li (lii)
summary: - Keyboard navigation features
+ PATCH: Keyboard navigation features
Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

This is a good idea. It's on my list of things to integrate to exaile, I don't think it'll quite work with the current trunk.

Revision history for this message
Jens Li (lii) wrote :

When you feel it is time to integrate it just write a note here and I'll be happy to go through it and adopt it to the current trunk.

Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

I pushed most of the patch (with some changes) in revision r4208. It wasn't immediately clear what you were fixing in the files key search, however. If you can extract that to a separate bug so it can be evaluated on its own, that would be most convenient.

As a sidenote, some of the shortcuts don't seem to work... like Alt-C . I don't know if I really like the idea of the panels taking up shortcuts anyways.. probably should have a more general purpose mechanism to do this.

Changed in exaile:
importance: Undecided → Wishlist
milestone: none → 0.3.3.0
status: New → Fix Committed
Revision history for this message
Jens Li (lii) wrote :

> As a sidenote, some of the shortcuts don't seem to work... like Alt-C .

Hm, weird. It works on the version made on rev 3898. I'll get the latest version and have a look.

> I don't know if I really like the idea of the panels taking up shortcuts

It's not very common feature for panels to have shortcuts, but it's very, very useful. Without it you have to tab around to do differant things in the GUI and it's almost unbearable. With them it's pretty convenient to use Exaile without taking your hands from the keyboard.

Revision history for this message
Jens Li (lii) wrote :

> It wasn't immediately clear what you were fixing in the files key search

If you are referring to these three lines:

- def key_release(self, *e):
+ def search_key_release(self, *e):

- Called when someone releases a key.
+ Called when someone releases a key in the seach field.

- tree.connect('key-release-event', self.on_key_released)
+ tree.connect('key-press-event', self.on_key_press)

It is only a change of name, because the 'key_release' only handles events from the seach widget, and there was likely to create confusion with the 'on_key_released' function which handled events from the panel.

I might have been a bad thing to include this in the patch.

Revision history for this message
Jens Li (lii) wrote :

> As a sidenote, some of the shortcuts don't seem to work... like Alt-C

This shortcut is commented out in xlgui/main.py (line 174), rev 4209, but not so in the patch.

Revision history for this message
Jens Li (lii) wrote :

>> As a sidenote, some of the shortcuts don't seem to work... like Alt-C
>
>This shortcut is commented out in xlgui/main.py (line 174), rev 4209, but not so in the patch.

Oh, you probably were aware of that. I notices it don't work if the like is uncommented.

The reason might be that it conflicts with accelerators defined in po/messages.pot. But Alt-L also has conflicts, but works...

This is always a danger when choosing shortcuts that start with Alt. Especially when there are translations to many languages.

Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.