summaryrefslogtreecommitdiff
path: root/src/nautilus-bookmarks-window.c
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2000-04-05 00:23:58 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2000-04-05 00:23:58 +0000
commitdc703c8ba1607c1b77441d13e2b9f55328d35a62 (patch)
tree6912ff1cc6b6aa0eef20ac3265a004fff3214076 /src/nautilus-bookmarks-window.c
parent2f576631fd11d11c4188145e3537166ff5f42e21 (diff)
downloadnautilus-dc703c8ba1607c1b77441d13e2b9f55328d35a62.tar.gz
Renaming a file from its Set Properties dialog now works, though
there are various odds and ends I still need to clean up. It turned out (surprise!) that there was a lot of underpinnings work involved in implementing this feature. Fortunately most of it will be shared by rename-in-place. * libnautilus/nautilus-directory-private.h: add #define for METADATA_NODE_NAME_FOR_FILE_NAME * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Use METADATA_NODE_NAME_FOR_FILE_NAME #define (nautilus_directory_set_file_metadata): Use g_return_val_if_fail to prevent callers from changing the file name this way, since that wouldn't work right. * libnautilus/nautilus-file.h: * libnautilus/nautilus-file.c: (nautilus_file_can_rename): New function, returns TRUE if the user has write permission for this file. (nautilus_file_rename): New function, uses gnome_vfs_move to try to rename the file, updating metadata as appropriate. Returns the GnomeVFSResult from gnome_vfs_move. * libnautilus/nautilus-list.c (row_selected): Renamed this formerly private function to nautilus_list_is_row_selected and made it check its parameters more carefully. * libnautilus/nautilus-list.h: (nautilus_list_is_row_selected): Made this public. * src/file-manager/fm-error-reporting.c, * src/file-manager/fm-error-reporting.h: New files, home for UI code to display user error messages and such. It's initial occupant is: (fm_report_error_renaming_file): New function, puts up a non-modal alert reporting the renaming failure. * src/file-manager/Makefile.am: Add these two new files to the build. * src/file-manager/fm-directory-view.c: (bonobo_menu_open_properties_window_cb): New function, opens a Properties window for each selected item using the Bonobo callback API. (fm_directory_view_real_merge_menus): Include Set Properties item in File menu, and rearrange other items a little. (fm_directory_view_real_update_menus): Update sensitivity of Set Properties menu item. * src/file-manager/fm-list-view.c: (add_to_list): Return the new row index. (fm_list_view_file_changed): Remove and reinsert the changed file; this not only does less sorting but also recomputes all the text so name changes will be displayed. * src/file-manager/fm-properties-window.c: (get_pixmap_and_mask_for_properties_window), (update_properties_window_icon), (create_pixmap_widget_for_file), (name_field_done_editing), (name_field_update), (update_properties_window_title), (properties_window_file_changed_callback): New functions used to wire up the new editable name field and new icon pixmap widget in the properties window. (create_properties_window): Added notebook tabs, first one is Basic and currently contains icon & name; second is Emblems and has all those checkboxes. Use all the new functions to create and wire up things so that name changes & icon changes are propagated and reflected correctly. * src/nautilus-bookmarks-window.c: (create_bookmarks_window): Removed a bunch of unnecessary and leak-causing gtk_widget_refs that I happened to notice in here. I left these behind when modifying code originally created by glade, where the refs are necessary.
Diffstat (limited to 'src/nautilus-bookmarks-window.c')
-rw-r--r--src/nautilus-bookmarks-window.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index 8cd675170..7183f5612 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -125,18 +125,15 @@ create_bookmarks_window(NautilusBookmarkList *list)
gtk_window_set_policy (GTK_WINDOW (window), FALSE, TRUE, FALSE);
content_area = gtk_hbox_new (TRUE, GNOME_PAD);
- gtk_widget_ref (content_area);
gtk_widget_show (content_area);
gtk_container_add (GTK_CONTAINER (window), content_area);
list_scroller = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_ref (list_scroller);
gtk_widget_show (list_scroller);
gtk_box_pack_start (GTK_BOX (content_area), list_scroller, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (list_scroller), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
bookmark_list_widget = gtk_clist_new (BOOKMARK_LIST_COLUMN_COUNT);
- gtk_widget_ref (bookmark_list_widget);
gtk_widget_show (bookmark_list_widget);
gtk_container_add (GTK_CONTAINER (list_scroller), bookmark_list_widget);
gtk_clist_column_titles_hide (GTK_CLIST (bookmark_list_widget));
@@ -149,42 +146,34 @@ create_bookmarks_window(NautilusBookmarkList *list)
gtk_clist_set_use_drag_icons(GTK_CLIST (bookmark_list_widget), FALSE);
right_side = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_widget_ref (right_side);
gtk_widget_show (right_side);
gtk_box_pack_start (GTK_BOX (content_area), right_side, TRUE, TRUE, 0);
vbox3 = gtk_vbox_new (FALSE, 0);
- gtk_widget_ref (vbox3);
gtk_widget_show (vbox3);
gtk_box_pack_start (GTK_BOX (right_side), vbox3, FALSE, FALSE, 0);
name_label = gtk_label_new (_("Name"));
- gtk_widget_ref (name_label);
gtk_widget_show (name_label);
gtk_box_pack_start (GTK_BOX (vbox3), name_label, FALSE, FALSE, 0);
name_field = gtk_entry_new ();
- gtk_widget_ref (name_field);
gtk_widget_show (name_field);
gtk_box_pack_start (GTK_BOX (vbox3), name_field, FALSE, FALSE, 0);
vbox4 = gtk_vbox_new (FALSE, 0);
- gtk_widget_ref (vbox4);
gtk_widget_show (vbox4);
gtk_box_pack_start (GTK_BOX (right_side), vbox4, FALSE, FALSE, 0);
url_label = gtk_label_new (_("Location"));
- gtk_widget_ref (url_label);
gtk_widget_show (url_label);
gtk_box_pack_start (GTK_BOX (vbox4), url_label, FALSE, FALSE, 0);
uri_field = gtk_entry_new ();
- gtk_widget_ref (uri_field);
gtk_widget_show (uri_field);
gtk_box_pack_start (GTK_BOX (vbox4), uri_field, FALSE, FALSE, 0);
hbox2 = gtk_hbox_new (FALSE, 0);
- gtk_widget_ref (hbox2);
gtk_widget_show (hbox2);
gtk_box_pack_start (GTK_BOX (right_side), hbox2, FALSE, FALSE, 0);
@@ -192,7 +181,6 @@ create_bookmarks_window(NautilusBookmarkList *list)
gtk_misc_set_padding (GTK_MISC (GTK_BIN(remove_button)->child),
GNOME_PAD_SMALL,
GNOME_PAD_SMALL);
- gtk_widget_ref (remove_button);
gtk_widget_show (remove_button);
gtk_box_pack_start (GTK_BOX (hbox2), remove_button, TRUE, FALSE, 0);