From 9759ab6aad77f421b842c206461e593c96248ba1 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 25 Apr 2006 19:24:40 +0000 Subject: [PATCH] * src/Bookmarks.py: Redraw "Go to bookmark" menu if changes were made in the bookmard editor; Use fixed column widths in editor. svn: r6436 --- ChangeLog | 3 +++ src/Bookmarks.py | 22 ++++++++++++++-------- src/ViewManager.py | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81afd10a7..7343c1076 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ 2006-04-25 Alex Roitman + * src/Bookmarks.py: Redraw "Go to bookmark" menu if changes were + made in the bookmard editor; Use fixed column widths in editor. + * src/plugins/EventCmp.py: Adapt to RelLib changes. * src/GenericFilter.py (GenericFilter.check_and): Correct logic. * src/PluginUtils/_PluginStatus.py: Use new set_window. diff --git a/src/Bookmarks.py b/src/Bookmarks.py index 6acc48fae..2d314186a 100644 --- a/src/Bookmarks.py +++ b/src/Bookmarks.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Donald N. Allingham +# Copyright (C) 2000-2006 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 @@ -71,7 +71,7 @@ DISABLED = -1 class Bookmarks : "Handle the bookmarks interface for Gramps" - def __init__(self,dbstate,uimanager,bookmarks): + def __init__(self,dbstate,uistate,bookmarks): """ Creates a the bookmark editor. @@ -80,7 +80,7 @@ class Bookmarks : callback - task to connect to the menu item as a callback """ self.dbstate = dbstate - self.uimanager = uimanager + self.uistate = uistate self.bookmarks = bookmarks self.active = DISABLED self.action_group = gtk.ActionGroup('Bookmarks') @@ -93,8 +93,8 @@ class Bookmarks : count = 0 if self.active != DISABLED: - self.uimanager.remove_ui(self.active) - self.uimanager.remove_action_group(self.action_group) + self.uistate.uimanager.remove_ui(self.active) + self.uistate.uimanager.remove_action_group(self.action_group) self.active = DISABLED actions = [] @@ -109,8 +109,8 @@ class Bookmarks : count +=1 f.write(_btm) self.action_group.add_actions(actions) - self.uimanager.insert_action_group(self.action_group,1) - self.active = self.uimanager.add_ui_from_string(f.getvalue()) + self.uistate.uimanager.insert_action_group(self.action_group,1) + self.active = self.uistate.uimanager.add_ui_from_string(f.getvalue()) f.close() def add(self,person_handle): @@ -148,7 +148,7 @@ class Bookmarks : box = gtk.HBox() self.top.vbox.pack_start(box,1,1,5) - name_titles = [(_('Name'),-1,-1),(_('ID'),-1,-1),('',-1,0)] + name_titles = [(_('Name'),-1,200),(_('ID'),-1,50),('',-1,0)] self.namelist = gtk.TreeView() self.namemodel = ListModel.ListModel(self.namelist,name_titles) self.namemodel_cols = len(name_titles) @@ -192,9 +192,12 @@ class Bookmarks : self.namemodel.add([name,gramps_id,person_handle]) self.namemodel.connect_model() + self.modified = False self.response = self.top.run() if self.response == gtk.RESPONSE_HELP: self.help_clicked() + if self.modified: + self.redraw() self.top.destroy() def delete_clicked(self,obj): @@ -205,6 +208,7 @@ class Bookmarks : row = self.namemodel.get_selected_row() self.bookmarks.pop(row) self.namemodel.remove(the_iter) + self.modified = True def up_clicked(self,obj): """Moves the current selection up one row""" @@ -217,6 +221,7 @@ class Bookmarks : self.namemodel.insert(row-1,data,None,1) handle = self.bookmarks.pop(row) self.bookmarks.insert(row-1,handle) + self.modified = True def down_clicked(self,obj): """Moves the current selection down one row""" @@ -229,6 +234,7 @@ class Bookmarks : self.namemodel.insert(row+1,data,None,1) handle = self.bookmarks.pop(row) self.bookmarks.insert(row+1,handle) + self.modified = True def help_clicked(self): """Display the relevant portion of GRAMPS manual""" diff --git a/src/ViewManager.py b/src/ViewManager.py index 61ffc0538..1f4722a7c 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -897,7 +897,7 @@ class ViewManager: self.uimanager.insert_action_group(self.redoactions, 1) def setup_bookmarks(self): - self.bookmarks = Bookmarks.Bookmarks(self.state, self.uimanager, + self.bookmarks = Bookmarks.Bookmarks(self.state, self.uistate, self.state.db.get_bookmarks()) def add_bookmark(self, obj):