Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added F2 for editing expenses

  • Loading branch information...
commit f7fe70f02aeb048284ecfba1b4cd63f6be5856a8 1 parent d47d760
@bjornua bjornua authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 beercalc/tabs/expenses/table.py
View
11 beercalc/tabs/expenses/table.py
@@ -56,13 +56,24 @@ def OnEditDoneDesc(self, cell, path, new_text):
def OnFocusIn(self, treeview, event):
self.get_toplevel().acg.connect_group(65535, 0, 0, self.OnPressDelete)
+ self.get_toplevel().acg.connect_group(65471, 0, 0, self.OnPressF2)
def OnFocusOut(self, treeview, event):
acg = self.get_toplevel().acg.disconnect_key(65535,0)
+ acg = self.get_toplevel().acg.disconnect_key(65471,0)
def OnPressDelete(self, *args):
self.remove_selected()
+ def OnPressF2(self, *args):
+ self.edit_selected()
+
+ def edit_selected(self):
+ path, col = self.get_cursor()
+
+ if(path != None):
+ self.set_cursor(path, col, start_editing = True)
+
def remove_selected(self):
store, paths = self.get_selection().get_selected_rows()
references = [gtk.TreeRowReference(store, path) for path in paths]
Please sign in to comment.
Something went wrong with that request. Please try again.