* src/grampslib.i: same fixes as grampslib_wrap.c

* src/plugins/RelCalc.py: use preferred name format


svn: r2695
This commit is contained in:
Don Allingham 2004-01-23 03:38:23 +00:00
parent 9ee20f6113
commit 6087ee24b8
2 changed files with 42 additions and 13 deletions

View File

@ -1,6 +1,10 @@
%module grampslib %module grampslib
%{ %{
#include <stdio.h>
#include <stdlib.h>
#include <libgnomevfs/gnome-vfs-application-registry.h> #include <libgnomevfs/gnome-vfs-application-registry.h>
GList *gnome_vfs_get_registered_mime_types(void);
void gnome_vfs_mime_registered_mime_type_list_free(GList*);
%} %}
extern const char* gnome_vfs_mime_get_icon(const char *); extern const char* gnome_vfs_mime_get_icon(const char *);
@ -10,21 +14,45 @@ extern const char* gnome_vfs_mime_get_value(const char*,const char*);
%inline %{ %inline %{
const char* default_application_name(const char* type) { const char* default_application_name(const char* type) {
GList *node;
char* value;
char* retval = NULL;
GList *s = gnome_vfs_get_registered_mime_types();
for (node = g_list_first(s); node != NULL; node = g_list_next(node)) {
if (!strcmp((char*)node->data,type)) {
GnomeVFSMimeApplication *a = gnome_vfs_mime_get_default_application(type); GnomeVFSMimeApplication *a = gnome_vfs_mime_get_default_application(type);
if (a) { if (a) {
return a->name; retval = a->name;
} else { break;
return (char*) NULL;
} }
}
}
gnome_vfs_mime_registered_mime_type_list_free(s);
return retval;
} }
const char* default_application_command(const char* type) { const char* default_application_command(const char* type) {
GList *node;
char* value;
char* retval = NULL;
GList *s = gnome_vfs_get_registered_mime_types();
for (node = g_list_first(s); node != NULL; node = g_list_next(node)) {
if (!strcmp((char*)node->data,type)) {
GnomeVFSMimeApplication *a = gnome_vfs_mime_get_default_application(type); GnomeVFSMimeApplication *a = gnome_vfs_mime_get_default_application(type);
if (a) { if (a) {
return a->command; retval = a->command;
} else { break;
return (char*) NULL;
} }
}
}
gnome_vfs_mime_registered_mime_type_list_free(s);
return retval;
} }
%} %}

View File

@ -43,6 +43,7 @@ import gtk.glade
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import Utils import Utils
import GrampsCfg
import ListModel import ListModel
import Plugins import Plugins
from gettext import gettext as _ from gettext import gettext as _
@ -136,8 +137,8 @@ class RelCalc:
commontext = "" commontext = ""
text1 = self.glade.get_widget("text1").get_buffer() text1 = self.glade.get_widget("text1").get_buffer()
p1 = self.person.getPrimaryName().getName() p1 = GrampsCfg.nameof(self.person)
p2 = other_person.getPrimaryName().getName() p2 = GrampsCfg.nameof(other_person)
if rel_string == "": if rel_string == "":
rstr = _("%(person)s and %(active_person)s are not related.") % { rstr = _("%(person)s and %(active_person)s are not related.") % {