diff --git a/src/plugins/BookReport.py b/src/plugins/BookReport.py index c25abd527..cd90ef478 100644 --- a/src/plugins/BookReport.py +++ b/src/plugins/BookReport.py @@ -59,7 +59,6 @@ except: #------------------------------------------------------------------------- import gtk import gobject -from gtk import glade from gtk import RESPONSE_OK #------------------------------------------------------------------------- @@ -573,27 +572,30 @@ class BookListDisplay: self.dosave = dosave base = os.path.dirname(__file__) glade_file = os.path.join(base,"book.glade") - self.xml = glade.XML(glade_file, "booklist", "gramps") - self.top = self.xml.get_widget('booklist') + self.xml = gtk.Builder() + self.xml.add_from_source('/tmp/book.glade') + self.xml.get_object('top').hide() + #self.xml = glade.XML(glade_file, "booklist", "gramps") + self.top = self.xml.get_object('booklist') ManagedWindow.set_titles(self.top, - self.xml.get_widget('title'),_('Available Books')) + self.xml.get_object('title'),_('Available Books')) if nodelete: - delete_button = self.xml.get_widget("delete_button") + delete_button = self.xml.get_object("delete_button") delete_button.hide() - self.xml.signal_autoconnect({ + self.xml.connect_signals({ "on_booklist_cancel_clicked" : self.on_booklist_cancel_clicked, "on_booklist_ok_clicked" : self.on_booklist_ok_clicked, "on_booklist_delete_clicked" : self.on_booklist_delete_clicked }) - title_label = self.xml.get_widget('title') + title_label = self.xml.get_object('title') title_label.set_text(Utils.title(_('Book List'))) title_label.set_use_markup(True) - self.blist = ListModel.ListModel(self.xml.get_widget("list"), + self.blist = ListModel.ListModel(self.xml.get_object("list"), [('Name',-1,10)],) self.redraw() self.selection = None @@ -685,13 +687,15 @@ class BookReportSelector(ManagedWindow.ManagedWindow): base = os.path.dirname(__file__) glade_file = os.path.join(base,"book.glade") - - self.xml = glade.XML(glade_file, "top", "gramps") - window = self.xml.get_widget("top") - title_label = self.xml.get_widget('title') + self.xml = gtk.Builder() + self.xml.add_from_file('/tmp/book.glade') + self.xml.get_object('booklist').hide() + #self.xml = glade.XML(glade_file, "top", "gramps") + window = self.xml.get_object("top") + title_label = self.xml.get_object('title') self.set_window(window, title_label, self.title) - self.xml.signal_autoconnect({ + self.xml.connect_signals({ "on_add_clicked" : self.on_add_clicked, "on_remove_clicked" : self.on_remove_clicked, "on_up_clicked" : self.on_up_clicked, @@ -705,19 +709,19 @@ class BookReportSelector(ManagedWindow.ManagedWindow): "destroy_passed_object" : self.close }) - self.avail_tree = self.xml.get_widget("avail_tree") - self.book_tree = self.xml.get_widget("book_tree") + self.avail_tree = self.xml.get_object("avail_tree") + self.book_tree = self.xml.get_object("book_tree") self.avail_tree.connect('button-press-event', self.av_button_press) self.book_tree.connect('button-press-event', self.bk_button_press) - self.name_entry = self.xml.get_widget("name_entry") + self.name_entry = self.xml.get_object("name_entry") self.name_entry.set_text(_('New Book')) - avail_label = self.xml.get_widget('avail_label') + avail_label = self.xml.get_object('avail_label') avail_label.set_text("%s" % _("_Available items")) avail_label.set_use_markup(True) avail_label.set_use_underline(True) - book_label = self.xml.get_widget('book_label') + book_label = self.xml.get_object('book_label') book_label.set_text("%s" % _("Current _book")) book_label.set_use_underline(True) book_label.set_use_markup(True) diff --git a/src/plugins/book.glade b/src/plugins/book.glade index 53718c963..ae0f74768 100644 --- a/src/plugins/book.glade +++ b/src/plugins/book.glade @@ -1,752 +1,700 @@ - - - - - - - 600 - 600 - True - Book - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - - - - True - False - 0 - - - - True - False - 0 - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 12 - 12 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - Book _name: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 12 - 0 - name_entry - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - 6 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Clear the book - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-clear - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Save current set of configured selections - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-save - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Open previously created book - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-open - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Manage previously created books - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-index - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - 6 - False - False - GTK_PACK_END - - - - - 0 - False - False - - - - - - True - 2 - 1 - False - 0 - 0 - - - - True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 12 - 6 - avail_tree - - - 0 - 1 - 0 - 1 - - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - - - - - 0 - 1 - 1 - 2 - 12 - 6 - fill - - - - - 6 - True - True - - - - - - True - 2 - 1 - False - 0 - 0 - - - - True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 12 - 6 - book_tree - - - 0 - 1 - 0 - 1 - - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_ETCHED_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - - - - - 0 - 1 - 1 - 2 - 12 - 6 - fill - - - - - 6 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - - - - - True - False - 2 - - - - True - Add an item to the book - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Remove currently selected item from the book - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-remove - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Move current selection one step up in the book - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-go-up - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Move current selection one step down in the book - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-go-down - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Configure currently selected item - True - True - GTK_RELIEF_NORMAL - - - - - True - gtk-preferences - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - 8 - False - False - GTK_PACK_END - - - - - 10 - False - False - GTK_PACK_END - - - - - 0 - True - True - - - - - - 6 - True - GTK_BUTTONBOX_END - 6 - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - - - - - - 0 - False - True - - - - - - - - 300 - True - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - 0 - - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - -7 - - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - -5 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 6 - - - 0 - False - False - - - - - - 12 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - + + + + + 600 + 600 + True + Book + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + + + True + False + 0 + + + True + False + 0 + + + True + False + 0 + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 12 + 12 + + + 0 + False + False + + + + + True + False + 0 + + + True + False + 0 + + + True + Book _name: + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 12 + 0 + name_entry + + + 0 + False + False + + + + + True + True + True + True + 0 + + True + * + False + + + 6 + True + True + + + + + 0 + True + True + + + + + True + False + 0 + + + True + Clear the book + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-clear + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + True + Save current set of configured selections + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-save + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + True + Open previously created book + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-open + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + True + Manage previously created books + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-index + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 6 + False + False + GTK_PACK_END + + + + + 0 + False + False + + + + + True + 2 + 1 + False + 0 + 0 + + + True + + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 12 + 6 + avail_tree + + + 0 + 1 + 0 + 1 + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + True + True + True + False + False + True + + + + + 0 + 1 + 1 + 2 + 12 + 6 + fill + + + + + 6 + True + True + + + + + True + 2 + 1 + False + 0 + 0 + + + True + + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 12 + 6 + book_tree + + + 0 + 1 + 0 + 1 + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN + GTK_CORNER_TOP_LEFT + + + True + True + True + False + False + True + + + + + 0 + 1 + 1 + 2 + 12 + 6 + fill + + + + + 6 + True + True + + + + + 0 + True + True + + + + + True + False + 0 + + + + + + True + False + 2 + + + True + Add an item to the book + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + True + Remove currently selected item from the book + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + True + Move current selection one step up in the book + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-go-up + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + True + Move current selection one step down in the book + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-go-down + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + True + Configure currently selected item + True + True + GTK_RELIEF_NORMAL + + + + True + gtk-preferences + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 8 + False + False + GTK_PACK_END + + + + + 10 + False + False + GTK_PACK_END + + + + + 0 + True + True + + + + + 6 + True + GTK_BUTTONBOX_END + 6 + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + + + + + + 0 + False + True + + + + + + + 300 + True + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + False + + + True + False + 0 + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-delete + True + GTK_RELIEF_NORMAL + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + + + + + + 0 + False + True + GTK_PACK_END + + + + + True + False + 0 + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 6 + + + 0 + False + False + + + + + 12 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + True + True + False + False + False + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + delete_button + close_button + ok_button + + +