diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f83d8d3bf..570f57937 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -4,6 +4,12 @@ * src/gramps_main.py (delete_person_response): Object/handle mixups, remove unneeded commits. + * src/gramps_main.py (undo_callback,redo_callback): Minor + improvements, (read_file): Always re-initialize Undo and Redo items + to insensitive blanks after new database load; (post_load): Set up + database's callbacks for Undo and Redo after load. + * src/gramps.glade: Make Redo label non-stock to allow label change. + 2005-03-29 Richard Taylor * src/plugins/ScratchPad.py (on_object_select_row): fixed the drop of text into TextView widgets. diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index c08f0856f..b92a22687 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -56,7 +56,7 @@ - + True gtk-new 1 @@ -78,7 +78,7 @@ - + True gtk-open 1 @@ -115,7 +115,7 @@ - + True gtk-convert 1 @@ -137,7 +137,7 @@ - + True gtk-save-as 1 @@ -159,7 +159,7 @@ - + True gtk-save-as 1 @@ -196,7 +196,7 @@ - + True gtk-quit 1 @@ -231,7 +231,7 @@ - + True gtk-undo 1 @@ -247,8 +247,22 @@ True - GNOMEUIINFO_MENU_REDO_ITEM - + _Redo + True + + + + + + True + gtk-redo + 1 + 0.5 + 0.5 + 0 + 0 + + @@ -268,7 +282,7 @@ - + True gtk-add 1 @@ -291,7 +305,7 @@ - + True gtk-remove 1 @@ -329,7 +343,7 @@ - + True gtk-convert 1 @@ -356,7 +370,7 @@ - + True gtk-preferences 1 @@ -377,7 +391,7 @@ - + True gtk-properties 1 @@ -398,7 +412,7 @@ - + True gtk-home 1 @@ -484,7 +498,7 @@ - + True gtk-index 1 @@ -506,7 +520,7 @@ - + True gnome-stock-book-open 1 @@ -579,7 +593,7 @@ - + True gtk-help 1 @@ -600,7 +614,7 @@ - + True gnome-stock-book-open 1 @@ -627,7 +641,7 @@ - + True gtk-jump-to 1 @@ -648,7 +662,7 @@ - + True gnome-stock-mail 1 @@ -702,7 +716,7 @@ - + True gnome-stock-about 1 diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index d171ddf09..5921f62ce 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -296,9 +296,6 @@ class Gramps: self.redolabel = self.gtop.get_widget('redolabel') self.open_recent = self.gtop.get_widget('open_recent1') - self.db.set_undo_callback(self.undo_callback) - self.db.set_redo_callback(self.redo_callback) - self.child_model = gtk.ListStore( gobject.TYPE_INT, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, @@ -477,25 +474,22 @@ class Gramps: self.build_recent_menu() def undo_callback(self,text): - if text == None: - self.undolabel.set_sensitive(0) - self.undolabel.get_children()[0].set_text(_("_Undo")) - self.undolabel.get_children()[0].set_use_underline(1) - else: - self.undolabel.set_sensitive(1) - label = self.undolabel.get_children()[0] + self.undolabel.set_sensitive(bool(text)) + label = self.undolabel.get_children()[0] + if text: label.set_text(text) - label.set_use_underline(1) + else: + label.set_text(_("_Undo")) + label.set_use_underline(1) def redo_callback(self,text): - if text == None: - self.redolabel.set_sensitive(0) - self.redolabel.get_children()[0].set_text(_("_Redo")) - else: - self.redolabel.set_sensitive(1) - label = self.redolabel.get_children()[0] + self.redolabel.set_sensitive(bool(text)) + label = self.redolabel.get_children()[0] + if text: label.set_text(text) - label.set_use_underline(1) + else: + label.set_text(_("_Redo")) + label.set_use_underline(1) def undo(self,*args): self.db.undo() @@ -1211,12 +1205,13 @@ class Gramps: _('%s could not be opened.' % filename) + '\n' + msg[1]) return 0 - self.topWindow.set_resizable(True) + # Undo/Redo always start with standard labels and insensitive state + self.undo_callback(None) + self.redo_callback(None) + # The rest depends on readonly-ness of the database self.gtop.get_widget('import1').set_sensitive(not self.db.readonly) self.gtop.get_widget('abandon').set_sensitive(not self.db.readonly) - self.gtop.get_widget('undolabel').set_sensitive(not self.db.readonly) - self.gtop.get_widget('redolabel').set_sensitive(not self.db.readonly) self.gtop.get_widget('add_item').set_sensitive(not self.db.readonly) self.gtop.get_widget('remove_item').set_sensitive(not self.db.readonly) self.gtop.get_widget('merge').set_sensitive(not self.db.readonly) @@ -1686,6 +1681,10 @@ class Gramps: self.db.set_researcher(owner) self.setup_bookmarks() + + self.db.set_undo_callback(self.undo_callback) + self.db.set_redo_callback(self.redo_callback) + if self.db.need_upgrade(): if callback: callback(_('Upgrading database...'))