From 4ba6ec794f80f01c2f1b242dfe29e25552d2ecbd Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 12 May 2006 01:01:10 +0000 Subject: [PATCH] (UndoHistory._selection_changed): Enable/disable buttons. svn: r6624 --- gramps2/ChangeLog | 1 + gramps2/src/UndoHistory.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 2600b1528..f8ddd1cec 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,5 +1,6 @@ 2006-05-11 Alex Roitman * src/UndoHistory.py (gtk_color_to_str): Correct byte color. + (UndoHistory._selection_changed): Enable/disable buttons. 2006-05-11 Don Allingham * src/PageView.py: fix search tuple diff --git a/gramps2/src/UndoHistory.py b/gramps2/src/UndoHistory.py index 216aa6374..219fa71f9 100644 --- a/gramps2/src/UndoHistory.py +++ b/gramps2/src/UndoHistory.py @@ -123,6 +123,16 @@ class UndoHistory(ManagedWindow.ManagedWindow): self._paint_rows(0,len(self.model)-1,False) self._paint_rows(start,end,True) + if path[0] < self.db.undoindex+1: + self.redo_button.set_sensitive(False) + self.undo_button.set_sensitive(self.db.undo_available()) + if path[0] > self.db.undoindex+1: + self.undo_button.set_sensitive(False) + self.redo_button.set_sensitive(self.db.redo_available()) + if path[0] == self.db.undoindex+1: + self.undo_button.set_sensitive(self.db.undo_available()) + self.redo_button.set_sensitive(self.db.redo_available()) + def _paint_rows(self,start,end,selected=False): if selected: (fg,bg) = get_colors(self.tree,gtk.STATE_SELECTED)