Delete style implemented

svn: r143
This commit is contained in:
Don Allingham 2001-06-16 03:24:44 +00:00
parent f1cd0be4e9
commit 4e5b4a9ec6
3 changed files with 23 additions and 1 deletions

View File

@ -38,6 +38,7 @@ class StyleListDisplay:
"on_list_select_row" : on_list_select_row, "on_list_select_row" : on_list_select_row,
"on_ok_clicked" : on_ok_clicked, "on_ok_clicked" : on_ok_clicked,
"on_add_clicked" : on_add_clicked, "on_add_clicked" : on_add_clicked,
"on_delete_clicked" : on_delete_clicked,
"on_edit_clicked" : on_edit_clicked "on_edit_clicked" : on_edit_clicked
}) })
self.list = self.top.get_widget("list") self.list = self.top.get_widget("list")
@ -80,7 +81,6 @@ def on_ok_clicked(obj):
top.sheetlist.save() top.sheetlist.save()
utils.destroy_passed_object(obj) utils.destroy_passed_object(obj)
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# #
@ -102,6 +102,19 @@ def on_edit_clicked(obj):
(name,style) = top.list.get_row_data(index) (name,style) = top.list.get_row_data(index)
x = StyleEditor(name,style,top) 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()
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# #

View File

@ -399,6 +399,9 @@ class StyleSheetList:
self.file = os.path.expanduser("~/.gramps/" + file) self.file = os.path.expanduser("~/.gramps/" + file)
self.parse() self.parse()
def delete_style_sheet(self,name):
del self.map[name]
def get_style_sheet(self,name): def get_style_sheet(self,name):
return self.map[name] return self.map[name]

View File

@ -245,6 +245,12 @@
<name>button5</name> <name>button5</name>
<can_default>True</can_default> <can_default>True</can_default>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_delete_clicked</handler>
<object>styles</object>
<last_modification_time>Sat, 16 Jun 2001 03:11:52 GMT</last_modification_time>
</signal>
<label>Delete</label> <label>Delete</label>
<relief>GTK_RELIEF_NORMAL</relief> <relief>GTK_RELIEF_NORMAL</relief>
</widget> </widget>