[billreminder] Handle deleting categories.



commit c8412a5938a7f01855042180a4162dac7a0c8049
Author: Og B. Maciel <ogmaciel gnome org>
Date:   Sat Nov 14 12:50:23 2009 -0500

    Handle deleting categories.

 src/gui/categoriesdialog.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/gui/categoriesdialog.py b/src/gui/categoriesdialog.py
index b58bfd7..4c7d356 100644
--- a/src/gui/categoriesdialog.py
+++ b/src/gui/categoriesdialog.py
@@ -243,12 +243,15 @@ class CategoriesDialog(gtk.Dialog):
                     parentWindow=self, title=_("Confirmation"))
                 if not confirm:
                     return
-            row = self.actions.delete_category(int(id))
-            self.currentrecord = None
-            self.name_.set_text("")
-            self.color.set_color(gtk.gdk.color_parse("#d3d7cf"))
-            self.savebutton.set_sensitive(False)
-            self.reloadTreeView()
+            try:
+                row = self.actions.delete(self.currentrecord)
+                self.currentrecord = None
+                self.name_.set_text("")
+                self.color.set_color(gtk.gdk.color_parse("#d3d7cf"))
+                self.savebutton.set_sensitive(False)
+                self.reloadTreeView()
+            except Exception, e:
+                print "Failed to delete the selected category with error: %s" % str(e)
 
     def _on_edit(self, widget):
         self.savebutton.set_sensitive(True)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]