diff options
author | Gene Z. Ragan <gzr@eazel.com> | 2000-05-26 07:08:11 +0000 |
---|---|---|
committer | Gene Ragan <gzr@src.gnome.org> | 2000-05-26 07:08:11 +0000 |
commit | 7c045c92c71202f35da20134525bc5dccfc69468 (patch) | |
tree | 2526cf67afa175df74ad5d3167ab7bd7705e6086 /src | |
parent | cb170d00f1f7a73b2d0530956579b78aaf142e11 (diff) | |
download | nautilus-7c045c92c71202f35da20134525bc5dccfc69468.tar.gz |
More work on undo. Note that undo in text entry fields still misbehaves.
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.
Diffstat (limited to 'src')
-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 |
9 files changed, 5 insertions, 36 deletions
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); |