Clean up the patch from David Caro

This commit is contained in:
Stephen Boddy 2013-07-16 19:56:14 +02:00
parent 15c92c09a0
commit f4cc83c1e6
1 changed files with 25 additions and 22 deletions

View File

@ -55,7 +55,6 @@ class CustomCommandsMenu(plugin.MenuItem):
for cmd in noord_cmds:
self.cmd_list[len(self.cmd_list)] = cmd
def callback(self, menuitems, menu, terminal):
"""Add our menu items to the menu"""
item = gtk.MenuItem(_('Custom Commands'))
@ -195,10 +194,11 @@ class CustomCommandsMenu(plugin.MenuItem):
button.set_sensitive(False)
ui['button_delete'] = button
hbox.pack_start(button_box)
dbox.show_all()
res = dbox.run()
if res == gtk.RESPONSE_ACCEPT:
self.update_cmd_list(store)
self._save_config()
@ -387,14 +387,17 @@ class CustomCommandsMenu(plugin.MenuItem):
(store, iter) = selection.get_selected()
if iter:
store.remove(iter)
return
def on_edit(self, button, data):
treeview = data['treeview']
selection = treeview.get_selection()
(store, iter) = selection.get_selected()
if not iter:
return
(dialog,enabled,name,command) = self._create_command_dialog(
enabled_var = store.get_value(iter, CC_COL_ENABLED),
name_var = store.get_value(iter, CC_COL_NAME),