Delete style implemented
svn: r143
This commit is contained in:
parent
f1cd0be4e9
commit
4e5b4a9ec6
@ -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()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
|
@ -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]
|
||||
|
||||
|
@ -245,6 +245,12 @@
|
||||
<name>button5</name>
|
||||
<can_default>True</can_default>
|
||||
<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>
|
||||
<relief>GTK_RELIEF_NORMAL</relief>
|
||||
</widget>
|
||||
|
Loading…
Reference in New Issue
Block a user