diff options
-rw-r--r-- | ChangeLog | 40 | ||||
-rw-r--r-- | components/websearch/ntl-web-search.c | 1 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-entry.c | 92 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-entry.h | 5 | ||||
-rw-r--r-- | libnautilus-private/nautilus-entry.c | 92 | ||||
-rw-r--r-- | libnautilus-private/nautilus-entry.h | 5 | ||||
-rw-r--r-- | libnautilus/nautilus-undo-transaction.c | 15 | ||||
-rw-r--r-- | libnautilus/nautilus-undoable.c | 48 | ||||
-rw-r--r-- | libnautilus/nautilus-undoable.h | 4 | ||||
-rw-r--r-- | src/file-manager/fm-properties-window.c | 3 | ||||
-rw-r--r-- | src/nautilus-bookmarks-window.c | 9 | ||||
-rw-r--r-- | src/nautilus-location-bar.c | 21 | ||||
-rw-r--r-- | src/nautilus-location-bar.h | 3 | ||||
-rw-r--r-- | src/nautilus-navigation-window.c | 1 | ||||
-rw-r--r-- | src/nautilus-object-window.c | 1 | ||||
-rw-r--r-- | src/nautilus-spatial-window.c | 1 | ||||
-rw-r--r-- | src/nautilus-window.c | 1 | ||||
-rw-r--r-- | src/ntl-window.c | 1 |
18 files changed, 197 insertions, 146 deletions
@@ -1,3 +1,43 @@ +2000-05-25 Gene Z. Ragan <gzr@eazel.com> + + More work on undo. Note that undo in text entry fields still + misbehaves. More improvements are on the way. + + * components/websearch/ntl-web-search.c: + (make_obj): + Removed obsolete enable undo code. + + * libnautilus-extensions/nautilus-entry.c: + * libnautilus-extensions/nautilus-entry.h: + (nautilus_entry_initialize_class), (nautilus_entry_key_press), + (nautilus_entry_insert_text), (nautilus_entry_delete_text), + (register_edit_undo), (nautilus_entry_set_undo_key): + Removed the enable_undo function and made undo functionality + a default feature of NautilusEntry. + + * libnautilus/nautilus-undo-transaction.c: + (nautilus_undo_transaction_add_undoable), + (nautilus_undo_transaction_undo): + + * libnautilus/nautilus-undoable.c: + * libnautilus/nautilus-undoable.h: + (nautilus_undoable_save_undo_snapshot), (nautilus_undo_unregister): + + * src/file-manager/fm-properties-window.c: (create_basic_page): + Removed obsolete enable undo code. + + * src/nautilus-bookmarks-window.c: (on_text_field_focus_in_event), + (on_text_field_focus_out_event), (on_window_delete_event): + Removed obsolete enable undo code. + + * src/nautilus-location-bar.c: + * src/nautilus-location-bar.h: + (nautilus_location_bar_set_location): + Removed obsolete enable undo code. + + * src/ntl-window.c: (nautilus_window_constructed): + Removed obsolete enable undo code. + 2000-05-25 Eskil Heyn Olsen <set EMAIL_ADDRESS environment variable> * components/services/install/command-line/Makefile.am: diff --git a/components/websearch/ntl-web-search.c b/components/websearch/ntl-web-search.c index 042e766a7..282c0fda5 100644 --- a/components/websearch/ntl-web-search.c +++ b/components/websearch/ntl-web-search.c @@ -187,7 +187,6 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure) web_search_populate_engines(hview); hview->ent_params = nautilus_entry_new(); - nautilus_entry_enable_undo (NAUTILUS_ENTRY (hview->ent_params), TRUE); gtk_signal_connect(GTK_OBJECT(hview->ent_params), "activate", do_search, hview); gtk_container_add(GTK_CONTAINER(vbox), hview->ent_params); diff --git a/libnautilus-extensions/nautilus-entry.c b/libnautilus-extensions/nautilus-entry.c index ee6dd5886..de670401c 100644 --- a/libnautilus-extensions/nautilus-entry.c +++ b/libnautilus-extensions/nautilus-entry.c @@ -36,14 +36,26 @@ #include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> +#include <libnautilus/nautilus-undo-manager.h> #include <libnautilus/nautilus-undoable.h> +#include <libnautilus/nautilus-undo.h> + +#include <orb/orbit.h> static void nautilus_entry_initialize (NautilusEntry *entry); static void nautilus_entry_initialize_class (NautilusEntryClass *class); -static void nautilus_entry_destroy (GtkObject *object); -static void nautilus_entry_changed (GtkEditable *entry); +static void nautilus_entry_destroy (GtkObject *object); static gint nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event); +static void nautilus_entry_insert_text (GtkEditable *editable, + const gchar *text, + gint length, + gint *position); +static void nautilus_entry_delete_text (GtkEditable *editable, + gint start_pos, + gint end_pos); + +static void update_undo_text (NautilusEntry *entry); /* Undo callbacks */ static void register_edit_undo (NautilusEntry *entry); @@ -66,7 +78,10 @@ nautilus_entry_initialize_class (NautilusEntryClass *class) widget_class->key_press_event = nautilus_entry_key_press; object_class->destroy = nautilus_entry_destroy; - editable_class->changed = nautilus_entry_changed; + + editable_class->insert_text = nautilus_entry_insert_text; + editable_class->delete_text = nautilus_entry_delete_text; + } static void @@ -115,7 +130,6 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event) /* Undo */ case 'z': if ((event->state & GDK_CONTROL_MASK) != 0 - && entry->use_undo && entry->handle_undo_key) { nautilus_undo (GTK_OBJECT (widget)); return FALSE; @@ -175,30 +189,45 @@ nautilus_entry_select_all_at_idle (NautilusEntry *entry) } -/** - * nautilus_entry_changed - * - * @entry: A NautilusEntry - **/ -static void -nautilus_entry_changed (GtkEditable *editable) +static void +nautilus_entry_insert_text (GtkEditable *editable, const gchar *text, + gint length, gint *position) { NautilusEntry *entry; - - g_assert (GTK_IS_EDITABLE (editable)); - g_assert (NAUTILUS_IS_ENTRY (editable)); entry = NAUTILUS_ENTRY(editable); /* Register undo transaction */ - if (entry->use_undo && !entry->undo_registered) { + if (!entry->undo_registered) { + update_undo_text (entry); register_edit_undo (entry); entry->undo_registered = TRUE; } - - NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, changed, (editable)); + + NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, insert_text, + (editable, text, length, position)); } + +static void +nautilus_entry_delete_text (GtkEditable *editable, gint start_pos, gint end_pos) +{ + NautilusEntry *entry; + + entry = NAUTILUS_ENTRY(editable); + + /* Register undo transaction */ + if (!entry->undo_registered) { + update_undo_text (entry); + register_edit_undo (entry); + entry->undo_registered = TRUE; + } + + NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, delete_text, + (editable, start_pos, end_pos)); +} + + /* save_undo_snapshot_callback * * Get text at start of edit operation and store in undo data as @@ -206,11 +235,7 @@ nautilus_entry_changed (GtkEditable *editable) */ static void register_edit_undo (NautilusEntry *entry) -{ - if (!entry->use_undo) { - return; - } - +{ nautilus_undo_register (GTK_OBJECT (entry), restore_from_undo_snapshot_callback, @@ -254,34 +279,13 @@ restore_from_undo_snapshot_callback (GtkObject *target, gpointer callback_data) entry->undo_registered = FALSE; } -/* nautilus_entry_enable_undo - * - * Enable undo mechanism in entry item. - */ -void -nautilus_entry_enable_undo (NautilusEntry *entry, gboolean value) -{ - g_return_if_fail (NAUTILUS_IS_ENTRY (entry)); - - entry->use_undo = value; - - if (value) { - if (!entry->undo_registered) { - update_undo_text (entry); - } - } else { - /* FIXME */ - /* nautilus_undo_unregister (GTK_OBJECT (entry)); */ - } -} - /* nautilus_entry_enable_undo_key * * Allow the use of ctrl-z from within widget. This should only be * set if there is no menu bar to use to undo the widget. */ void -nautilus_entry_enable_undo_key (NautilusEntry *entry, gboolean value) +nautilus_entry_set_undo_key (NautilusEntry *entry, gboolean value) { entry->handle_undo_key = value; } diff --git a/libnautilus-extensions/nautilus-entry.h b/libnautilus-extensions/nautilus-entry.h index d35a2cbad..01e529334 100644 --- a/libnautilus-extensions/nautilus-entry.h +++ b/libnautilus-extensions/nautilus-entry.h @@ -51,7 +51,6 @@ struct NautilusEntry { gchar *undo_text; gboolean undo_registered; - gboolean use_undo; gboolean handle_undo_key; }; @@ -63,9 +62,7 @@ GtkType nautilus_entry_get_type (void); GtkWidget* nautilus_entry_new (void); void nautilus_entry_select_all (NautilusEntry *entry); void nautilus_entry_select_all_at_idle (NautilusEntry *entry); -void nautilus_entry_enable_undo (NautilusEntry *entry, - gboolean value); -void nautilus_entry_enable_undo_key (NautilusEntry *entry, +void nautilus_entry_set_undo_key (NautilusEntry *entry, gboolean value); END_GNOME_DECLS diff --git a/libnautilus-private/nautilus-entry.c b/libnautilus-private/nautilus-entry.c index ee6dd5886..de670401c 100644 --- a/libnautilus-private/nautilus-entry.c +++ b/libnautilus-private/nautilus-entry.c @@ -36,14 +36,26 @@ #include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> +#include <libnautilus/nautilus-undo-manager.h> #include <libnautilus/nautilus-undoable.h> +#include <libnautilus/nautilus-undo.h> + +#include <orb/orbit.h> static void nautilus_entry_initialize (NautilusEntry *entry); static void nautilus_entry_initialize_class (NautilusEntryClass *class); -static void nautilus_entry_destroy (GtkObject *object); -static void nautilus_entry_changed (GtkEditable *entry); +static void nautilus_entry_destroy (GtkObject *object); static gint nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event); +static void nautilus_entry_insert_text (GtkEditable *editable, + const gchar *text, + gint length, + gint *position); +static void nautilus_entry_delete_text (GtkEditable *editable, + gint start_pos, + gint end_pos); + +static void update_undo_text (NautilusEntry *entry); /* Undo callbacks */ static void register_edit_undo (NautilusEntry *entry); @@ -66,7 +78,10 @@ nautilus_entry_initialize_class (NautilusEntryClass *class) widget_class->key_press_event = nautilus_entry_key_press; object_class->destroy = nautilus_entry_destroy; - editable_class->changed = nautilus_entry_changed; + + editable_class->insert_text = nautilus_entry_insert_text; + editable_class->delete_text = nautilus_entry_delete_text; + } static void @@ -115,7 +130,6 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event) /* Undo */ case 'z': if ((event->state & GDK_CONTROL_MASK) != 0 - && entry->use_undo && entry->handle_undo_key) { nautilus_undo (GTK_OBJECT (widget)); return FALSE; @@ -175,30 +189,45 @@ nautilus_entry_select_all_at_idle (NautilusEntry *entry) } -/** - * nautilus_entry_changed - * - * @entry: A NautilusEntry - **/ -static void -nautilus_entry_changed (GtkEditable *editable) +static void +nautilus_entry_insert_text (GtkEditable *editable, const gchar *text, + gint length, gint *position) { NautilusEntry *entry; - - g_assert (GTK_IS_EDITABLE (editable)); - g_assert (NAUTILUS_IS_ENTRY (editable)); entry = NAUTILUS_ENTRY(editable); /* Register undo transaction */ - if (entry->use_undo && !entry->undo_registered) { + if (!entry->undo_registered) { + update_undo_text (entry); register_edit_undo (entry); entry->undo_registered = TRUE; } - - NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, changed, (editable)); + + NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, insert_text, + (editable, text, length, position)); } + +static void +nautilus_entry_delete_text (GtkEditable *editable, gint start_pos, gint end_pos) +{ + NautilusEntry *entry; + + entry = NAUTILUS_ENTRY(editable); + + /* Register undo transaction */ + if (!entry->undo_registered) { + update_undo_text (entry); + register_edit_undo (entry); + entry->undo_registered = TRUE; + } + + NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, delete_text, + (editable, start_pos, end_pos)); +} + + /* save_undo_snapshot_callback * * Get text at start of edit operation and store in undo data as @@ -206,11 +235,7 @@ nautilus_entry_changed (GtkEditable *editable) */ static void register_edit_undo (NautilusEntry *entry) -{ - if (!entry->use_undo) { - return; - } - +{ nautilus_undo_register (GTK_OBJECT (entry), restore_from_undo_snapshot_callback, @@ -254,34 +279,13 @@ restore_from_undo_snapshot_callback (GtkObject *target, gpointer callback_data) entry->undo_registered = FALSE; } -/* nautilus_entry_enable_undo - * - * Enable undo mechanism in entry item. - */ -void -nautilus_entry_enable_undo (NautilusEntry *entry, gboolean value) -{ - g_return_if_fail (NAUTILUS_IS_ENTRY (entry)); - - entry->use_undo = value; - - if (value) { - if (!entry->undo_registered) { - update_undo_text (entry); - } - } else { - /* FIXME */ - /* nautilus_undo_unregister (GTK_OBJECT (entry)); */ - } -} - /* nautilus_entry_enable_undo_key * * Allow the use of ctrl-z from within widget. This should only be * set if there is no menu bar to use to undo the widget. */ void -nautilus_entry_enable_undo_key (NautilusEntry *entry, gboolean value) +nautilus_entry_set_undo_key (NautilusEntry *entry, gboolean value) { entry->handle_undo_key = value; } diff --git a/libnautilus-private/nautilus-entry.h b/libnautilus-private/nautilus-entry.h index d35a2cbad..01e529334 100644 --- a/libnautilus-private/nautilus-entry.h +++ b/libnautilus-private/nautilus-entry.h @@ -51,7 +51,6 @@ struct NautilusEntry { gchar *undo_text; gboolean undo_registered; - gboolean use_undo; gboolean handle_undo_key; }; @@ -63,9 +62,7 @@ GtkType nautilus_entry_get_type (void); GtkWidget* nautilus_entry_new (void); void nautilus_entry_select_all (NautilusEntry *entry); void nautilus_entry_select_all_at_idle (NautilusEntry *entry); -void nautilus_entry_enable_undo (NautilusEntry *entry, - gboolean value); -void nautilus_entry_enable_undo_key (NautilusEntry *entry, +void nautilus_entry_set_undo_key (NautilusEntry *entry, gboolean value); END_GNOME_DECLS diff --git a/libnautilus/nautilus-undo-transaction.c b/libnautilus/nautilus-undo-transaction.c index 724d4425b..f84924993 100644 --- a/libnautilus/nautilus-undo-transaction.c +++ b/libnautilus/nautilus-undo-transaction.c @@ -220,16 +220,16 @@ nautilus_undo_transaction_add_undoable (NautilusUndoTransaction *transaction, NautilusUndoable *undoable) { if (transaction == NULL) { - g_warning("Cannot add undoable to a NULL transaction"); + g_warning ("Cannot add undoable to a NULL transaction"); return FALSE; } if (undoable == NULL) { - g_warning("Cannot add a NULL undoable to a transaction"); + g_warning ("Cannot add a NULL undoable to a transaction"); return FALSE; } - transaction->transaction_list = g_list_append(transaction->transaction_list, undoable); + transaction->transaction_list = g_list_append (transaction->transaction_list, undoable); return TRUE; } @@ -249,15 +249,16 @@ nautilus_undo_transaction_undo (NautilusUndoTransaction *transaction) if (transaction == NULL) { return; } - - for ( index = 0; index < g_list_length(transaction->transaction_list); index++) { + + for ( index = 0; index < g_list_length (transaction->transaction_list); index++) { /* Get pointer to undoable */ - undoable = g_list_nth_data(transaction->transaction_list, index); + undoable = g_list_nth_data (transaction->transaction_list, index); /* Send object restore from undo signal */ - if (undoable != NULL) + if (undoable != NULL) { nautilus_undoable_restore_from_undo_snapshot (undoable); + } } } diff --git a/libnautilus/nautilus-undoable.c b/libnautilus/nautilus-undoable.c index be701e9f3..6965b9e84 100644 --- a/libnautilus/nautilus-undoable.c +++ b/libnautilus/nautilus-undoable.c @@ -49,7 +49,6 @@ static guint signals[LAST_SIGNAL]; static void nautilus_undoable_initialize_class (NautilusUndoableClass *class); static void nautilus_undoable_initialize (NautilusUndoable *item); static void destroy (GtkObject *object); -static void nautilus_undo_unregister (GtkObject *target); NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusUndoable, nautilus_undoable, GTK_TYPE_OBJECT) @@ -130,6 +129,7 @@ nautilus_undoable_save_undo_snapshot (NautilusUndoTransaction *transaction, GtkO { gboolean result; NautilusUndoable *undoable; + GList *transaction_list; /* Init Undoable */ undoable = NAUTILUS_UNDOABLE(nautilus_undoable_new()); @@ -144,6 +144,16 @@ nautilus_undoable_save_undo_snapshot (NautilusUndoTransaction *transaction, GtkO /* Add undoable to current transaction */ result = nautilus_undo_transaction_add_undoable (transaction, undoable); + /* Add transaction to objects transaction list */ + transaction_list = gtk_object_get_data (target, NAUTILUS_UNDO_TRANSACTION_LIST_NAME); + if (transaction_list == NULL) { + /* Create list and add to object */ + transaction_list = g_list_alloc(); + transaction_list = NULL; + gtk_object_set_data (target, NAUTILUS_UNDO_TRANSACTION_LIST_NAME, transaction_list); + } + transaction_list = g_list_append (transaction_list, undoable); + /* Fire SAVE_UNDO_SNAPSHOT signal */ gtk_signal_emit (GTK_OBJECT (undoable), signals[SAVE_UNDO_SNAPSHOT], @@ -315,16 +325,42 @@ nautilus_undo_register_full (GList *atoms, } /* Cover for forgetting about all undo relating to a particular target. */ -static void +void nautilus_undo_unregister (GtkObject *target) { + Nautilus_Undo_Manager manager; + GList *transaction_list; + int index; + CORBA_Environment ev; + Nautilus_Undo_Transaction transaction; + g_return_if_fail (GTK_IS_OBJECT (target)); - /* Right now we just call the "real" code over in the undo manager. - * FIXME: We will have to figure out which transactions this affects - * and remove ourselves from them. It's not clear how to do that. - */ + manager = nautilus_get_undo_manager ( GTK_OBJECT (target)); + if (manager != CORBA_OBJECT_NIL) { + return; + } + transaction_list = gtk_object_get_data (target, NAUTILUS_UNDO_TRANSACTION_LIST_NAME); + if (transaction_list == NULL) { + return; + } + + CORBA_exception_init (&ev); + + for ( index = 0; index < g_list_length (transaction_list); index++) { + /* Get pointer to transaction */ + transaction = g_list_nth_data(transaction_list, index); + + if (transaction != CORBA_OBJECT_NIL) { + Nautilus_Undo_Manager_forget (manager, transaction, &ev); + } + } + + CORBA_exception_free (&ev); + + g_list_free (transaction_list); + /* Perhaps this should also unregister all children if called on a * GtkContainer? That might be handy. */ diff --git a/libnautilus/nautilus-undoable.h b/libnautilus/nautilus-undoable.h index 2af3ccfa6..1230cf1df 100644 --- a/libnautilus/nautilus-undoable.h +++ b/libnautilus/nautilus-undoable.h @@ -29,6 +29,8 @@ #include <gtk/gtksignal.h> #include <gtk/gtkmain.h> +#define NAUTILUS_UNDO_TRANSACTION_LIST_NAME "nautilus_undo_transaction_list" + #define NAUTILUS_TYPE_UNDOABLE \ (nautilus_undoable_get_type ()) #define NAUTILUS_UNDOABLE(obj) \ @@ -101,6 +103,8 @@ void nautilus_undo_register_full (GList *atoms, const char *redo_menu_item_name, const char *redo_menu_item_description); +void nautilus_undo_unregister (GtkObject *target); + /* Performing an undo explicitly. Only for use by objects "out in the field". * The menu bar itself uses a richer API in the undo manager. */ diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index cb53beb01..9b9004e64 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -577,8 +577,7 @@ create_basic_page (GtkNotebook *notebook, NautilusFile *file) gtk_widget_grab_focus (GTK_WIDGET (name_field)); /* Enable undo in name field */ - nautilus_entry_enable_undo (NAUTILUS_ENTRY(name_field), FALSE); - nautilus_entry_enable_undo_key (NAUTILUS_ENTRY(name_field), FALSE); + nautilus_entry_set_undo_key (NAUTILUS_ENTRY(name_field), FALSE); /* React to name changes from elsewhere. */ gtk_signal_connect_object_while_alive (GTK_OBJECT (file), diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c index 9d95af249..c1369891c 100644 --- a/src/nautilus-bookmarks-window.c +++ b/src/nautilus-bookmarks-window.c @@ -522,8 +522,7 @@ on_text_field_focus_in_event (GtkWidget *widget, g_assert (NAUTILUS_IS_ENTRY (widget)); nautilus_entry_select_all (NAUTILUS_ENTRY (widget)); - nautilus_entry_enable_undo_key (NAUTILUS_ENTRY(widget), TRUE); - nautilus_entry_enable_undo (NAUTILUS_ENTRY(widget), TRUE); + nautilus_entry_set_undo_key (NAUTILUS_ENTRY(widget), TRUE); return FALSE; } @@ -536,7 +535,7 @@ on_text_field_focus_out_event (GtkWidget *widget, update_bookmark_from_text (); gtk_editable_select_region (GTK_EDITABLE (widget), -1, -1); - nautilus_entry_enable_undo_key (NAUTILUS_ENTRY(widget), FALSE); + nautilus_entry_set_undo_key (NAUTILUS_ENTRY(widget), FALSE); return FALSE; } @@ -571,8 +570,8 @@ on_window_delete_event (GtkWidget *widget, gtk_widget_hide (widget); /* Disable undo for entry widgets */ - nautilus_entry_enable_undo (NAUTILUS_ENTRY (name_field), FALSE); - nautilus_entry_enable_undo (NAUTILUS_ENTRY (uri_field), FALSE); + nautilus_undo_unregister (GTK_OBJECT (name_field)); + nautilus_undo_unregister (GTK_OBJECT (uri_field)); /* Seems odd to restore the geometry just after saving it, * and when the window is hidden, but this insures that diff --git a/src/nautilus-location-bar.c b/src/nautilus-location-bar.c index 37729f1ba..a5fa8e81e 100644 --- a/src/nautilus-location-bar.c +++ b/src/nautilus-location-bar.c @@ -43,7 +43,6 @@ #include <libnautilus-extensions/nautilus-string.h> #include <libnautilus-extensions/nautilus-glib-extensions.h> #include <libnautilus-extensions/nautilus-gtk-macros.h> -#include <libnautilus/nautilus-undo-manager.h> #define NAUTILUS_DND_URI_LIST_TYPE "text/uri-list" #define NAUTILUS_DND_TEXT_PLAIN_TYPE "text/plain" @@ -267,23 +266,3 @@ nautilus_location_bar_set_location (NautilusLocationBar *bar, gtk_entry_set_text (bar->entry, location == NULL ? "" : location); } - -/** - * nautilus_location_bar_enable_undo - * - * Set staus of location bar undo functionality. - * - * @bar: A NautilusLocationBar. - * @manager: A NautilusUndoManager. Can be NULL. - * @enable: State to set undo functionality in. - */ -void -nautilus_location_bar_enable_undo (NautilusLocationBar *bar, - gboolean value) -{ - g_return_if_fail (NAUTILUS_IS_LOCATION_BAR (bar)); - - nautilus_entry_enable_undo (NAUTILUS_ENTRY (bar->entry), value); -} - - diff --git a/src/nautilus-location-bar.h b/src/nautilus-location-bar.h index 26c03c5b2..946520026 100644 --- a/src/nautilus-location-bar.h +++ b/src/nautilus-location-bar.h @@ -29,7 +29,6 @@ #include <gtk/gtkhbox.h> #include <gtk/gtklabel.h> #include <gtk/gtkentry.h> -#include <libnautilus/nautilus-undo-manager.h> #define NAUTILUS_LOCATION_BAR(obj) \ GTK_CHECK_CAST (obj, nautilus_location_bar_get_type (), NautilusLocationBar) @@ -59,8 +58,6 @@ GtkType nautilus_location_bar_get_type (void); GtkWidget* nautilus_location_bar_new (void); void nautilus_location_bar_set_location (NautilusLocationBar *bar, const char *location); -void nautilus_location_bar_enable_undo (NautilusLocationBar *bar, - gboolean value); #endif /* NAUTILUS_LOCATION_BAR_H */ diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index 8584e3b13..d9e3d926a 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -391,7 +391,6 @@ nautilus_window_constructed (NautilusWindow *window) gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL); window->ent_uri = nautilus_location_bar_new(); - nautilus_location_bar_enable_undo (NAUTILUS_LOCATION_BAR (window->ent_uri), TRUE); gtk_signal_connect(GTK_OBJECT(window->ent_uri), "location_changed", nautilus_window_goto_uri_callback, window); diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index 8584e3b13..d9e3d926a 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -391,7 +391,6 @@ nautilus_window_constructed (NautilusWindow *window) gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL); window->ent_uri = nautilus_location_bar_new(); - nautilus_location_bar_enable_undo (NAUTILUS_LOCATION_BAR (window->ent_uri), TRUE); gtk_signal_connect(GTK_OBJECT(window->ent_uri), "location_changed", nautilus_window_goto_uri_callback, window); diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index 8584e3b13..d9e3d926a 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -391,7 +391,6 @@ nautilus_window_constructed (NautilusWindow *window) gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL); window->ent_uri = nautilus_location_bar_new(); - nautilus_location_bar_enable_undo (NAUTILUS_LOCATION_BAR (window->ent_uri), TRUE); gtk_signal_connect(GTK_OBJECT(window->ent_uri), "location_changed", nautilus_window_goto_uri_callback, window); diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 8584e3b13..d9e3d926a 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -391,7 +391,6 @@ nautilus_window_constructed (NautilusWindow *window) gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL); window->ent_uri = nautilus_location_bar_new(); - nautilus_location_bar_enable_undo (NAUTILUS_LOCATION_BAR (window->ent_uri), TRUE); gtk_signal_connect(GTK_OBJECT(window->ent_uri), "location_changed", nautilus_window_goto_uri_callback, window); diff --git a/src/ntl-window.c b/src/ntl-window.c index 8584e3b13..d9e3d926a 100644 --- a/src/ntl-window.c +++ b/src/ntl-window.c @@ -391,7 +391,6 @@ nautilus_window_constructed (NautilusWindow *window) gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL); window->ent_uri = nautilus_location_bar_new(); - nautilus_location_bar_enable_undo (NAUTILUS_LOCATION_BAR (window->ent_uri), TRUE); gtk_signal_connect(GTK_OBJECT(window->ent_uri), "location_changed", nautilus_window_goto_uri_callback, window); |