Added MIME support via the new grampslib C module.

svn: r1148
This commit is contained in:
Don Allingham 2002-10-25 04:52:51 +00:00
parent 782841c738
commit 0753b631a6
56 changed files with 318 additions and 182 deletions

View File

@ -86,6 +86,7 @@ class FamilyView:
self.top.get_widget('del_parents').connect('clicked',self.del_parents_clicked) self.top.get_widget('del_parents').connect('clicked',self.del_parents_clicked)
self.top.get_widget('add_spparents').connect('clicked',self.add_sp_parents) self.top.get_widget('add_spparents').connect('clicked',self.add_sp_parents)
self.top.get_widget('del_spparents').connect('clicked',self.del_sp_parents) self.top.get_widget('del_spparents').connect('clicked',self.del_sp_parents)
self.top.get_widget('fam_back').connect('clicked',self.child_back)
column = gtk.TreeViewColumn('',gtk.CellRendererText(),text=0) column = gtk.TreeViewColumn('',gtk.CellRendererText(),text=0)
self.spouse_list.append_column(column) self.spouse_list.append_column(column)
@ -113,19 +114,10 @@ class FamilyView:
self.child_list.set_search_column(0) self.child_list.set_search_column(0)
self.child_selection = self.child_list.get_selection() self.child_selection = self.child_list.get_selection()
colno = 0 Utils.build_columns(self.child_list,
for title in [ (_('Order'),0), (_('Name'),1), (_('ID'),2), [ (_(''),30,0), (_('Name'),250,1), (_('ID'),50,2),
(_('Gender'),3), (_('Birth Date'),4), (_('Gender'),100,3), (_('Birth Date'),150,4),
(_('Status'),5), ('',6) ]: (_('Status'),150,5), ('',0,6) ])
renderer = gtk.CellRendererText ()
column = gtk.TreeViewColumn (title[0], renderer, text=colno)
colno = colno + 1
column.set_clickable (gtk.TRUE)
if title[0] == '':
column.set_clickable(gtk.TRUE)
column.set_visible(gtk.FALSE)
column.set_sort_column_id(title[1])
self.child_list.append_column (column)
def on_child_list_button_press(self,obj,event): def on_child_list_button_press(self,obj,event):
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
@ -379,6 +371,14 @@ class FamilyView:
def del_sp_parents(self,obj): def del_sp_parents(self,obj):
self.parent_deleter(self.selected_spouse,self.sp_selection) self.parent_deleter(self.selected_spouse,self.sp_selection)
def child_back(self,obj):
"""makes the currently select child the active person"""
model, iter = self.child_selection.get_selected()
if iter:
id = self.child_model.get_value(iter,2)
self.parent.change_active_person(self.parent.db.getPerson(id))
self.load_family()
def parent_editor(self,person,selection): def parent_editor(self,person,selection):
if not person: if not person:
return return

View File

@ -31,6 +31,7 @@ import string
# GTK/Gnome modules # GTK/Gnome modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gobject
import gtk import gtk
import gnome.ui import gnome.ui
import gnome.canvas import gnome.canvas
@ -52,6 +53,7 @@ import EditPerson
import Marriage import Marriage
import EditPlace import EditPlace
import EditSource import EditSource
import ListModel
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
from intl import gettext as _ from intl import gettext as _
@ -494,8 +496,14 @@ class LocalMediaProperties:
self.attr_type = self.change_dialog.get_widget("attr_type") self.attr_type = self.change_dialog.get_widget("attr_type")
self.attr_value = self.change_dialog.get_widget("attr_value") self.attr_value = self.change_dialog.get_widget("attr_value")
self.attr_details = self.change_dialog.get_widget("attr_details") self.attr_details = self.change_dialog.get_widget("attr_details")
self.attr_list = self.change_dialog.get_widget("attr_list") self.attr_list = self.change_dialog.get_widget("attr_list")
self.attr_model = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_STRING)
Utils.build_columns(self.attr_list, [(_('Attribute'),150,-1), (_('Value'),100,-1)])
self.attr_list.set_model(self.attr_model)
self.attr_list.get_selection().connect('changed',self.on_attr_list_select_row)
descr_window.set_text(self.object.getDescription()) descr_window.set_text(self.object.getDescription())
mtype = self.object.getMimeType() mtype = self.object.getMimeType()
@ -512,7 +520,6 @@ class LocalMediaProperties:
mt = Utils.get_mime_description(mtype) mt = Utils.get_mime_description(mtype)
self.change_dialog.get_widget("type").set_text(mt) self.change_dialog.get_widget("type").set_text(mt)
print self.photo
self.change_dialog.get_widget("notes").get_buffer().set_text(self.photo.getNote()) self.change_dialog.get_widget("notes").get_buffer().set_text(self.photo.getNote())
self.change_dialog.signal_autoconnect({ self.change_dialog.signal_autoconnect({
"on_cancel_clicked" : Utils.destroy_passed_object, "on_cancel_clicked" : Utils.destroy_passed_object,
@ -520,7 +527,6 @@ class LocalMediaProperties:
"on_down_clicked" : self.on_down_clicked, "on_down_clicked" : self.on_down_clicked,
"on_ok_clicked" : self.on_ok_clicked, "on_ok_clicked" : self.on_ok_clicked,
"on_apply_clicked" : self.on_apply_clicked, "on_apply_clicked" : self.on_apply_clicked,
"on_attr_list_select_row" : self.on_attr_list_select_row,
"on_add_attr_clicked": self.on_add_attr_clicked, "on_add_attr_clicked": self.on_add_attr_clicked,
"on_delete_attr_clicked" : self.on_delete_attr_clicked, "on_delete_attr_clicked" : self.on_delete_attr_clicked,
"on_update_attr_clicked" : self.on_update_attr_clicked, "on_update_attr_clicked" : self.on_update_attr_clicked,
@ -528,21 +534,19 @@ class LocalMediaProperties:
self.redraw_attr_list() self.redraw_attr_list()
def on_up_clicked(self,obj): def on_up_clicked(self,obj):
if len(obj.selection) == 0: store,iter = obj.get_selected()
return if iter:
row = obj.selection[0] row = store.get_path(iter)
if row != 0: # select row
obj.select_row(row-1,0)
def on_down_clicked(self,obj): def on_down_clicked(self,obj):
if len(obj.selection) == 0: store,iter = obj.get_selected()
return if iter:
row = obj.selection[0] row = store.get_path(iter)
if row != obj.rows-1: # select row
obj.select_row(row+1,0)
def redraw_attr_list(self): def redraw_attr_list(self):
Utils.redraw_list(self.alist,self.attr_list,disp_attr) Utils.redraw_list(self.alist,self.attr_model,disp_attr)
def on_apply_clicked(self, obj): def on_apply_clicked(self, obj):
priv = self.change_dialog.get_widget("private").get_active() priv = self.change_dialog.get_widget("private").get_active()
@ -563,17 +567,24 @@ class LocalMediaProperties:
Utils.destroy_passed_object(obj) Utils.destroy_passed_object(obj)
def on_attr_list_select_row(self,obj,row,b,c): def on_attr_list_select_row(self,obj,row,b,c):
attr = obj.get_row_data(row) store,iter = obj.get_selected()
if iter:
self.attr_type.set_label(attr.getType()) row = store.get_path(iter)
self.attr_value.set_text(attr.getValue()) attr = self.alist[row[0]]
self.attr_details.set_text(Utils.get_detail_text(attr))
self.attr_type.set_label(attr.getType())
self.attr_value.set_text(attr.getValue())
else:
self.attr_type.set_label('')
self.attr_value.set_text('')
def on_update_attr_clicked(self,obj): def on_update_attr_clicked(self,obj):
import AttrEdit import AttrEdit
if len(obj.selection) > 0:
row = obj.selection[0] store,iter = obj.get_selected()
attr = obj.get_row_data(row) if iter:
row = store.get_path(iter)
attr = self.alist[row[0]]
AttrEdit.AttributeEditor(self,attr,"Media Object", AttrEdit.AttributeEditor(self,attr,"Media Object",
Plugins.get_image_attributes()) Plugins.get_image_attributes())
@ -610,7 +621,12 @@ class GlobalMediaProperties:
self.attr_type = self.change_dialog.get_widget("attr_type") self.attr_type = self.change_dialog.get_widget("attr_type")
self.attr_value = self.change_dialog.get_widget("attr_value") self.attr_value = self.change_dialog.get_widget("attr_value")
self.attr_details = self.change_dialog.get_widget("attr_details") self.attr_details = self.change_dialog.get_widget("attr_details")
self.attr_list = self.change_dialog.get_widget("attr_list") self.attr_list = self.change_dialog.get_widget("attr_list")
self.attr_model = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_STRING)
Utils.build_columns(self.attr_list, [(_('Attribute'),150,-1), (_('Value'),100,-1)])
self.attr_list.set_model(self.attr_model)
self.attr_list.get_selection().connect('changed',self.on_attr_list_select_row)
self.descr_window.set_text(self.object.getDescription()) self.descr_window.set_text(self.object.getDescription())
mtype = self.object.getMimeType() mtype = self.object.getMimeType()
@ -630,7 +646,6 @@ class GlobalMediaProperties:
"on_down_clicked" : self.on_down_clicked, "on_down_clicked" : self.on_down_clicked,
"on_ok_clicked" : self.on_ok_clicked, "on_ok_clicked" : self.on_ok_clicked,
"on_apply_clicked" : self.on_apply_clicked, "on_apply_clicked" : self.on_apply_clicked,
"on_attr_list_select_row": self.on_attr_list_select_row,
"on_add_attr_clicked" : self.on_add_attr_clicked, "on_add_attr_clicked" : self.on_add_attr_clicked,
"on_notebook_switch_page": self.on_notebook_switch_page, "on_notebook_switch_page": self.on_notebook_switch_page,
"on_make_local_clicked" : self.on_make_local_clicked, "on_make_local_clicked" : self.on_make_local_clicked,
@ -640,18 +655,16 @@ class GlobalMediaProperties:
self.redraw_attr_list() self.redraw_attr_list()
def on_up_clicked(self,obj): def on_up_clicked(self,obj):
if len(obj.selection) == 0: store,iter = obj.get_selected()
return if iter:
row = obj.selection[0] row = store.get_path(iter)
if row != 0: # select row
obj.select_row(row-1,0)
def on_down_clicked(self,obj): def on_down_clicked(self,obj):
if len(obj.selection) == 0: store,iter = obj.get_selected()
return if iter:
row = obj.selection[0] row = store.get_path(iter)
if row != obj.rows-1: # select row
obj.select_row(row+1,0)
def update_info(self): def update_info(self):
fname = self.object.getPath() fname = self.object.getPath()
@ -673,50 +686,44 @@ class GlobalMediaProperties:
self.update() self.update()
def redraw_attr_list(self): def redraw_attr_list(self):
Utils.redraw_list(self.alist,self.attr_list,disp_attr) Utils.redraw_list(self.alist,self.attr_model,disp_attr)
def button_press(self,obj,event): def button_press(self,obj,event):
if len(obj.selection) <= 0: store,iter = self.refmodel.selection.get_selected()
if not iter:
return return
if event.button == 1 and event.type == GDK._2BUTTON_PRESS: if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
data = obj.get_row_data(obj.selection[0]) pass
if data != None:
data[0](data[1],data[2])
def display_refs(self): def display_refs(self):
if self.refs == 1: if self.refs == 1:
return return
self.refs = 1 self.refs = 1
index = 0
ref = self.change_dialog.get_widget("refinfo") self.refmodel = ListModel.ListModel(self.change_dialog.get_widget("refinfo"),
[(_('Type'),150),(_('ID'),75),(_('Value'),100)])
ref = self.refmodel.tree
ref.connect('button-press-event',self.button_press) ref.connect('button-press-event',self.button_press)
for key in self.db.getPersonKeys(): for key in self.db.getPersonKeys():
p = self.db.getPerson(key) p = self.db.getPerson(key)
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
ref.append([_("Person"),p.getId(),GrampsCfg.nameof(p)]) self.refmodel.add([_("Person"),p.getId(),GrampsCfg.nameof(p)])
ref.set_row_data(index,(EditPerson.EditPerson,p,self.db))
index = index + 1
for p in self.db.getFamilyMap().values(): for p in self.db.getFamilyMap().values():
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
ref.append([_("Family"),p.getId(),Utils.family_name(p)]) self.refmodel.add([_("Family"),p.getId(),Utils.family_name(p)])
ref.set_row_data(index,(Marriage.Marriage,p,self.db))
index = index + 1
for key in self.db.getSourceKeys(): for key in self.db.getSourceKeys():
p = self.db.getSource(key) p = self.db.getSource(key)
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
ref.append([_("Source"),p.getId(),p.getTitle()]) self.refmodel.add([_("Source"),p.getId(),p.getTitle()])
ref.set_row_data(index,(EditSource.EditSource,p,self.db))
index = index + 1
for key in self.db.getPlaceKeys(): for key in self.db.getPlaceKeys():
p = self.db.getPlace(key) p = self.db.getPlace(key)
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
ref.append([_("Place"),p.getId(),p.get_title()]) self.refmodel.add([_("Place"),p.getId(),p.get_title()])
ref.set_row_data(index,(EditPlace.EditPlace,p,self.db))
index = index + 1
def on_notebook_switch_page(self,obj,junk,page): def on_notebook_switch_page(self,obj,junk,page):
if page == 3: if page == 3:
@ -741,17 +748,24 @@ class GlobalMediaProperties:
Utils.destroy_passed_object(obj) Utils.destroy_passed_object(obj)
def on_attr_list_select_row(self,obj,row,b,c): def on_attr_list_select_row(self,obj,row,b,c):
attr = obj.get_row_data(row) store,iter = obj.get_selected()
if iter:
row = store.get_path(iter)
attr = self.alist[row[0]]
self.attr_type.set_label(attr.getType()) self.attr_type.set_label(attr.getType())
self.attr_value.set_text(attr.getValue()) self.attr_value.set_text(attr.getValue())
self.attr_details.set_text(Utils.get_detail_text(attr)) else:
self.attr_type.set_label('')
self.attr_value.set_text('')
def on_update_attr_clicked(self,obj): def on_update_attr_clicked(self,obj):
import AttrEdit import AttrEdit
if len(obj.selection) > 0:
row = obj.selection[0] store,iter = obj.get_selected()
attr = obj.get_row_data(row) if iter:
row = store.get_path(iter)
attr = self.alist[row[0]]
AttrEdit.AttributeEditor(self,attr,"Media Object", AttrEdit.AttributeEditor(self,attr,"Media Object",
Plugins.get_image_attributes()) Plugins.get_image_attributes())

70
src/ListModel.py Normal file
View File

@ -0,0 +1,70 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
from gobject import TYPE_STRING
import gtk
class ListModel:
def __init__(self,tree,dlist):
self.tree = tree
l = len(dlist)
if l == 1:
self.model = gtk.ListStore(TYPE_STRING)
elif l == 2:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING)
elif l == 3:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING)
elif l == 4:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING)
elif l == 5:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING)
elif l == 6:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING, TYPE_STRING)
elif l == 7:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING)
elif l == 8:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING)
self.selection = self.tree.get_selection()
self.tree.set_model(self.model)
cnum = 0
for name in dlist:
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn(name[0],renderer,text=cnum)
column.set_min_width(name[1])
cnum = cnum + 1
tree.append_column(column)
def add(self,data):
iter = self.model.append()
col = 0
for object in data:
self.model.set_value(iter,col,object)
col = col + 1

View File

@ -25,22 +25,20 @@ pkgdata_DATA = ${INTLLIBS} ${GLADEFILES} ${GRAPHICS} gramps.desktop
#EXTRA_DIST =@DISTLANGS@ #EXTRA_DIST =@DISTLANGS@
all: ${INTLLIBS} all: ${INTLLIBS} grampslib.so
DIST_SOURCES = intl.c DIST_SOURCES = intl.c
dist_pkgdata_DATA = ${pkgdata_DATA} dist_pkgdata_DATA = ${pkgdata_DATA}
# These can prbably be done in a better or more elegant/generic way # These can prbably be done in a better or more elegant/generic way
# eventually (libtool?), but this works. # eventually (libtool?), but this works.
intl15.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P15_INCLUDES@ -DVER15 -o $@ intl.c
intl20.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P20_INCLUDES@ -DVER20 -o $@ intl.c
intl21.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P21_INCLUDES@ -DVER21 -o $@ intl.c
intl22.so: intl.c intl22.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ intl.c $(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ intl.c
grampslib.so: grampslib.i
swig -python grampslib.i
$(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -o $@ grampslib_wrap.c -lgnomevfs-2
# In principle the following rule slightly violates the automake/autoconf # In principle the following rule slightly violates the automake/autoconf
# spirit of keeping each subdirectory as a separate entity unto itself. # spirit of keeping each subdirectory as a separate entity unto itself.
# But, since the template depends on everything from here, we allow this # But, since the template depends on everything from here, we allow this

View File

@ -444,19 +444,17 @@ uninstall-info: uninstall-info-recursive
#EXTRA_DIST =@DISTLANGS@ #EXTRA_DIST =@DISTLANGS@
all: ${INTLLIBS} all: ${INTLLIBS} grampslib.so
# These can prbably be done in a better or more elegant/generic way # These can prbably be done in a better or more elegant/generic way
# eventually (libtool?), but this works. # eventually (libtool?), but this works.
intl15.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P15_INCLUDES@ -DVER15 -o $@ intl.c
intl20.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P20_INCLUDES@ -DVER20 -o $@ intl.c
intl21.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P21_INCLUDES@ -DVER21 -o $@ intl.c
intl22.so: intl.c intl22.so: intl.c
$(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ intl.c $(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ intl.c
grampslib.so: grampslib.i
swig -python grampslib.i
$(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -o $@ grampslib_wrap.c -lgnomevfs-2
# In principle the following rule slightly violates the automake/autoconf # In principle the following rule slightly violates the automake/autoconf
# spirit of keeping each subdirectory as a separate entity unto itself. # spirit of keeping each subdirectory as a separate entity unto itself.
# But, since the template depends on everything from here, we allow this # But, since the template depends on everything from here, we allow this

View File

@ -89,7 +89,8 @@ class MediaView:
else: else:
column.set_resizable(gtk.TRUE) column.set_resizable(gtk.TRUE)
column.set_visible(gtk.TRUE) column.set_visible(gtk.TRUE)
column.set_sort_column_id(title[1]) if title[1] >= 0:
column.set_sort_column_id(title[1])
column.set_min_width(title[2]) column.set_min_width(title[2])
self.list.append_column(column) self.list.append_column(column)

View File

@ -32,8 +32,7 @@ import os
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gtk import gtk
#import gnome.util import grampslib
#from gnome.ui import GnomeWarningDialog
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -48,8 +47,7 @@ import RelImage
# internationalization # internationalization
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from intl import gettext from intl import gettext as _
_ = gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -362,45 +360,26 @@ def get_place_from_list(obj):
else: else:
return select[0].get_data(LISTOBJ) return select[0].get_data(LISTOBJ)
import os
def find_icon(mtype): def find_icon(mtype):
icon = None n = "%s/icons/%s.png" % (const.rootDir,string.replace(string.replace(mtype,'/','-'),'.','-'))
nicon = None if os.path.isfile(n):
# for k in gnome.mime.get_keys(mtype): return n
# if k == "icon-filename": else:
# icon = gnome.mime.get_value(mtype,k) return const.icon
# elif k == "icon_filename":
# nicon = gnome.mime.get_value(mtype,k)
# if nicon:
# p = "%s/%s" % (gnome.util.pixmap_file("nautilus"),nicon)
# if os.path.isfile(p):
# return p
# p = "%s.png" % p
# if os.path.isfile(p):
# return p
if icon:
return icon
return const.icon
def get_mime_type(file): def get_mime_type(file):
if file[-4:] == ".jpg": type = grampslib.gnome_vfs_mime_type_from_name(file)
return "image/jpeg" if type:
return type
return "unknown" return "unknown"
# if os.path.isfile(file) or os.path.isdir(file):
# mtype = gnome.mime.type_of_file(file)
# if len(string.split(mtype,"/")) != 2:
# mtype = gnome.mime.type(file)
# else:
# mtype = gnome.mime.type(file)
# return mtype
def get_mime_description(type): def get_mime_description(type):
value = grampslib.gnome_vfs_mime_get_description(type)
if value:
return value
return "" return ""
# for key in gnome.mime.get_keys(type):
# if key == "description":
# return gnome.mime.get_value(type,key)
# return type
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -552,3 +531,22 @@ def build_string_optmenu(mapping, start_val):
myMenu.set_active(start_index) myMenu.set_active(start_index)
return myMenu return myMenu
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def build_columns(tree,list):
cnum = 0
for name in list:
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn(name[0],renderer,text=cnum)
column.set_min_width(name[1])
if name[2] >= 0:
column.set_sort_column_id(name[2])
if name[0] == '':
column.set_clickable(gtk.TRUE)
column.set_visible(gtk.FALSE)
cnum = cnum + 1
tree.append_column(column)

View File

@ -603,7 +603,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Edit</property> <property name="label" translatable="yes">Edit</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="stock_pixmap">gtk-yes</property> <property name="icon">edit.png</property>
<signal name="clicked" handler="on_editbtn_clicked" last_modification_time="Sun, 22 Sep 2002 04:17:44 GMT"/> <signal name="clicked" handler="on_editbtn_clicked" last_modification_time="Sun, 22 Sep 2002 04:17:44 GMT"/>
</widget> </widget>
</child> </child>
@ -1186,52 +1186,6 @@
<property name="row_spacing">0</property> <property name="row_spacing">0</property>
<property name="column_spacing">0</property> <property name="column_spacing">0</property>
<child>
<widget class="GtkFrame" id="frame13">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
<widget class="GtkTreeView" id="chlist">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">False</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label327">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Children&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child> <child>
<widget class="GtkFrame" id="frame10"> <widget class="GtkFrame" id="frame10">
<property name="visible">True</property> <property name="visible">True</property>
@ -1816,6 +1770,113 @@
<property name="y_options">fill</property> <property name="y_options">fill</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkHBox" id="hbox80">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkFrame" id="frame13">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
<widget class="GtkTreeView" id="chlist">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">False</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label327">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Children&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">5</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox65">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkButton" id="fam_back">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Make the selected child the active family</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<child>
<widget class="GtkImage" id="image93">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>

View File

@ -664,12 +664,6 @@ class Gramps:
else: else:
obj.set_sensitive(0) obj.set_sensitive(0)
def on_fv_prev_clicked(self,obj):
"""makes the currently select child the active person"""
if self.active_child:
self.change_active_person(self.active_child)
self.family_view.load_family()
def on_add_child_clicked(self,obj): def on_add_child_clicked(self,obj):
"""Select an existing child to add to the active family""" """Select an existing child to add to the active family"""
import SelectChild import SelectChild

6
src/grampslib.i Normal file
View File

@ -0,0 +1,6 @@
%module grampslib
extern char* gnome_vfs_mime_get_icon(const char *);
extern char* gnome_vfs_mime_type_from_name(const char* );
extern char* gnome_vfs_mime_get_description(const char*);
extern char* gnome_vfs_mime_get_value(const char*,const char*);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
src/icons/audio-ac3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
src/icons/audio-basic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src/icons/audio-x-aiff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/icons/audio-x-midi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/icons/audio-x-mp3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/icons/audio-x-ulaw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src/icons/audio-x-wav.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/icons/audio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
src/icons/image-x-xcf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
src/icons/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/icons/text-css.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
src/icons/text-html.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src/icons/text-plain.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/icons/text-x-java.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
src/icons/text-x-tex.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/icons/text-xml.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/icons/text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/icons/video-mpeg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1075,8 +1075,6 @@
<property name="headers-visible">yes</property> <property name="headers-visible">yes</property>
<property name="visible">yes</property> <property name="visible">yes</property>
<signal name="select_row" handler="on_attr_list_select_row" />
<child> <child>
<widget class="GtkLabel" id="label144"> <widget class="GtkLabel" id="label144">
<property name="child_name">CList:title</property> <property name="child_name">CList:title</property>
@ -2033,8 +2031,6 @@
<property name="height-request">100</property> <property name="height-request">100</property>
<property name="visible">yes</property> <property name="visible">yes</property>
<signal name="select_row" handler="on_attr_list_select_row" />
<child> <child>
<widget class="GtkLabel" id="label167"> <widget class="GtkLabel" id="label167">
<property name="child_name">CList:title</property> <property name="child_name">CList:title</property>