summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorGene Z. Ragan <gzr@eazel.com>2000-08-23 22:05:45 +0000
committerGene Ragan <gzr@src.gnome.org>2000-08-23 22:05:45 +0000
commitd8f1bc2499bec966815b9ba32f52a9ceb45a1bfa (patch)
tree4009e8990ae8b8b503ed3b929c1678a6767ee19b /components
parent47a9b00d8bc53f6b4e512a198ae32ff59eeceea0 (diff)
downloadnautilus-d8f1bc2499bec966815b9ba32f52a9ceb45a1bfa.tar.gz
Fixed bug 2282, Undo menu item initially sensitive, but nothing to undo.
2000-08-23 Gene Z. Ragan <gzr@eazel.com> Fixed bug 2282, Undo menu item initially sensitive, but nothing to undo. * components/notes/nautilus-notes.c: (finish_loading_note), (notes_load_location), (make_notes_view): Disconnect the editable object form the undo manager while location is being changed so an undo transaction is not registered during inital text loading. * libnautilus-extensions/nautilus-undo-signal-handlers.c: (nautilus_undo_teardown_nautilus_entry_for_undo), (nautilus_undo_setup_editable_for_undo), (nautilus_undo_teardown_editable_for_undo): When a teardown function is called, also unregister the GtkObject from the undo manager in addtion to signal disconnection.
Diffstat (limited to 'components')
-rw-r--r--components/notes/nautilus-notes.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/components/notes/nautilus-notes.c b/components/notes/nautilus-notes.c
index e2cc0fe19..6fd1657d0 100644
--- a/components/notes/nautilus-notes.c
+++ b/components/notes/nautilus-notes.c
@@ -71,7 +71,9 @@ finish_loading_note (NautilusFile *file,
notes_text,
strlen (notes_text),
&position);
- g_free (notes_text);
+ g_free (notes_text);
+
+ nautilus_undo_setup_editable_for_undo (GTK_EDITABLE (notes->note_text_field));
}
static void
@@ -116,6 +118,7 @@ notes_load_location (NautilusView *view,
Notes *notes)
{
if (strcmp (notes->uri, location) != 0) {
+ nautilus_undo_teardown_editable_for_undo (GTK_EDITABLE (notes->note_text_field));
notes_save_metainfo (notes);
g_free (notes->uri);
notes->uri = g_strdup (location);
@@ -165,10 +168,6 @@ make_notes_view (BonoboGenericFactory *Factory, const char *goad_id, gpointer cl
notes->view = nautilus_view_new (vbox);
gtk_signal_connect (GTK_OBJECT (notes->view), "destroy", do_destroy, notes);
- /* Setup up text field for undo */
- nautilus_undo_setup_editable_for_undo (GTK_EDITABLE (notes->note_text_field));
- nautilus_undo_editable_set_undo_key (GTK_EDITABLE (notes->note_text_field), TRUE);
-
notes_object_count++;
/* handle events */
@@ -180,6 +179,10 @@ make_notes_view (BonoboGenericFactory *Factory, const char *goad_id, gpointer cl
(GTK_EDITABLE (notes->note_text_field),
nautilus_view_get_bonobo_control (notes->view));
+ /* Setup up text field for undo */
+ nautilus_undo_setup_editable_for_undo (GTK_EDITABLE (notes->note_text_field));
+ nautilus_undo_editable_set_undo_key (GTK_EDITABLE (notes->note_text_field), TRUE);
+
return BONOBO_OBJECT (notes->view);
}