fix marker type, search bar tuple problem

svn: r6622
This commit is contained in:
Don Allingham 2006-05-11 23:05:12 +00:00
parent e70020113b
commit 46068b01c1
5 changed files with 47 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2006-05-11 Don Allingham <don@gramps-project.org>
* src/PageView.py: fix search tuple
* src/GrampsWidgets.py: handle Marker type properly
* src/DataViews/_PersonView.py: fix cache problem
* src/RelLib/_MarkerType.py: handle NONE/CUSTOM conflict
2006-05-11 Alex Roitman <shura@gramps-project.org> 2006-05-11 Alex Roitman <shura@gramps-project.org>
* src/UndoHistory.py: Paint all rows in a selected block; Require * src/UndoHistory.py: Paint all rows in a selected block; Require
exploicit button click on any action. exploicit button click on any action.

View File

@ -462,8 +462,9 @@ class PersonView(PageView.PersonNavView):
def edit(self,obj): def edit(self,obj):
if self.dbstate.active: if self.dbstate.active:
try: try:
EditPerson(self.dbstate, self.uistate, [], handle = self.dbstate.active.handle
self.dbstate.active) person = self.dbstate.db.get_person_from_handle(handle)
EditPerson(self.dbstate, self.uistate, [], person)
except Errors.WindowActiveError: except Errors.WindowActiveError:
pass pass

View File

@ -370,11 +370,12 @@ class MonitoredDataType:
default, default,
additional=custom_values) additional=custom_values)
value = self.sel.get_values() if get_val().is_custom():
self.set_val(self.fix_value(value)) self.obj.set_active(get_val().get_custom())
if val.is_custom():
obj.child.set_text(str(val)) obj.child.set_text(str(val))
else:
active = int(get_val())
self.obj.set_active(active)
self.obj.set_sensitive(not readonly) self.obj.set_sensitive(not readonly)
self.obj.connect('changed', self.on_change) self.obj.connect('changed', self.on_change)

View File

@ -51,6 +51,8 @@ import const
NAVIGATION_NONE = -1 NAVIGATION_NONE = -1
NAVIGATION_PERSON = 0 NAVIGATION_PERSON = 0
EMPTY_SEARCH = (0, '', False)
#---------------------------------------------------------------- #----------------------------------------------------------------
# #
# PageView # PageView
@ -570,7 +572,7 @@ class ListView(BookMarkView):
handle = self.first_selected() handle = self.first_selected()
if Config.get(Config.FILTER): if Config.get(Config.FILTER):
search = (0, '', False) search = EMPTY_SEARCH
else: else:
search = self.search_bar.get_value() search = self.search_bar.get_value()
@ -610,7 +612,7 @@ class ListView(BookMarkView):
if self.active: if self.active:
if Config.get(Config.FILTER): if Config.get(Config.FILTER):
search = (0, '') search = EMPTY_SEARCH
else: else:
search = self.search_bar.get_value() search = self.search_bar.get_value()
@ -631,7 +633,7 @@ class ListView(BookMarkView):
db.connect(sig, self.signal_map[sig]) db.connect(sig, self.signal_map[sig])
if Config.get(Config.FILTER): if Config.get(Config.FILTER):
search = (0, '') search = EMPTY_SEARCH
else: else:
search = self.search_bar.get_value() search = self.search_bar.get_value()

View File

@ -46,3 +46,31 @@ class MarkerType(GrampsType):
def __init__(self, value=None): def __init__(self, value=None):
GrampsType.__init__(self, value) GrampsType.__init__(self, value)
def set(self, value):
if isinstance(value,self.__class__):
if value.val == self.CUSTOM and value.string == '':
self.val = self.NONE
self.string = ''
else:
self.val = value.val
self.string = value.string
elif type(value) == tuple:
if value[0] == self.CUSTOM and value[1] == '':
self.value = self.NONE
self.string = ''
else:
self.val = value[0]
self.string = value[1]
elif type(value) == int:
self.val = value
self.string = ''
elif type(value) == str:
self.val = self._S2IMAP.get(value,self._CUSTOM)
if self.val == self._CUSTOM:
self.string = value
else:
self.string = ''
else:
self.val = self._DEFAULT
self.string = ''