From 4e5b4a9ec6accf18ee8d0fd53f8867a8e3e6b3b2 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 16 Jun 2001 03:24:44 +0000 Subject: [PATCH] Delete style implemented svn: r143 --- gramps/src/StyleEditor.py | 15 ++++++++++++++- gramps/src/TextDoc.py | 3 +++ gramps/src/styles.glade | 6 ++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gramps/src/StyleEditor.py b/gramps/src/StyleEditor.py index fb47feae3..e3cedf037 100644 --- a/gramps/src/StyleEditor.py +++ b/gramps/src/StyleEditor.py @@ -38,6 +38,7 @@ class StyleListDisplay: "on_list_select_row" : on_list_select_row, "on_ok_clicked" : on_ok_clicked, "on_add_clicked" : on_add_clicked, + "on_delete_clicked" : on_delete_clicked, "on_edit_clicked" : on_edit_clicked }) self.list = self.top.get_widget("list") @@ -80,7 +81,6 @@ def on_ok_clicked(obj): top.sheetlist.save() utils.destroy_passed_object(obj) - #------------------------------------------------------------------------ # # @@ -102,6 +102,19 @@ def on_edit_clicked(obj): (name,style) = top.list.get_row_data(index) x = StyleEditor(name,style,top) +#------------------------------------------------------------------------ +# +# +# +#------------------------------------------------------------------------ +def on_delete_clicked(obj): + top = obj.get_data("o") + + index = top.list.get_data("i") + (name,style) = top.list.get_row_data(index) + top.sheetlist.delete_style_sheet(name) + top.redraw() + #------------------------------------------------------------------------ # # diff --git a/gramps/src/TextDoc.py b/gramps/src/TextDoc.py index 9a6c8a5d1..903840d1a 100644 --- a/gramps/src/TextDoc.py +++ b/gramps/src/TextDoc.py @@ -399,6 +399,9 @@ class StyleSheetList: self.file = os.path.expanduser("~/.gramps/" + file) self.parse() + def delete_style_sheet(self,name): + del self.map[name] + def get_style_sheet(self,name): return self.map[name] diff --git a/gramps/src/styles.glade b/gramps/src/styles.glade index cede5ec40..49ec522c5 100644 --- a/gramps/src/styles.glade +++ b/gramps/src/styles.glade @@ -245,6 +245,12 @@ button5 True True + + clicked + on_delete_clicked + styles + Sat, 16 Jun 2001 03:11:52 GMT + GTK_RELIEF_NORMAL