Added MIME support via the new grampslib C module.
svn: r1148
@ -86,6 +86,7 @@ class FamilyView:
|
||||
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('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)
|
||||
self.spouse_list.append_column(column)
|
||||
@ -113,19 +114,10 @@ class FamilyView:
|
||||
self.child_list.set_search_column(0)
|
||||
self.child_selection = self.child_list.get_selection()
|
||||
|
||||
colno = 0
|
||||
for title in [ (_('Order'),0), (_('Name'),1), (_('ID'),2),
|
||||
(_('Gender'),3), (_('Birth Date'),4),
|
||||
(_('Status'),5), ('',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)
|
||||
Utils.build_columns(self.child_list,
|
||||
[ (_(''),30,0), (_('Name'),250,1), (_('ID'),50,2),
|
||||
(_('Gender'),100,3), (_('Birth Date'),150,4),
|
||||
(_('Status'),150,5), ('',0,6) ])
|
||||
|
||||
def on_child_list_button_press(self,obj,event):
|
||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||
@ -379,6 +371,14 @@ class FamilyView:
|
||||
def del_sp_parents(self,obj):
|
||||
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):
|
||||
if not person:
|
||||
return
|
||||
|
@ -31,6 +31,7 @@ import string
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gobject
|
||||
import gtk
|
||||
import gnome.ui
|
||||
import gnome.canvas
|
||||
@ -52,6 +53,7 @@ import EditPerson
|
||||
import Marriage
|
||||
import EditPlace
|
||||
import EditSource
|
||||
import ListModel
|
||||
|
||||
from QuestionDialog import ErrorDialog
|
||||
from intl import gettext as _
|
||||
@ -494,7 +496,13 @@ class LocalMediaProperties:
|
||||
self.attr_type = self.change_dialog.get_widget("attr_type")
|
||||
self.attr_value = self.change_dialog.get_widget("attr_value")
|
||||
self.attr_details = self.change_dialog.get_widget("attr_details")
|
||||
|
||||
|
||||
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())
|
||||
mtype = self.object.getMimeType()
|
||||
@ -512,7 +520,6 @@ class LocalMediaProperties:
|
||||
|
||||
mt = Utils.get_mime_description(mtype)
|
||||
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.signal_autoconnect({
|
||||
"on_cancel_clicked" : Utils.destroy_passed_object,
|
||||
@ -520,7 +527,6 @@ class LocalMediaProperties:
|
||||
"on_down_clicked" : self.on_down_clicked,
|
||||
"on_ok_clicked" : self.on_ok_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_delete_attr_clicked" : self.on_delete_attr_clicked,
|
||||
"on_update_attr_clicked" : self.on_update_attr_clicked,
|
||||
@ -528,21 +534,19 @@ class LocalMediaProperties:
|
||||
self.redraw_attr_list()
|
||||
|
||||
def on_up_clicked(self,obj):
|
||||
if len(obj.selection) == 0:
|
||||
return
|
||||
row = obj.selection[0]
|
||||
if row != 0:
|
||||
obj.select_row(row-1,0)
|
||||
store,iter = obj.get_selected()
|
||||
if iter:
|
||||
row = store.get_path(iter)
|
||||
# select row
|
||||
|
||||
def on_down_clicked(self,obj):
|
||||
if len(obj.selection) == 0:
|
||||
return
|
||||
row = obj.selection[0]
|
||||
if row != obj.rows-1:
|
||||
obj.select_row(row+1,0)
|
||||
store,iter = obj.get_selected()
|
||||
if iter:
|
||||
row = store.get_path(iter)
|
||||
# select row
|
||||
|
||||
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):
|
||||
priv = self.change_dialog.get_widget("private").get_active()
|
||||
@ -563,17 +567,24 @@ class LocalMediaProperties:
|
||||
Utils.destroy_passed_object(obj)
|
||||
|
||||
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_value.set_text(attr.getValue())
|
||||
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):
|
||||
import AttrEdit
|
||||
if len(obj.selection) > 0:
|
||||
row = obj.selection[0]
|
||||
attr = obj.get_row_data(row)
|
||||
|
||||
store,iter = obj.get_selected()
|
||||
if iter:
|
||||
row = store.get_path(iter)
|
||||
attr = self.alist[row[0]]
|
||||
AttrEdit.AttributeEditor(self,attr,"Media Object",
|
||||
Plugins.get_image_attributes())
|
||||
|
||||
@ -610,7 +621,12 @@ class GlobalMediaProperties:
|
||||
self.attr_type = self.change_dialog.get_widget("attr_type")
|
||||
self.attr_value = self.change_dialog.get_widget("attr_value")
|
||||
self.attr_details = self.change_dialog.get_widget("attr_details")
|
||||
|
||||
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())
|
||||
mtype = self.object.getMimeType()
|
||||
@ -630,7 +646,6 @@ class GlobalMediaProperties:
|
||||
"on_down_clicked" : self.on_down_clicked,
|
||||
"on_ok_clicked" : self.on_ok_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_notebook_switch_page": self.on_notebook_switch_page,
|
||||
"on_make_local_clicked" : self.on_make_local_clicked,
|
||||
@ -640,18 +655,16 @@ class GlobalMediaProperties:
|
||||
self.redraw_attr_list()
|
||||
|
||||
def on_up_clicked(self,obj):
|
||||
if len(obj.selection) == 0:
|
||||
return
|
||||
row = obj.selection[0]
|
||||
if row != 0:
|
||||
obj.select_row(row-1,0)
|
||||
store,iter = obj.get_selected()
|
||||
if iter:
|
||||
row = store.get_path(iter)
|
||||
# select row
|
||||
|
||||
def on_down_clicked(self,obj):
|
||||
if len(obj.selection) == 0:
|
||||
return
|
||||
row = obj.selection[0]
|
||||
if row != obj.rows-1:
|
||||
obj.select_row(row+1,0)
|
||||
store,iter = obj.get_selected()
|
||||
if iter:
|
||||
row = store.get_path(iter)
|
||||
# select row
|
||||
|
||||
def update_info(self):
|
||||
fname = self.object.getPath()
|
||||
@ -673,50 +686,44 @@ class GlobalMediaProperties:
|
||||
self.update()
|
||||
|
||||
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):
|
||||
if len(obj.selection) <= 0:
|
||||
store,iter = self.refmodel.selection.get_selected()
|
||||
if not iter:
|
||||
return
|
||||
if event.button == 1 and event.type == GDK._2BUTTON_PRESS:
|
||||
data = obj.get_row_data(obj.selection[0])
|
||||
if data != None:
|
||||
data[0](data[1],data[2])
|
||||
if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
||||
pass
|
||||
|
||||
def display_refs(self):
|
||||
if self.refs == 1:
|
||||
return
|
||||
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)
|
||||
for key in self.db.getPersonKeys():
|
||||
p = self.db.getPerson(key)
|
||||
for o in p.getPhotoList():
|
||||
if o.getReference() == self.object:
|
||||
ref.append([_("Person"),p.getId(),GrampsCfg.nameof(p)])
|
||||
ref.set_row_data(index,(EditPerson.EditPerson,p,self.db))
|
||||
index = index + 1
|
||||
self.refmodel.add([_("Person"),p.getId(),GrampsCfg.nameof(p)])
|
||||
for p in self.db.getFamilyMap().values():
|
||||
for o in p.getPhotoList():
|
||||
if o.getReference() == self.object:
|
||||
ref.append([_("Family"),p.getId(),Utils.family_name(p)])
|
||||
ref.set_row_data(index,(Marriage.Marriage,p,self.db))
|
||||
index = index + 1
|
||||
self.refmodel.add([_("Family"),p.getId(),Utils.family_name(p)])
|
||||
for key in self.db.getSourceKeys():
|
||||
p = self.db.getSource(key)
|
||||
for o in p.getPhotoList():
|
||||
if o.getReference() == self.object:
|
||||
ref.append([_("Source"),p.getId(),p.getTitle()])
|
||||
ref.set_row_data(index,(EditSource.EditSource,p,self.db))
|
||||
index = index + 1
|
||||
self.refmodel.add([_("Source"),p.getId(),p.getTitle()])
|
||||
for key in self.db.getPlaceKeys():
|
||||
p = self.db.getPlace(key)
|
||||
for o in p.getPhotoList():
|
||||
if o.getReference() == self.object:
|
||||
ref.append([_("Place"),p.getId(),p.get_title()])
|
||||
ref.set_row_data(index,(EditPlace.EditPlace,p,self.db))
|
||||
index = index + 1
|
||||
self.refmodel.add([_("Place"),p.getId(),p.get_title()])
|
||||
|
||||
def on_notebook_switch_page(self,obj,junk,page):
|
||||
if page == 3:
|
||||
@ -741,17 +748,24 @@ class GlobalMediaProperties:
|
||||
Utils.destroy_passed_object(obj)
|
||||
|
||||
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_value.set_text(attr.getValue())
|
||||
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):
|
||||
import AttrEdit
|
||||
if len(obj.selection) > 0:
|
||||
row = obj.selection[0]
|
||||
attr = obj.get_row_data(row)
|
||||
|
||||
store,iter = obj.get_selected()
|
||||
if iter:
|
||||
row = store.get_path(iter)
|
||||
attr = self.alist[row[0]]
|
||||
AttrEdit.AttributeEditor(self,attr,"Media Object",
|
||||
Plugins.get_image_attributes())
|
||||
|
||||
|
70
src/ListModel.py
Normal 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
|
||||
|
@ -25,22 +25,20 @@ pkgdata_DATA = ${INTLLIBS} ${GLADEFILES} ${GRAPHICS} gramps.desktop
|
||||
#EXTRA_DIST =@DISTLANGS@
|
||||
|
||||
|
||||
all: ${INTLLIBS}
|
||||
all: ${INTLLIBS} grampslib.so
|
||||
|
||||
DIST_SOURCES = intl.c
|
||||
dist_pkgdata_DATA = ${pkgdata_DATA}
|
||||
|
||||
# These can prbably be done in a better or more elegant/generic way
|
||||
# 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
|
||||
$(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
|
||||
# spirit of keeping each subdirectory as a separate entity unto itself.
|
||||
# But, since the template depends on everything from here, we allow this
|
||||
|
@ -444,19 +444,17 @@ uninstall-info: uninstall-info-recursive
|
||||
|
||||
#EXTRA_DIST =@DISTLANGS@
|
||||
|
||||
all: ${INTLLIBS}
|
||||
all: ${INTLLIBS} grampslib.so
|
||||
|
||||
# These can prbably be done in a better or more elegant/generic way
|
||||
# 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
|
||||
$(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
|
||||
# spirit of keeping each subdirectory as a separate entity unto itself.
|
||||
# But, since the template depends on everything from here, we allow this
|
||||
|
@ -89,7 +89,8 @@ class MediaView:
|
||||
else:
|
||||
column.set_resizable(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])
|
||||
self.list.append_column(column)
|
||||
|
||||
|
70
src/Utils.py
@ -32,8 +32,7 @@ import os
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
#import gnome.util
|
||||
#from gnome.ui import GnomeWarningDialog
|
||||
import grampslib
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -48,8 +47,7 @@ import RelImage
|
||||
# internationalization
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from intl import gettext
|
||||
_ = gettext
|
||||
from intl import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -362,45 +360,26 @@ def get_place_from_list(obj):
|
||||
else:
|
||||
return select[0].get_data(LISTOBJ)
|
||||
|
||||
import os
|
||||
|
||||
def find_icon(mtype):
|
||||
icon = None
|
||||
nicon = None
|
||||
# for k in gnome.mime.get_keys(mtype):
|
||||
# if k == "icon-filename":
|
||||
# icon = gnome.mime.get_value(mtype,k)
|
||||
# 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
|
||||
n = "%s/icons/%s.png" % (const.rootDir,string.replace(string.replace(mtype,'/','-'),'.','-'))
|
||||
if os.path.isfile(n):
|
||||
return n
|
||||
else:
|
||||
return const.icon
|
||||
|
||||
def get_mime_type(file):
|
||||
if file[-4:] == ".jpg":
|
||||
return "image/jpeg"
|
||||
type = grampslib.gnome_vfs_mime_type_from_name(file)
|
||||
if type:
|
||||
return type
|
||||
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):
|
||||
value = grampslib.gnome_vfs_mime_get_description(type)
|
||||
if value:
|
||||
return value
|
||||
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)
|
||||
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)
|
||||
|
155
src/gramps.glade
@ -603,7 +603,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Edit</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"/>
|
||||
</widget>
|
||||
</child>
|
||||
@ -1186,52 +1186,6 @@
|
||||
<property name="row_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"><b>Children</b></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>
|
||||
<widget class="GtkFrame" id="frame10">
|
||||
<property name="visible">True</property>
|
||||
@ -1816,6 +1770,113 @@
|
||||
<property name="y_options">fill</property>
|
||||
</packing>
|
||||
</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"><b>Children</b></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>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -664,12 +664,6 @@ class Gramps:
|
||||
else:
|
||||
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):
|
||||
"""Select an existing child to add to the active family"""
|
||||
import SelectChild
|
||||
|
6
src/grampslib.i
Normal 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*);
|
BIN
src/icons/application-eps.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/icons/application-msword.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
src/icons/application-pdf.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src/icons/application-postscript.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
src/icons/application-rtf.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
src/icons/application-vnd-ms-excel.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
src/icons/application-vnd-ms-powerpoint.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
src/icons/application-vnd-rn-realmedia.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
src/icons/application-vnd-stardivision-calc.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
src/icons/application-vnd-stardivision-impress.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
src/icons/application-vnd-stardivision-writer.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
src/icons/application-vnd-sun-xml-calc.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
src/icons/application-vnd-sun-xml-impress.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
src/icons/application-vnd-sun-xml-writer.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
src/icons/application-x-abiword.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
src/icons/application-x-gnumeric.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
src/icons/application-x-killustrator.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
src/icons/application-x-kpresenter.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
src/icons/application-x-kspread.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
src/icons/application-x-kword.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
src/icons/application-x-ogg.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
src/icons/audio-ac3.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
src/icons/audio-basic.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src/icons/audio-x-aiff.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
src/icons/audio-x-midi.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
src/icons/audio-x-mp3.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
src/icons/audio-x-real-audio.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/icons/audio-x-ulaw.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src/icons/audio-x-wav.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/icons/audio.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
src/icons/gnome-http-url.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
src/icons/image-x-xcf.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
src/icons/image.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
src/icons/text-css.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
src/icons/text-html.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src/icons/text-plain.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
src/icons/text-x-java.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
src/icons/text-x-tex.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/icons/text-xml.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
src/icons/text.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
src/icons/video-mpeg.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
src/icons/video-quicktime.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
src/icons/video-x-ms-asf.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
src/icons/video-x-ms-wmv.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
src/icons/video-x-msvideo.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
@ -1075,8 +1075,6 @@
|
||||
<property name="headers-visible">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="select_row" handler="on_attr_list_select_row" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label144">
|
||||
<property name="child_name">CList:title</property>
|
||||
@ -2033,8 +2031,6 @@
|
||||
<property name="height-request">100</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="select_row" handler="on_attr_list_select_row" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label167">
|
||||
<property name="child_name">CList:title</property>
|
||||
|