From 5c60081622bacce999a878ff6ec517b0572a0d49 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Fri, 17 Apr 2009 14:58:25 +0000 Subject: [PATCH] ExportFtree: fix typo svn: r12462 --- src/glade/scratchpad.glade | 169 ++-- src/plugins/export/ExportFtree.py | 2 +- src/plugins/import/ImportGedcom.glade | 1263 ++++++++++--------------- src/plugins/import/ImportGedcom.py | 22 +- 4 files changed, 606 insertions(+), 850 deletions(-) diff --git a/src/glade/scratchpad.glade b/src/glade/scratchpad.glade index 4d01c2fe0..c51f3054d 100644 --- a/src/glade/scratchpad.glade +++ b/src/glade/scratchpad.glade @@ -1,111 +1,108 @@ - + + True Clipboard - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False 500 300 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - + dialog + True - False - 0 - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - Clear _All - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-clear - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - GTK_PACK_END - - True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + automatic + automatic + in True True - True - False - False - True - 0 - True - True + 2 + + + + + True + end + + + gtk-help + True + True + True + False + True + + + + False + False + 0 + + + + + Clear _All + True + True + True + False + True + + + + False + False + 1 + + + + + gtk-clear + True + True + True + False + True + + + + False + False + 2 + + + + + gtk-close + True + True + True + False + True + + + + False + False + 3 + + + + + False + end + 0 diff --git a/src/plugins/export/ExportFtree.py b/src/plugins/export/ExportFtree.py index 19a558f7c..bc1759b84 100644 --- a/src/plugins/export/ExportFtree.py +++ b/src/plugins/export/ExportFtree.py @@ -293,7 +293,7 @@ def get_name(name, count): """returns a name string built from the components of the Name instance, in the form of Firstname Surname""" - return = (name.first_name + ' ' + + return (name.first_name + ' ' + (name.prefix + ' ' if name.prefix else '') + name.surname + (str(count) if count != -1 else '') + diff --git a/src/plugins/import/ImportGedcom.glade b/src/plugins/import/ImportGedcom.glade index 414f2f6e4..97fd8060c 100644 --- a/src/plugins/import/ImportGedcom.glade +++ b/src/plugins/import/ImportGedcom.glade @@ -1,756 +1,507 @@ - - - - - - - True - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - True - 600 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 5 - False - False - - - - - - 12 - True - 3 - 5 - False - 6 - 12 - - - - True - True - False - 0 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - True - <b>Warning messages</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - 5 - 2 - 3 - fill - - - - - - True - True - False - 0 - - - - True - 8 - 5 - False - 6 - 6 - - - - True - File: - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Created by: - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - People: - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - True - False - True - 0 - - True - * - False - - - 2 - 3 - 0 - 1 - - - - - - - True - True - False - True - 0 - - True - * - False - - - 2 - 3 - 1 - 2 - - - - - - - True - True - False - True - 0 - - True - * - False - - - 2 - 3 - 2 - 3 - - - - - - - True - Encoding: - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 0 - 1 - fill - - - - - - - True - Version: - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 1 - 2 - fill - - - - - - - True - Families: - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 2 - 3 - fill - - - - - - - True - True - False - True - 10 - - True - * - False - - - 4 - 5 - 0 - 1 - - - - - - - True - True - False - True - 10 - - True - * - False - - - 4 - 5 - 1 - 2 - - - - - - - True - True - False - True - 0 - - True - * - False - - - 4 - 5 - 2 - 3 - - - - - - - True - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - 1 - 5 - 3 - 8 - fill - - - - - - - - True - <b>Status</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - 5 - 1 - 2 - - - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 0 - 5 - 0 - 1 - fill - - - - - - 0 - True - True - - - - - - 12 - True - GTK_BUTTONBOX_END - 12 - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - - - 0 - False - True - - - - - - - - 400 - True - GRAMPS - GEDCOM Encoding - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - <span size="larger" weight="bold">GEDCOM Encoding</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 6 - False - False - - - - - - True - This GEDCOM file has identified itself as using ANSEL encoding. Sometimes, this is in error. If the imported data contains unusual characters, undo the import, and override the character set by selecting a different encoding below. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 6 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 6 - True - False - 6 - - - - - - - - True - False - 0 - - - - True - Encoding: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - default -ANSEL -ANSI (iso-8859-1) -ASCII -UTF8 - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - - 0 - True - True - - - - - - - - - 0 - True - True - - - - - - - + + + + + + + + + + + + default + + + ANSEL + + + ANSI (iso-8859-1) + + + ASCII + + + UTF8 + + + + + True + center + 600 + + + True + + + True + 6 + center + + + False + False + 5 + 0 + + + + + True + 12 + 3 + 5 + 12 + 6 + + + True + True + + + True + True + automatic + automatic + in + + + True + True + False + + + + + + + True + 0 + <b>Warning messages</b> + True + + + + + 5 + 2 + 3 + GTK_FILL + + + + + True + True + + + True + 8 + 5 + 6 + 6 + + + True + 0 + File: + center + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Created by: + center + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + + True + 0 + People: + center + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + + True + True + False + + + 2 + 3 + + + + + + True + True + False + + + 2 + 3 + 1 + 2 + + + + + + True + True + False + + + 2 + 3 + 2 + 3 + + + + + + True + 0 + Encoding: + center + + + 3 + 4 + GTK_FILL + + + + + + True + 0 + Version: + center + + + 3 + 4 + 1 + 2 + GTK_FILL + + + + + + True + 0 + Families: + center + + + 3 + 4 + 2 + 3 + GTK_FILL + + + + + + True + True + False + 10 + + + 4 + 5 + + + + + + True + True + False + 10 + + + 4 + 5 + 1 + 2 + + + + + + True + True + False + + + 4 + 5 + 2 + 3 + + + + + + True + True + False + word + + + 1 + 5 + 3 + 8 + GTK_FILL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + <b>Status</b> + True + + + + + 5 + 1 + 2 + + + + + True + 0.10000000149 + + + 5 + GTK_FILL + + + + + + 1 + + + + + True + 12 + 12 + end + + + gtk-close + True + True + True + False + True + + + False + False + 0 + + + + + False + 2 + + + + + + + 400 + GRAMPS - GEDCOM Encoding + center-on-parent + dialog + False + + + True + + + True + + + True + <span size="larger" weight="bold">GEDCOM Encoding</span> + True + + + False + False + 6 + 0 + + + + + True + 6 + 6 + This GEDCOM file has identified itself as using ANSEL encoding. Sometimes, this is in error. If the imported data contains unusual characters, undo the import, and override the character set by selecting a different encoding below. + True + + + False + False + 1 + + + + + True + 6 + 6 + + + + + + True + + + True + Encoding: + + + False + False + 0 + + + + + True + model1 + + + + 0 + + + + + 1 + + + + + 1 + + + + + + + + 2 + + + + + + + + 1 + + + + + True + end + + + gtk-ok + True + True + True + False + True + + + False + False + 0 + + + + + False + end + 0 + + + + + + okbutton1 + + + diff --git a/src/plugins/import/ImportGedcom.py b/src/plugins/import/ImportGedcom.py index e208d6dd9..c4109ff44 100644 --- a/src/plugins/import/ImportGedcom.py +++ b/src/plugins/import/ImportGedcom.py @@ -29,7 +29,6 @@ #------------------------------------------------------------------------ import os from gettext import gettext as _ -from gtk import glade #------------------------------------------------------------------------ # @@ -57,6 +56,13 @@ except ImportError: LOG.warn("No Config module available using defaults.") DEFAULT_SOURCE = False +#------------------------------------------------------------------------- +# +# Constants +# +#------------------------------------------------------------------------- +_GLADE_FILE = "ImportGedcom.glade" + #------------------------------------------------------------------------- # # importData @@ -84,12 +90,14 @@ def importData(database, filename, callback=None): ifile.close() if not gramps and ansel: - glade_file = os.path.join(os.path.dirname(__file__), - "ImportGedcom.glade") - top = glade.XML(glade_file, 'encoding','gramps') - code = top.get_widget('codeset') + glade_file = os.path.join( + os.path.split(__file__)[0], + _GLADE_FILE) + top = gtk.Builder() + top.add_from_file(glade_file) + code = top.get_object('codeset') code.set_active(0) - dialog = top.get_widget('encoding') + dialog = top.get_object('encoding') dialog.run() enc = ['ANSEL', 'ANSEL', 'ANSI', 'ASCII', 'UTF-8'] code_set = enc[ code.get_active()] @@ -147,4 +155,4 @@ plugin = ImportPlugin(name = _('GEDCOM'), description = _description, import_function = importData, extension = "ged" ) -pmgr.register_plugin(plugin) \ No newline at end of file +pmgr.register_plugin(plugin)