Skip to content

Commit

Permalink
Made Ctrl+L focus the filter entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Sareyko committed Mar 9, 2008
1 parent 343dab5 commit bf6a9af
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions AlbumThing/albumwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def __init__(self):
self.vbox.pack_start(self.controls, expand=False)
self.vbox.pack_start(self.hpaned)

accel_group = gtk.AccelGroup()
accel_group.connect_group(ord('L'), gtk.gdk.CONTROL_MASK,
gtk.ACCEL_VISIBLE, self.focus_filter_entry)
self.add_accel_group(accel_group)

self.set_default_size(int(self.__at.configuration.get('win', 'width')),
int(self.__at.configuration.get('win', 'height')))

Expand Down Expand Up @@ -114,6 +119,10 @@ def __widgets_set_sensitive(self, sens):
self.controls.set_sensitive(sens)


def focus_filter_entry(self, accel_group, acceleratable, keyval, modifier):
self.album_list.filter_entry.grab_focus()


def destroy(self, widget, data=None):
self.__at.quit()

Expand Down

0 comments on commit bf6a9af

Please sign in to comment.