* src/DataViews/_RepositoryView.py: column fixes
* src/DataViews/_SourceView.py: column fixes * src/DataViews/_EventView.py: column fixes * src/DataViews/_FamilyList.py: column fixes * src/DataViews/_PlaceView.py: column fixes * src/DataViews/_PersonView.py: column fixes * src/DisplayModels.py: column/sort fixes * src/PageView.py: column/sort fixes svn: r6664
This commit is contained in:
parent
e1e2b71d27
commit
f08d35b169
@ -8,6 +8,14 @@
|
|||||||
* src/plugins/FamilyGroup.py: Fix for Event and EventType changes.
|
* src/plugins/FamilyGroup.py: Fix for Event and EventType changes.
|
||||||
|
|
||||||
2006-05-14 Don Allingham <don@gramps-project.org>
|
2006-05-14 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/DataViews/_RepositoryView.py: column fixes
|
||||||
|
* src/DataViews/_SourceView.py: column fixes
|
||||||
|
* src/DataViews/_EventView.py: column fixes
|
||||||
|
* src/DataViews/_FamilyList.py: column fixes
|
||||||
|
* src/DataViews/_PlaceView.py: column fixes
|
||||||
|
* src/DataViews/_PersonView.py: column fixes
|
||||||
|
* src/DisplayModels.py: column/sort fixes
|
||||||
|
* src/PageView.py: column/sort fixes
|
||||||
* src/DateHandler/__init__.py: import DateParser and DateDisplay
|
* src/DateHandler/__init__.py: import DateParser and DateDisplay
|
||||||
* src/DataViews/_PersonView.py: default gender filter to "any"
|
* src/DataViews/_PersonView.py: default gender filter to "any"
|
||||||
* configure.in: bump up to 2.1.2
|
* configure.in: bump up to 2.1.2
|
||||||
|
@ -102,9 +102,6 @@ class EventView(PageView.ListView):
|
|||||||
def ui_definition(self):
|
def ui_definition(self):
|
||||||
return '''<ui>
|
return '''<ui>
|
||||||
<menubar name="MenuBar">
|
<menubar name="MenuBar">
|
||||||
<menu action="ViewMenu">
|
|
||||||
<menuitem action="Filter"/>
|
|
||||||
</menu>
|
|
||||||
<menu action="BookMenu">
|
<menu action="BookMenu">
|
||||||
<placeholder name="AddEditBook">
|
<placeholder name="AddEditBook">
|
||||||
<menuitem action="AddBook"/>
|
<menuitem action="AddBook"/>
|
||||||
|
@ -115,9 +115,6 @@ class FamilyListView(PageView.ListView):
|
|||||||
</placeholder>
|
</placeholder>
|
||||||
<menuitem action="ColumnEdit"/>
|
<menuitem action="ColumnEdit"/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu action="ViewMenu">
|
|
||||||
<menuitem action="Filter"/>
|
|
||||||
</menu>
|
|
||||||
<menu action="BookMenu">
|
<menu action="BookMenu">
|
||||||
<placeholder name="AddEditBook">
|
<placeholder name="AddEditBook">
|
||||||
<menuitem action="AddBook"/>
|
<menuitem action="AddBook"/>
|
||||||
|
@ -307,7 +307,13 @@ class PersonView(PageView.PersonNavView):
|
|||||||
return table
|
return table
|
||||||
|
|
||||||
def clear_clicked(self,obj):
|
def clear_clicked(self,obj):
|
||||||
print "clear"
|
self.filter_name.set_text('')
|
||||||
|
self.filter_id.set_text('')
|
||||||
|
self.filter_birth.set_text('')
|
||||||
|
self.filter_death.get_text('')
|
||||||
|
self.filter_note.get_text('')
|
||||||
|
self.filter_gender.set_active(0)
|
||||||
|
self.event_menu.child.set_text('')
|
||||||
|
|
||||||
def filter_clicked(self, obj):
|
def filter_clicked(self, obj):
|
||||||
name = self.filter_name.get_text().strip()
|
name = self.filter_name.get_text().strip()
|
||||||
|
@ -121,9 +121,6 @@ class PlaceView(PageView.ListView):
|
|||||||
def ui_definition(self):
|
def ui_definition(self):
|
||||||
return '''<ui>
|
return '''<ui>
|
||||||
<menubar name="MenuBar">
|
<menubar name="MenuBar">
|
||||||
<menu action="ViewMenu">
|
|
||||||
<menuitem action="Filter"/>
|
|
||||||
</menu>
|
|
||||||
<menu action="BookMenu">
|
<menu action="BookMenu">
|
||||||
<placeholder name="AddEditBook">
|
<placeholder name="AddEditBook">
|
||||||
<menuitem action="AddBook"/>
|
<menuitem action="AddBook"/>
|
||||||
|
@ -127,9 +127,6 @@ class RepositoryView(PageView.ListView):
|
|||||||
def ui_definition(self):
|
def ui_definition(self):
|
||||||
return '''<ui>
|
return '''<ui>
|
||||||
<menubar name="MenuBar">
|
<menubar name="MenuBar">
|
||||||
<menu action="ViewMenu">
|
|
||||||
<menuitem action="Filter"/>
|
|
||||||
</menu>
|
|
||||||
<menu action="BookMenu">
|
<menu action="BookMenu">
|
||||||
<placeholder name="AddEditBook">
|
<placeholder name="AddEditBook">
|
||||||
<menuitem action="AddBook"/>
|
<menuitem action="AddBook"/>
|
||||||
|
@ -119,9 +119,6 @@ class SourceView(PageView.ListView):
|
|||||||
def ui_definition(self):
|
def ui_definition(self):
|
||||||
return '''<ui>
|
return '''<ui>
|
||||||
<menubar name="MenuBar">
|
<menubar name="MenuBar">
|
||||||
<menu action="ViewMenu">
|
|
||||||
<menuitem action="Filter"/>
|
|
||||||
</menu>
|
|
||||||
<menu action="BookMenu">
|
<menu action="BookMenu">
|
||||||
<placeholder name="AddEditBook">
|
<placeholder name="AddEditBook">
|
||||||
<menuitem action="AddBook"/>
|
<menuitem action="AddBook"/>
|
||||||
|
@ -93,15 +93,15 @@ class BaseModel(gtk.GenericTreeModel):
|
|||||||
|
|
||||||
def set_sort_column(self,col):
|
def set_sort_column(self,col):
|
||||||
self.sort_func = self.smap[col]
|
self.sort_func = self.smap[col]
|
||||||
#print self.sort_func
|
|
||||||
|
|
||||||
def sort_keys(self):
|
def sort_keys(self):
|
||||||
cursor = self.gen_cursor()
|
cursor = self.gen_cursor()
|
||||||
sarray = []
|
sarray = []
|
||||||
data = cursor.next()
|
data = cursor.next()
|
||||||
|
|
||||||
while data:
|
while data:
|
||||||
sarray.append((locale.strxfrm(self.sort_func(data[1])),data[0]))
|
key = locale.strxfrm(self.sort_func(data[1]))
|
||||||
|
sarray.append((key,data[0]))
|
||||||
data = cursor.next()
|
data = cursor.next()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ class SourceModel(BaseModel):
|
|||||||
GrampsLocale.codeset)
|
GrampsLocale.codeset)
|
||||||
|
|
||||||
def sort_change(self,data):
|
def sort_change(self,data):
|
||||||
return time.localtime(data[8])
|
return "%012x" % data[8]
|
||||||
|
|
||||||
def column_tooltip(self,data):
|
def column_tooltip(self,data):
|
||||||
if const.use_tips:
|
if const.use_tips:
|
||||||
@ -387,7 +387,7 @@ class PlaceModel(BaseModel):
|
|||||||
return u''
|
return u''
|
||||||
|
|
||||||
def sort_change(self,data):
|
def sort_change(self,data):
|
||||||
return time.localtime(data[11])
|
return "%012x" % data[11]
|
||||||
|
|
||||||
def column_change(self,data):
|
def column_change(self,data):
|
||||||
return unicode(time.strftime('%x %X',time.localtime(data[11])),
|
return unicode(time.strftime('%x %X',time.localtime(data[11])),
|
||||||
@ -396,8 +396,9 @@ class PlaceModel(BaseModel):
|
|||||||
def column_tooltip(self,data):
|
def column_tooltip(self,data):
|
||||||
if const.use_tips:
|
if const.use_tips:
|
||||||
try:
|
try:
|
||||||
t = ToolTips.TipFromFunction(self.db, lambda:
|
t = ToolTips.TipFromFunction(
|
||||||
self.db.get_place_from_handle(data[0]))
|
self.db, lambda:
|
||||||
|
self.db.get_place_from_handle(data[0]))
|
||||||
except:
|
except:
|
||||||
log.error("Failed to create tooltip.", exc_info=True)
|
log.error("Failed to create tooltip.", exc_info=True)
|
||||||
return t
|
return t
|
||||||
@ -476,7 +477,7 @@ class FamilyModel(BaseModel):
|
|||||||
return unicode(data[1])
|
return unicode(data[1])
|
||||||
|
|
||||||
def sort_change(self,data):
|
def sort_change(self,data):
|
||||||
return time.localtime(data[13])
|
return "%012x" % data[13]
|
||||||
|
|
||||||
def column_change(self,data):
|
def column_change(self,data):
|
||||||
return unicode(time.strftime('%x %X',time.localtime(data[13])),
|
return unicode(time.strftime('%x %X',time.localtime(data[13])),
|
||||||
@ -553,14 +554,16 @@ class MediaModel(BaseModel):
|
|||||||
|
|
||||||
def column_date(self,data):
|
def column_date(self,data):
|
||||||
if data[9]:
|
if data[9]:
|
||||||
return unicode(DateHandler.displayer.display(data[9]))
|
date = RelLib.Date()
|
||||||
|
date.unserialize(data[9])
|
||||||
|
return unicode(DateHandler.displayer.display(date))
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
def column_handle(self,data):
|
def column_handle(self,data):
|
||||||
return unicode(data[0])
|
return unicode(data[0])
|
||||||
|
|
||||||
def sort_change(self,data):
|
def sort_change(self,data):
|
||||||
return time.localtime(data[8])
|
return "%012x" % data[8]
|
||||||
|
|
||||||
def column_change(self,data):
|
def column_change(self,data):
|
||||||
return unicode(time.strftime('%x %X',time.localtime(data[8])),
|
return unicode(time.strftime('%x %X',time.localtime(data[8])),
|
||||||
@ -645,8 +648,7 @@ class EventModel(BaseModel):
|
|||||||
return unicode(data[0])
|
return unicode(data[0])
|
||||||
|
|
||||||
def sort_change(self,data):
|
def sort_change(self,data):
|
||||||
#print time.localtime(data[10])
|
return "%012x" % data[10]
|
||||||
return time.localtime(data[10])
|
|
||||||
|
|
||||||
def column_change(self,data):
|
def column_change(self,data):
|
||||||
return unicode(time.strftime('%x %X',time.localtime(data[10])),
|
return unicode(time.strftime('%x %X',time.localtime(data[10])),
|
||||||
@ -724,14 +726,21 @@ class RepositoryModel(BaseModel):
|
|||||||
|
|
||||||
def column_city(self,data):
|
def column_city(self,data):
|
||||||
try:
|
try:
|
||||||
return data[4].get_city()
|
if data[4]:
|
||||||
|
addr = RelLib.Address()
|
||||||
|
addr.unserialize(data[4][0])
|
||||||
|
return addr.get_city()
|
||||||
|
else:
|
||||||
|
return u''
|
||||||
except:
|
except:
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
def column_street(self,data):
|
def column_street(self,data):
|
||||||
try:
|
try:
|
||||||
if data[5]:
|
if data[5]:
|
||||||
return data[5][0].get_street()
|
addr = RelLib.Address()
|
||||||
|
addr.unserialize(data[5][0])
|
||||||
|
return addr.get_street()
|
||||||
else:
|
else:
|
||||||
return u''
|
return u''
|
||||||
except:
|
except:
|
||||||
@ -740,7 +749,9 @@ class RepositoryModel(BaseModel):
|
|||||||
def column_county(self,data):
|
def column_county(self,data):
|
||||||
try:
|
try:
|
||||||
if data[5]:
|
if data[5]:
|
||||||
return data[5][0].get_county()
|
addr = RelLib.Address()
|
||||||
|
addr.unserialize(data[5][0])
|
||||||
|
return addr.get_county()
|
||||||
else:
|
else:
|
||||||
return u''
|
return u''
|
||||||
except:
|
except:
|
||||||
@ -749,7 +760,9 @@ class RepositoryModel(BaseModel):
|
|||||||
def column_state(self,data):
|
def column_state(self,data):
|
||||||
try:
|
try:
|
||||||
if data[5]:
|
if data[5]:
|
||||||
return data[5][0].get_state()
|
addr = RelLib.Address()
|
||||||
|
addr.unserialize(data[5][0])
|
||||||
|
return addr.get_state()
|
||||||
else:
|
else:
|
||||||
return u''
|
return u''
|
||||||
except:
|
except:
|
||||||
@ -758,7 +771,9 @@ class RepositoryModel(BaseModel):
|
|||||||
def column_country(self,data):
|
def column_country(self,data):
|
||||||
try:
|
try:
|
||||||
if data[5]:
|
if data[5]:
|
||||||
return data[5][0].get_country()
|
addr = RelLib.Address()
|
||||||
|
addr.unserialize(data[5][0])
|
||||||
|
return addr.get_country()
|
||||||
else:
|
else:
|
||||||
return u''
|
return u''
|
||||||
except:
|
except:
|
||||||
@ -767,7 +782,9 @@ class RepositoryModel(BaseModel):
|
|||||||
def column_postal_code(self,data):
|
def column_postal_code(self,data):
|
||||||
try:
|
try:
|
||||||
if data[5]:
|
if data[5]:
|
||||||
return data[5][0].get_postal_code()
|
addr = RelLib.Address()
|
||||||
|
addr.unserialize(data[5][0])
|
||||||
|
return addr.get_postal_code()
|
||||||
else:
|
else:
|
||||||
return u''
|
return u''
|
||||||
except:
|
except:
|
||||||
@ -776,24 +793,40 @@ class RepositoryModel(BaseModel):
|
|||||||
def column_phone(self,data):
|
def column_phone(self,data):
|
||||||
try:
|
try:
|
||||||
if data[5]:
|
if data[5]:
|
||||||
return data[5][0].get_phone()
|
addr = RelLib.Address()
|
||||||
|
addr.unserialize(data[5][0])
|
||||||
|
return addr.get_phone()
|
||||||
else:
|
else:
|
||||||
return u''
|
return u''
|
||||||
except:
|
except:
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
def column_email(self,data):
|
def column_email(self,data):
|
||||||
return unicode(data[5])
|
if data[6]:
|
||||||
|
for i in data[6]:
|
||||||
|
url = RelLib.Url()
|
||||||
|
url.unserialize(i)
|
||||||
|
if url.get_type() == RelLib.UrlType.EMAIL:
|
||||||
|
return unicode(url.path)
|
||||||
|
return u''
|
||||||
|
|
||||||
def column_search_url(self,data):
|
def column_search_url(self,data):
|
||||||
return unicode(data[6])
|
if data[6]:
|
||||||
|
for i in data[6]:
|
||||||
|
url = RelLib.Url()
|
||||||
|
url.unserialize(i)
|
||||||
|
if url.get_type() == RelLib.UrlType.WEB_SEARCH:
|
||||||
|
return unicode(url.path)
|
||||||
|
return u''
|
||||||
|
|
||||||
def column_home_url(self,data):
|
def column_home_url(self,data):
|
||||||
if data[6]:
|
if data[6]:
|
||||||
urllist = data[6]
|
for i in data[6]:
|
||||||
return unicode(urllist[0].path)
|
url = RelLib.Url()
|
||||||
else:
|
url.unserialize(i)
|
||||||
return u""
|
if url.get_type() == RelLib.UrlType.WEB_HOME:
|
||||||
|
return unicode(url.path)
|
||||||
|
return u""
|
||||||
|
|
||||||
def column_tooltip(self,data):
|
def column_tooltip(self,data):
|
||||||
return ""
|
return ""
|
||||||
|
@ -568,6 +568,7 @@ class ListView(BookMarkView):
|
|||||||
order = gtk.SORT_ASCENDING
|
order = gtk.SORT_ASCENDING
|
||||||
else:
|
else:
|
||||||
order = gtk.SORT_DESCENDING
|
order = gtk.SORT_DESCENDING
|
||||||
|
|
||||||
self.sort_col = data
|
self.sort_col = data
|
||||||
handle = self.first_selected()
|
handle = self.first_selected()
|
||||||
|
|
||||||
@ -575,9 +576,10 @@ class ListView(BookMarkView):
|
|||||||
search = EMPTY_SEARCH
|
search = EMPTY_SEARCH
|
||||||
else:
|
else:
|
||||||
search = self.search_bar.get_value()
|
search = self.search_bar.get_value()
|
||||||
|
|
||||||
self.model = self.make_model(self.dbstate.db, self.sort_col, order,
|
self.model = self.make_model(self.dbstate.db, self.sort_col, order,
|
||||||
search=search)
|
search=search)
|
||||||
|
|
||||||
self.list.set_model(self.model)
|
self.list.set_model(self.model)
|
||||||
colmap = self.column_order()
|
colmap = self.column_order()
|
||||||
|
|
||||||
@ -586,9 +588,8 @@ class ListView(BookMarkView):
|
|||||||
self.selection.select_path(path)
|
self.selection.select_path(path)
|
||||||
self.list.scroll_to_cell(path,None,1,0.5,0)
|
self.list.scroll_to_cell(path,None,1,0.5,0)
|
||||||
for i in xrange(len(self.columns)):
|
for i in xrange(len(self.columns)):
|
||||||
self.columns[i].set_sort_indicator(i==colmap[data][1])
|
self.columns[i].set_sort_indicator(i==self.sort_col)
|
||||||
self.columns[self.sort_col].set_sort_order(order)
|
self.columns[self.sort_col].set_sort_order(order)
|
||||||
# print self.sort_col, order, colmap
|
|
||||||
|
|
||||||
def build_columns(self):
|
def build_columns(self):
|
||||||
for column in self.columns:
|
for column in self.columns:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user