From 866b1400e302c079d2021fdda125cd1c0e786aba Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 18 Apr 2006 02:09:43 +0000 Subject: [PATCH] image and screen updates svn: r6352 --- gramps2/ChangeLog | 4 ++++ gramps2/src/DataViews/_FamilyView.py | 25 +++++++++++++++++++++++++ gramps2/src/DataViews/_PersonView.py | 8 ++++++-- gramps2/src/ListModel.py | 2 +- gramps2/src/SelectObject.py | 15 +++++++++++---- gramps2/src/ViewManager.py | 1 - 6 files changed, 47 insertions(+), 8 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 3866e4c69..6e5be18fd 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,8 @@ 2006-04-17 Don Allingham + * src/DataViews/_FamilyView.py: handle the dirty flag for updates + * src/DataViews/_PersonView.py: goto active person properly + * src/SelectObject.py: scale thumbnails to 1/2 size + * src/ListModel.py: reduce size of thumbnails * src/GrampsDb/_ReadGedcom.py: set author properly for GEDCOM name on default source diff --git a/gramps2/src/DataViews/_FamilyView.py b/gramps2/src/DataViews/_FamilyView.py index 987e4f909..098b32cb0 100644 --- a/gramps2/src/DataViews/_FamilyView.py +++ b/gramps2/src/DataViews/_FamilyView.py @@ -97,6 +97,13 @@ class FamilyView(PageView.PersonNavView): self.connect_to_db(dbstate.db) self.redrawing = False self.child = None + + def build_tree(self): + if self.active: + self.redraw() + self.dirty = False + else: + self.dirty = True def connect_to_db(self, db): db.connect('person-update', self.person_update) @@ -110,31 +117,49 @@ class FamilyView(PageView.PersonNavView): if self.dbstate.active: while not self.change_person(self.dbstate.active.handle): pass + self.dirty = False + else: + self.dirty = True def person_rebuild(self): if self.dbstate.active: while not self.change_person(self.dbstate.active.handle): pass + self.dirty = False + else: + self.dirty = True def family_update(self, handle_list): if self.dbstate.active: while not self.change_person(self.dbstate.active.handle): pass + self.dirty = False + else: + self.dirty = True def family_add(self, handle_list): if self.dbstate.active: while not self.change_person(self.dbstate.active.handle): pass + self.dirty = False + else: + self.dirty = True def family_delete(self, handle_list): if self.dbstate.active: while not self.change_person(self.dbstate.active.handle): pass + self.dirty = False + else: + self.dirty = True def family_rebuild(self): if self.dbstate.active: while not self.change_person(self.dbstate.active.handle): pass + self.dirty = False + else: + self.dirty = True def get_stock(self): """ diff --git a/gramps2/src/DataViews/_PersonView.py b/gramps2/src/DataViews/_PersonView.py index ef5f32029..de186d6d1 100644 --- a/gramps2/src/DataViews/_PersonView.py +++ b/gramps2/src/DataViews/_PersonView.py @@ -88,7 +88,8 @@ class PersonView(PageView.PersonNavView): self.handle_col = PeopleModel.COLUMN_INT_ID def change_page(self): - self.generic_filter_widget.on_filter_name_changed(None) + pass + #self.generic_filter_widget.on_filter_name_changed(None) def define_actions(self): """ @@ -259,6 +260,8 @@ class PersonView(PageView.PersonNavView): db.connect('person-delete', self.person_removed) db.connect('person-rebuild', self.build_tree) self.generic_filter_widget.apply_filter() + self.goto_active_person() + def goto_active_person(self,obj=None): """ @@ -495,7 +498,8 @@ class PersonView(PageView.PersonNavView): person = self.dbstate.db.get_person_from_handle(selected_ids[0]) self.dbstate.change_active_person(person) except: - self.dbstate.change_active_person(None) + pass + #self.dbstate.change_active_person(None) if len(selected_ids) == 1: self.tree.drag_source_set(BUTTON1_MASK, diff --git a/gramps2/src/ListModel.py b/gramps2/src/ListModel.py index f83dc5462..ded6872b8 100644 --- a/gramps2/src/ListModel.py +++ b/gramps2/src/ListModel.py @@ -83,7 +83,7 @@ class ListModel: renderer = gtk.CellRendererPixbuf() column = gtk.TreeViewColumn(name[0],renderer) column.add_attribute(renderer,'pixbuf',cnum) - renderer.set_property('height',const.thumbScale) + renderer.set_property('height',const.thumbScale/2) elif gtk26 and name[3] == COMBO: store = gtk.ListStore(str) model = gtk.ListStore(str, object) diff --git a/gramps2/src/SelectObject.py b/gramps2/src/SelectObject.py index 6eaa2c022..ee7d2ad14 100644 --- a/gramps2/src/SelectObject.py +++ b/gramps2/src/SelectObject.py @@ -77,9 +77,13 @@ class SelectObject: Utils.set_titles(self.top,title_label,title) - titles = [(_('Preview'),0,100,ListModel.IMAGE), - (_('Title'),1,150), (_('ID'),2,50), - (_('Type'),3,70), ('',4,0) ] + titles = [ + (_('Preview'),0,50,ListModel.IMAGE), + (_('Title'),1,150), + (_('ID'),2,50), + (_('Type'),3,70), + ('',4,0) + ] self.ncols = len(titles) @@ -98,6 +102,9 @@ class SelectObject: title = obj.get_description() the_type = Mime.get_description(obj.get_mime_type()) pixbuf = ImgManip.get_thumb_from_obj(obj) + pixbuf = pixbuf.scale_simple(pixbuf.get_width()/2, + pixbuf.get_height()/2, + gtk.gdk.INTERP_BILINEAR) self.object_model.add([pixbuf,title,obj.get_gramps_id(),the_type],key) self.object_model.connect_model() @@ -111,7 +118,7 @@ class SelectObject: the_type = obj.get_mime_type() path = obj.get_path() - if the_type and the_type[0:5] == "image": + if the_type and the_type.startswith("image/"): image = ImgManip.get_thumbnail_image(path,the_type) else: image = Mime.find_mime_type_pixbuf(the_type) diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 1e647be4b..f97b5bfc7 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -835,7 +835,6 @@ class ViewManager: # Undo/Redo always start with standard labels and insensitive state #self.undo_callback(None) #self.redo_callback(None) - #self.goto_active_person() self.file_loaded = True self.actiongroup.set_visible(True) return True