* src/TextDoc.py: Added name property to style sheets

* src/StyleEditor.py: Add name property to edited style sheets
* src/RelLib.py: Fix for witness event under ZODB
* src/docgen/OpenDrawDoc.py: change name to OpenOffice.org
* src/docgen/OpenOfficeDoc.py: change name to OpenOffice.org


svn: r1677
This commit is contained in:
Don Allingham 2003-06-09 18:04:04 +00:00
parent 17a7288371
commit ea94d9a4fa
5 changed files with 17 additions and 7 deletions

View File

@ -1360,14 +1360,14 @@ class Event(DataObj):
self.description = source.description
self.name = source.name
self.cause = source.cause
if source.witness:
# old ZODB database may not have this element
try:
if source.witness:
self.witness = source.witness[:]
except:
self.witness = None
else:
self.witness = None
except:
self.witness = None
else:
self.place = None
self.date = None

View File

@ -289,6 +289,7 @@ class StyleEditor:
name = self.top.get_widget("style_name").get_text()
self.save_paragraph(p)
self.style.set_name(name)
self.parent.sheetlist.set_style_sheet(name,self.style)
self.parent.redraw()
Utils.destroy_passed_object(obj)

View File

@ -709,6 +709,7 @@ class StyleSheetList:
file - XML file that contains style definitions
defstyle - default style
"""
defstyle.set_name('default')
self.map = { "default" : defstyle }
self.file = os.path.expanduser("~/.gramps/" + file)
self.parse()
@ -748,6 +749,7 @@ class StyleSheetList:
name - name assocated with the StyleSheet to add or replace.
style - definition of the StyleSheet
"""
style.set_name(name)
if name != "default":
self.map[name] = style
@ -822,11 +824,18 @@ class StyleSheet:
obj, instead of creating an empty StyleSheet
"""
self.style_list = {}
self.name = ""
if obj != None:
for style_name in obj.style_list.keys():
style = obj.style_list[style_name]
self.style_list[style_name] = ParagraphStyle(style)
def set_name(self,name):
self.name = name
def get_name(self):
return self.name
def clear(self):
"Removes all paragraph styles from the StyleSheet"
self.style_list = {}

View File

@ -560,4 +560,4 @@ class OpenDrawDoc(DrawDoc.DrawDoc):
# Register document generator
#
#-------------------------------------------------------------------------
Plugins.register_draw_doc(_("OpenOffice/StarOffice 6"),OpenDrawDoc,1,1,".sxd");
Plugins.register_draw_doc(_("OpenOffice.org/StarOffice 6"),OpenDrawDoc,1,1,".sxd");

View File

@ -595,4 +595,4 @@ class OpenOfficeDoc(TextDoc.TextDoc):
self.f.write('</office:document-meta>\n')
self.f.close()
Plugins.register_text_doc(_("OpenOffice/StarOffice 6"),OpenOfficeDoc,1,1,1,".sxw")
Plugins.register_text_doc(_("OpenOffice.org/StarOffice 6"),OpenOfficeDoc,1,1,1,".sxw")