Add check to key_press_event for keyname returning None
This commit is contained in:
parent
937b53b355
commit
c70c8ea45d
|
@ -525,12 +525,11 @@ class FilesTab(Tab):
|
||||||
|
|
||||||
def _on_key_press_event(self, widget, event):
|
def _on_key_press_event(self, widget, event):
|
||||||
keyname = gtk.gdk.keyval_name(event.keyval)
|
keyname = gtk.gdk.keyval_name(event.keyval)
|
||||||
|
if keyname is not None:
|
||||||
func = getattr(self, 'keypress_' + keyname, None)
|
func = getattr(self, 'keypress_' + keyname, None)
|
||||||
selected_rows = self.listview.get_selection().get_selected_rows()[1]
|
selected_rows = self.listview.get_selection().get_selected_rows()[1]
|
||||||
if func and selected_rows:
|
if func and selected_rows:
|
||||||
return func(event)
|
return func(event)
|
||||||
else:
|
|
||||||
return
|
|
||||||
|
|
||||||
def keypress_Menu(self, event):
|
def keypress_Menu(self, event):
|
||||||
self.file_menu.popup(None, None, None, 3, event.time)
|
self.file_menu.popup(None, None, None, 3, event.time)
|
||||||
|
|
Loading…
Reference in New Issue