(UndoHistory._selection_changed): Enable/disable buttons.

svn: r6624
This commit is contained in:
Alex Roitman 2006-05-12 01:01:10 +00:00
parent 03f4ed0409
commit 4ba6ec794f
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,6 @@
2006-05-11 Alex Roitman <shura@gramps-project.org>
* src/UndoHistory.py (gtk_color_to_str): Correct byte color.
(UndoHistory._selection_changed): Enable/disable buttons.
2006-05-11 Don Allingham <don@gramps-project.org>
* src/PageView.py: fix search tuple

View File

@ -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)