From db1884afc96437bc278a0f75133ef3cc73826aaa Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Thu, 9 Apr 2009 18:33:49 +0000 Subject: [PATCH] OwnerEditor.py: convert to use gtkbuilder instead of libglade svn: r12418 --- src/plugins/tool/OwnerEditor.py | 23 +- src/plugins/tool/ownereditor.glade | 1129 ++++++++++++++-------------- 2 files changed, 557 insertions(+), 595 deletions(-) diff --git a/src/plugins/tool/OwnerEditor.py b/src/plugins/tool/OwnerEditor.py index adf7932de..353cb274c 100644 --- a/src/plugins/tool/OwnerEditor.py +++ b/src/plugins/tool/OwnerEditor.py @@ -36,7 +36,6 @@ import os # #------------------------------------------------------------------------- import gtk -from gtk import glade #------------------------------------------------------------------------- # @@ -100,21 +99,22 @@ class OwnerEditor(Tool.Tool, ManagedWindow.ManagedWindow): glade_file = os.path.join(base, "ownereditor.glade") # get the main window from glade - top_xml = glade.XML(glade_file, "top", "gramps") + topDialog = gtk.Builder() + topDialog.add_from_file(glade_file) # set gramps style title for the window - window = top_xml.get_widget("top") + window = topDialog.get_object("top") self.set_window(window, - top_xml.get_widget("title"), + topDialog.get_object("title"), _("Database Owner Editor")) # move help button to the left side - action_area = top_xml.get_widget("action_area") - help_button = top_xml.get_widget("help_button") + action_area = topDialog.get_object("action_area") + help_button = topDialog.get_object("help_button") action_area.set_child_secondary(help_button, True) # connect signals - top_xml.signal_autoconnect({ + topDialog.connect_signals({ "on_ok_button_clicked": self.on_ok_button_clicked, "on_cancel_button_clicked": self.close, "on_help_button_clicked": self.on_help_button_clicked, @@ -122,9 +122,10 @@ class OwnerEditor(Tool.Tool, ManagedWindow.ManagedWindow): }) # fetch the popup menu - popup_xml = glade.XML(glade_file, "popup-menu", "gramps") - self.menu = popup_xml.get_widget("popup-menu") - popup_xml.signal_connect("on_menu_activate", self.on_menu_activate) + popup_menu = gtk.Builder() + popup_menu.add_from_file(glade_file) + self.menu = popup_menu.get_object("popup-menu") + popup_menu.connect_signals({"on_menu_activate": self.on_menu_activate}) # get current db owner and attach it to the entries of the window self.owner = self.db.get_researcher() @@ -142,7 +143,7 @@ class OwnerEditor(Tool.Tool, ManagedWindow.ManagedWindow): ] for (name,set_fn,get_fn) in entry: - self.entries.append(MonitoredEntry(top_xml.get_widget(name), + self.entries.append(MonitoredEntry(topDialog.get_object(name), set_fn, get_fn, self.db.readonly)) diff --git a/src/plugins/tool/ownereditor.glade b/src/plugins/tool/ownereditor.glade index ba1d3f449..46f6ff99a 100644 --- a/src/plugins/tool/ownereditor.glade +++ b/src/plugins/tool/ownereditor.glade @@ -1,586 +1,547 @@ - - + + + + + + + + + gtk-go-back + copy_from_db_to_preferences + Copy from DB to Preferences + + + + + + gtk-go-forward + copy_from_preferences_to_db + Copy from Preferences to DB + + + + + + + + + + + + + + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + 500 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + True + False + + + + 6 + True + False + 0 + + + True + GTK_BUTTONBOX_END + 0 + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + GTK_PACK_END + + + + + True + + + 3 + False + True + GTK_PACK_END + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 6 + False + False + + + + + 6 + True + 8 + 2 + False + 6 + 6 + + + True + Name: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + True + Address: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + True + City: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + True + State/Province: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + True + Country: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + True + ZIP/Postal Code: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + True + Phone: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 6 + 7 + fill + + + + + + True + Email: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 7 + 8 + fill + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 0 + 1 + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 1 + 2 + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 2 + 3 + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 3 + 4 + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 4 + 5 + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 5 + 6 + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 6 + 7 + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 7 + 8 + + + + + + 0 + False + True + + + + + + + + - + - - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - 500 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - - True - True - False - - - - - 6 - True - False - 0 - - - - True - GTK_BUTTONBOX_END - 0 - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - - - 3 - False - True - GTK_PACK_END - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 6 - False - False - - - - - - 6 - True - 8 - 2 - False - 6 - 6 - - - - True - Name: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Address: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - City: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - State/Province: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - Country: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - ZIP/Postal Code: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - fill - - - - - - - True - Phone: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 6 - 7 - fill - - - - - - - True - Email: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 7 - 8 - fill - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 0 - 1 - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 1 - 2 - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 2 - 3 - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 3 - 4 - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 4 - 5 - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 5 - 6 - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 6 - 7 - - - - - - - True - True - True - True - 0 - - True - - False - - - 1 - 2 - 7 - 8 - - - - - - 0 - False - True - - - - - - - - - - - - - True - Copy from DB to Preferences - True - - - - - True - gtk-go-back - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Copy from Preferences to DB - True - - - - - True - gtk-go-forward - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - + + +