Fix place selecton on LDS ords

svn: r6273
This commit is contained in:
Don Allingham 2006-04-05 21:30:27 +00:00
parent a817cb4a3d
commit ac9501eed4
4 changed files with 213 additions and 195 deletions

View File

@ -1,4 +1,7 @@
2006-04-05 Don Allingham <don@gramps-project.org> 2006-04-05 Don Allingham <don@gramps-project.org>
* src/Editors/_EditLdsOrd.py: save place information
* src/GrampsWidgets.py: select default value in menu
* src/BaseDoc.py: pylint
* src/DisplayTabs.py: handle temple not set for LdsOrd * src/DisplayTabs.py: handle temple not set for LdsOrd
* src/RelLib/_LdsOrd.py: unserialize returns self * src/RelLib/_LdsOrd.py: unserialize returns self
* src/RelLib/_LdsOrdBase.py: variable name change * src/RelLib/_LdsOrdBase.py: variable name change

View File

@ -248,7 +248,8 @@ class FontStyle:
self.color = (0, 0, 0) self.color = (0, 0, 0)
self.under = 0 self.under = 0
def set(self,face=None,size=None,italic=None,bold=None,underline=None,color=None): def set(self, face=None, size=None, italic=None, bold=None,
underline=None, color=None):
""" """
Sets font characteristics. Sets font characteristics.
@ -378,14 +379,14 @@ class TableStyle:
""" """
return self.columns return self.columns
def set_column_widths(self, list): def set_column_widths(self, clist):
""" """
Sets the width of all the columns at once, taking the percentages Sets the width of all the columns at once, taking the percentages
from the passed list. from the passed list.
""" """
self.columns = len(list) self.columns = len(clist)
for i in range(self.columns): for i in range(self.columns):
self.colwid[i] = list[i] self.colwid[i] = clist[i]
def set_column_width(self, index, width): def set_column_width(self, index, width):
""" """
@ -558,8 +559,8 @@ class ParagraphStyle:
def set(self, rmargin=None, lmargin=None, first_indent=None, def set(self, rmargin=None, lmargin=None, first_indent=None,
tmargin=None, bmargin=None, align=None, tmargin=None, bmargin=None, align=None,
tborder=None,bborder=None,rborder=None,lborder=None,pad=None, tborder=None, bborder=None, rborder=None, lborder=None,
bgcolor=None,font=None): pad=None, bgcolor=None, font=None):
""" """
Allows the values of the object to be set. Allows the values of the object to be set.
@ -789,7 +790,7 @@ class StyleSheetList:
styles are loaded from a specified XML file if it exists. styles are loaded from a specified XML file if it exists.
""" """
def __init__(self,file,defstyle): def __init__(self, filename, defstyle):
""" """
Creates a new StyleSheetList from the specified default style and Creates a new StyleSheetList from the specified default style and
any other styles that may be defined in the specified file. any other styles that may be defined in the specified file.
@ -799,7 +800,7 @@ class StyleSheetList:
""" """
defstyle.set_name('default') defstyle.set_name('default')
self.map = { "default" : defstyle } self.map = { "default" : defstyle }
self.file = os.path.join(const.home_dir,file) self.file = os.path.join(const.home_dir,filename)
self.parse() self.parse()
def delete_style_sheet(self, name): def delete_style_sheet(self, name):
@ -1121,7 +1122,8 @@ class BaseDoc:
such as OpenOffice, AbiWord, and LaTeX are derived from this base such as OpenOffice, AbiWord, and LaTeX are derived from this base
class, providing a common interface to all document generators. class, providing a common interface to all document generators.
""" """
def __init__(self,styles,paper_type,template,orientation=PAPER_PORTRAIT): def __init__(self, styles, paper_type ,template,
orientation=PAPER_PORTRAIT):
""" """
Creates a BaseDoc instance, which provides a document generation Creates a BaseDoc instance, which provides a document generation
interface. This class should never be instantiated directly, but interface. This class should never be instantiated directly, but

View File

@ -215,6 +215,19 @@ class EditLdsOrd(EditSecondary):
Called when the OK button is pressed. Gets data from the Called when the OK button is pressed. Gets data from the
form and updates the Attribute data structure. form and updates the Attribute data structure.
""" """
(need_new, handle) = self.place_field.get_place_info()
if need_new:
place_obj = RelLib.Place()
place_obj.set_title(handle)
trans = self.db.transaction_begin()
self.db.add_place(place_obj,trans)
self.db.transaction_commit(trans,_("Add Place"))
self.obj.set_place_handle(place_obj.get_handle())
else:
self.obj.set_place_handle(handle)
print self.obj.get_place_handle()
if self.callback: if self.callback:
self.callback(self.obj) self.callback(self.obj)
self.close_window(obj) self.close_window(obj)

View File

@ -404,9 +404,9 @@ class MonitoredStrMenu:
for t, v in mapping: for t, v in mapping:
self.model.append(row=[v]) self.model.append(row=[v])
self.data.append(t) self.data.append(t)
if v == default:
active = index
index += 1 index += 1
if t == default:
active = index
self.obj.set_model(self.model) self.obj.set_model(self.model)
self.obj.set_active(active) self.obj.set_active(active)