Extract colormap from the passed clist, not the top level window.
svn: r1032
This commit is contained in:
parent
af62bee66a
commit
9167acae47
@ -78,7 +78,6 @@ class AddSpouse:
|
||||
self.relation_type = self.glade.get_widget("rel_type")
|
||||
self.spouse_list = self.glade.get_widget("spouseList")
|
||||
self.relation_def = self.glade.get_widget("reldef")
|
||||
self.top = self.glade.get_widget("spouseDialog")
|
||||
self.ok = self.glade.get_widget('spouse_ok')
|
||||
|
||||
self.ok.set_sensitive(0)
|
||||
@ -87,7 +86,7 @@ class AddSpouse:
|
||||
|
||||
self.spouse_list.set_column_visibility(2,0)
|
||||
self.spouse_list.set_column_visibility(3,0)
|
||||
self.sorter = Sorter.Sorter(self.spouse_list,arrow_map,'spouse',self.top)
|
||||
self.sorter = Sorter.Sorter(self.spouse_list,arrow_map,'spouse')
|
||||
self.rel_combo.set_popdown_strings(const.familyRelations)
|
||||
title = _("Choose Spouse/Partner of %s") % GrampsCfg.nameof(person)
|
||||
self.glade.get_widget("spouseTitle").set_text(title)
|
||||
@ -239,7 +238,6 @@ class SetSpouse:
|
||||
self.relation_type = self.glade.get_widget("rel_type")
|
||||
self.spouse_list = self.glade.get_widget("spouseList")
|
||||
self.relation_def = self.glade.get_widget("reldef")
|
||||
self.top = self.glade.get_widget("spouseDialog")
|
||||
|
||||
self.rel_combo.set_popdown_strings(const.familyRelations)
|
||||
title = _("Choose Spouse/Partner of %s") % GrampsCfg.nameof(person)
|
||||
|
@ -38,9 +38,8 @@ from intl import gettext
|
||||
_ = gettext
|
||||
|
||||
class MediaView:
|
||||
def __init__(self,db,glade,update,top_window):
|
||||
def __init__(self,db,glade,update):
|
||||
self.db = db
|
||||
self.top_window = top_window
|
||||
self.media_list = glade.get_widget("media_list")
|
||||
self.mid = glade.get_widget("mid")
|
||||
self.mtype = glade.get_widget("mtype")
|
||||
@ -71,7 +70,7 @@ class MediaView:
|
||||
|
||||
# Restore the previous sort column
|
||||
|
||||
self.media_sort = Sorter.Sorter(self.media_list, arrow_map, 'media', self.top_window)
|
||||
self.media_sort = Sorter.Sorter(self.media_list, arrow_map, 'media')
|
||||
|
||||
def change_db(self,db):
|
||||
self.db = db
|
||||
|
@ -54,10 +54,9 @@ _ = gettext
|
||||
#-------------------------------------------------------------------------
|
||||
class PlaceView:
|
||||
|
||||
def __init__(self,db,glade,update,top_window):
|
||||
def __init__(self,db,glade,update):
|
||||
self.db = db
|
||||
self.glade = glade
|
||||
self.top_window = top_window
|
||||
self.place_list = glade.get_widget("place_list")
|
||||
self.update_display= update
|
||||
|
||||
@ -76,7 +75,7 @@ class PlaceView:
|
||||
(11, glade.get_widget("state_arrow")),
|
||||
(12, glade.get_widget("country_arrow"))]
|
||||
|
||||
self.place_sort = Sorter.Sorter(self.place_list,plist_map,'place',self.top_window)
|
||||
self.place_sort = Sorter.Sorter(self.place_list,plist_map,'place')
|
||||
|
||||
|
||||
def change_db(self,db):
|
||||
|
@ -1330,7 +1330,8 @@ class Event(DataObj):
|
||||
def is_empty(self):
|
||||
date = self.getDateObj()
|
||||
place = self.getPlace()
|
||||
description = self.getDescription()
|
||||
description = self.description
|
||||
name = self.name
|
||||
if (not name or name == "Birth" or name == "Death") and \
|
||||
date.isEmpty() and not place and not description:
|
||||
return 1
|
||||
|
@ -36,11 +36,10 @@ import GrampsCfg
|
||||
import ListColors
|
||||
|
||||
class Sorter:
|
||||
def __init__(self, clist, column_map, key, top_window):
|
||||
def __init__(self, clist, column_map, key):
|
||||
self.clist = clist
|
||||
self.column_map = column_map
|
||||
self.key = key
|
||||
self.top_window = top_window
|
||||
(self.col,self.sort) = GrampsCfg.get_sort_cols(self.key,0,GTK.SORT_ASCENDING)
|
||||
self.change_sort(self.col,0)
|
||||
self.clist.connect('click-column',self.click)
|
||||
@ -65,7 +64,7 @@ class Sorter:
|
||||
levenbg = ListColors.evenbg
|
||||
levenfg = ListColors.evenfg
|
||||
|
||||
cmap = self.top_window.get_colormap()
|
||||
cmap = self.clist.get_colormap()
|
||||
oddbg = cmap.alloc(loddbg[0],loddbg[1],loddbg[2])
|
||||
oddfg = cmap.alloc(loddfg[0],loddfg[1],loddfg[2])
|
||||
evenbg = cmap.alloc(levenbg[0],levenbg[1],levenbg[2])
|
||||
|
@ -56,11 +56,10 @@ from intl import gettext
|
||||
_ = gettext
|
||||
|
||||
class SourceView:
|
||||
def __init__(self,db,glade,update,top_window):
|
||||
def __init__(self,db,glade,update):
|
||||
self.glade = glade
|
||||
self.db = db
|
||||
self.update = update
|
||||
self.top_window = top_window
|
||||
|
||||
arrow_map = [(3, glade.get_widget("title_arrow")),
|
||||
(1, glade.get_widget("src_id_arrow")),
|
||||
@ -68,7 +67,7 @@ class SourceView:
|
||||
self.source_list = glade.get_widget("source_list")
|
||||
self.source_list.set_column_visibility(3,0)
|
||||
self.source_list.set_column_visibility(4,0)
|
||||
self.source_sort = Sorter.Sorter(self.source_list,arrow_map,'source',self.top_window)
|
||||
self.source_sort = Sorter.Sorter(self.source_list,arrow_map,'source')
|
||||
|
||||
def change_db(self,db):
|
||||
self.db = db
|
||||
|
@ -136,8 +136,8 @@ class Gramps:
|
||||
(3, self.gtop.get_widget("cGenderSort")),
|
||||
(4, date_arrow)]
|
||||
|
||||
self.person_sort = Sorter.Sorter(self.person_list, plist_map, 'person', self.topWindow)
|
||||
self.child_sort = Sorter.ChildSorter(self.child_list, clist_map, 'child', self.topWindow)
|
||||
self.person_sort = Sorter.Sorter(self.person_list, plist_map, 'person')
|
||||
self.child_sort = Sorter.ChildSorter(self.child_list, clist_map, 'child')
|
||||
|
||||
if arg != None:
|
||||
if string.upper(arg[-3:]) == "GED":
|
||||
@ -210,9 +210,9 @@ class Gramps:
|
||||
self.statusbar,
|
||||
self.change_active_person,
|
||||
self.load_person)
|
||||
self.place_view = PlaceView(self.db,self.gtop,self.update_display,self.topWindow)
|
||||
self.source_view = SourceView(self.db,self.gtop,self.update_display,self.topWindow)
|
||||
self.media_view = MediaView(self.db,self.gtop,self.update_display,self.topWindow)
|
||||
self.place_view = PlaceView(self.db,self.gtop,self.update_display)
|
||||
self.source_view = SourceView(self.db,self.gtop,self.update_display)
|
||||
self.media_view = MediaView(self.db,self.gtop,self.update_display)
|
||||
|
||||
self.gtop.signal_autoconnect({
|
||||
"delete_event" : self.delete_event,
|
||||
@ -1709,7 +1709,7 @@ class Gramps:
|
||||
self.statusbar.set_status(_("%s has been bookmarked") % name)
|
||||
gtk.timeout_add(5000,self.modify_statusbar)
|
||||
else:
|
||||
gramps.ui.GnomeWarningDialog(_("Bookmark could not be set because no one was selected"))
|
||||
gnome.ui.GnomeWarningDialog(_("Bookmark could not be set because no one was selected"))
|
||||
|
||||
def on_edit_bookmarks_activate(self,obj):
|
||||
self.bookmarks.edit()
|
||||
|
Loading…
Reference in New Issue
Block a user