diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-01-11 16:31:28 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-01-11 16:31:28 +0100 |
commit | 70b1acf6b0d4ef68903445d4198e78c5ea4807e5 (patch) | |
tree | 2a227049d6eb712d33232bc189d0e9d9bf0175cc /src | |
parent | e0538b42e65601d9ebee5beffaefebb3e425672e (diff) | |
download | nautilus-70b1acf6b0d4ef68903445d4198e78c5ea4807e5.tar.gz |
Finish renaming fm_* -> nautilus_*
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-actions.h | 156 | ||||
-rw-r--r-- | src/nautilus-desktop-icon-view.c | 4 | ||||
-rw-r--r-- | src/nautilus-desktop-item-properties.c | 38 | ||||
-rw-r--r-- | src/nautilus-desktop-item-properties.h | 12 | ||||
-rw-r--r-- | src/nautilus-error-reporting.c | 204 | ||||
-rw-r--r-- | src/nautilus-error-reporting.h | 46 | ||||
-rw-r--r-- | src/nautilus-icon-view.c | 32 | ||||
-rw-r--r-- | src/nautilus-list-view.c | 2 | ||||
-rw-r--r-- | src/nautilus-properties-window.c | 20 | ||||
-rw-r--r-- | src/nautilus-view.c | 180 |
10 files changed, 347 insertions, 347 deletions
diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h index d9acce991..74c130fb4 100644 --- a/src/nautilus-actions.h +++ b/src/nautilus-actions.h @@ -53,83 +53,83 @@ #define NAUTILUS_ACTION_FOLDER_WINDOW "Folder Window" #define NAUTILUS_ACTION_NEW_TAB "New Tab" -#define FM_ACTION_OPEN "Open" -#define FM_ACTION_OPEN_ALTERNATE "OpenAlternate" -#define FM_ACTION_OPEN_IN_NEW_TAB "OpenInNewTab" -#define FM_ACTION_OPEN_FOLDER_WINDOW "OpenFolderWindow" -#define FM_ACTION_LOCATION_OPEN_ALTERNATE "LocationOpenAlternate" -#define FM_ACTION_LOCATION_OPEN_IN_NEW_TAB "LocationOpenInNewTab" -#define FM_ACTION_LOCATION_OPEN_FOLDER_WINDOW "LocationOpenFolderWindow" -#define FM_ACTION_OTHER_APPLICATION1 "OtherApplication1" -#define FM_ACTION_OTHER_APPLICATION2 "OtherApplication2" -#define FM_ACTION_NEW_FOLDER "New Folder" -#define FM_ACTION_PROPERTIES "Properties" -#define FM_ACTION_PROPERTIES_ACCEL "PropertiesAccel" -#define FM_ACTION_LOCATION_PROPERTIES "LocationProperties" -#define FM_ACTION_NO_TEMPLATES "No Templates" -#define FM_ACTION_EMPTY_TRASH "Empty Trash" -#define FM_ACTION_SAVE_SEARCH "Save Search" -#define FM_ACTION_SAVE_SEARCH_AS "Save Search As" -#define FM_ACTION_CUT "Cut" -#define FM_ACTION_LOCATION_CUT "LocationCut" -#define FM_ACTION_COPY "Copy" -#define FM_ACTION_LOCATION_COPY "LocationCopy" -#define FM_ACTION_PASTE "Paste" -#define FM_ACTION_PASTE_FILES_INTO "Paste Files Into" -#define FM_ACTION_COPY_TO_NEXT_PANE "Copy to next pane" -#define FM_ACTION_MOVE_TO_NEXT_PANE "Move to next pane" -#define FM_ACTION_COPY_TO_HOME "Copy to Home" -#define FM_ACTION_MOVE_TO_HOME "Move to Home" -#define FM_ACTION_COPY_TO_DESKTOP "Copy to Desktop" -#define FM_ACTION_MOVE_TO_DESKTOP "Move to Desktop" -#define FM_ACTION_LOCATION_PASTE_FILES_INTO "LocationPasteFilesInto" -#define FM_ACTION_NEW_LAUNCHER "New Launcher" -#define FM_ACTION_NEW_LAUNCHER_DESKTOP "New Launcher Desktop" -#define FM_ACTION_RENAME "Rename" -#define FM_ACTION_DUPLICATE "Duplicate" -#define FM_ACTION_CREATE_LINK "Create Link" -#define FM_ACTION_SELECT_ALL "Select All" -#define FM_ACTION_INVERT_SELECTION "Invert Selection" -#define FM_ACTION_SELECT_PATTERN "Select Pattern" -#define FM_ACTION_TRASH "Trash" -#define FM_ACTION_LOCATION_TRASH "LocationTrash" -#define FM_ACTION_DELETE "Delete" -#define FM_ACTION_LOCATION_DELETE "LocationDelete" -#define FM_ACTION_RESTORE_FROM_TRASH "Restore From Trash" -#define FM_ACTION_LOCATION_RESTORE_FROM_TRASH "LocationRestoreFromTrash" -#define FM_ACTION_SHOW_HIDDEN_FILES "Show Hidden Files" -#define FM_ACTION_CONNECT_TO_SERVER_LINK "Connect To Server Link" -#define FM_ACTION_MOUNT_VOLUME "Mount Volume" -#define FM_ACTION_UNMOUNT_VOLUME "Unmount Volume" -#define FM_ACTION_EJECT_VOLUME "Eject Volume" -#define FM_ACTION_START_VOLUME "Start Volume" -#define FM_ACTION_STOP_VOLUME "Stop Volume" -#define FM_ACTION_POLL "Poll" -#define FM_ACTION_SELF_MOUNT_VOLUME "Self Mount Volume" -#define FM_ACTION_SELF_UNMOUNT_VOLUME "Self Unmount Volume" -#define FM_ACTION_SELF_EJECT_VOLUME "Self Eject Volume" -#define FM_ACTION_SELF_START_VOLUME "Self Start Volume" -#define FM_ACTION_SELF_STOP_VOLUME "Self Stop Volume" -#define FM_ACTION_SELF_POLL "Self Poll" -#define FM_ACTION_LOCATION_MOUNT_VOLUME "Location Mount Volume" -#define FM_ACTION_LOCATION_UNMOUNT_VOLUME "Location Unmount Volume" -#define FM_ACTION_LOCATION_EJECT_VOLUME "Location Eject Volume" -#define FM_ACTION_LOCATION_START_VOLUME "Location Start Volume" -#define FM_ACTION_LOCATION_STOP_VOLUME "Location Stop Volume" -#define FM_ACTION_LOCATION_POLL "Location Poll" -#define FM_ACTION_SCRIPTS "Scripts" -#define FM_ACTION_NEW_DOCUMENTS "New Documents" -#define FM_ACTION_NEW_EMPTY_DOCUMENT "New Empty Document" -#define FM_ACTION_EMPTY_TRASH_CONDITIONAL "Empty Trash Conditional" -#define FM_ACTION_MANUAL_LAYOUT "Manual Layout" -#define FM_ACTION_TIGHTER_LAYOUT "Tighter Layout" -#define FM_ACTION_REVERSED_ORDER "Reversed Order" -#define FM_ACTION_CLEAN_UP "Clean Up" -#define FM_ACTION_KEEP_ALIGNED "Keep Aligned" -#define FM_ACTION_ARRANGE_ITEMS "Arrange Items" -#define FM_ACTION_STRETCH "Stretch" -#define FM_ACTION_UNSTRETCH "Unstretch" -#define FM_ACTION_ZOOM_ITEMS "Zoom Items" -#define FM_ACTION_SORT_TRASH_TIME "Sort by Trash Time" +#define NAUTILUS_ACTION_OPEN "Open" +#define NAUTILUS_ACTION_OPEN_ALTERNATE "OpenAlternate" +#define NAUTILUS_ACTION_OPEN_IN_NEW_TAB "OpenInNewTab" +#define NAUTILUS_ACTION_OPEN_FOLDER_WINDOW "OpenFolderWindow" +#define NAUTILUS_ACTION_LOCATION_OPEN_ALTERNATE "LocationOpenAlternate" +#define NAUTILUS_ACTION_LOCATION_OPEN_IN_NEW_TAB "LocationOpenInNewTab" +#define NAUTILUS_ACTION_LOCATION_OPEN_FOLDER_WINDOW "LocationOpenFolderWindow" +#define NAUTILUS_ACTION_OTHER_APPLICATION1 "OtherApplication1" +#define NAUTILUS_ACTION_OTHER_APPLICATION2 "OtherApplication2" +#define NAUTILUS_ACTION_NEW_FOLDER "New Folder" +#define NAUTILUS_ACTION_PROPERTIES "Properties" +#define NAUTILUS_ACTION_PROPERTIES_ACCEL "PropertiesAccel" +#define NAUTILUS_ACTION_LOCATION_PROPERTIES "LocationProperties" +#define NAUTILUS_ACTION_NO_TEMPLATES "No Templates" +#define NAUTILUS_ACTION_EMPTY_TRASH "Empty Trash" +#define NAUTILUS_ACTION_SAVE_SEARCH "Save Search" +#define NAUTILUS_ACTION_SAVE_SEARCH_AS "Save Search As" +#define NAUTILUS_ACTION_CUT "Cut" +#define NAUTILUS_ACTION_LOCATION_CUT "LocationCut" +#define NAUTILUS_ACTION_COPY "Copy" +#define NAUTILUS_ACTION_LOCATION_COPY "LocationCopy" +#define NAUTILUS_ACTION_PASTE "Paste" +#define NAUTILUS_ACTION_PASTE_FILES_INTO "Paste Files Into" +#define NAUTILUS_ACTION_COPY_TO_NEXT_PANE "Copy to next pane" +#define NAUTILUS_ACTION_MOVE_TO_NEXT_PANE "Move to next pane" +#define NAUTILUS_ACTION_COPY_TO_HOME "Copy to Home" +#define NAUTILUS_ACTION_MOVE_TO_HOME "Move to Home" +#define NAUTILUS_ACTION_COPY_TO_DESKTOP "Copy to Desktop" +#define NAUTILUS_ACTION_MOVE_TO_DESKTOP "Move to Desktop" +#define NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO "LocationPasteFilesInto" +#define NAUTILUS_ACTION_NEW_LAUNCHER "New Launcher" +#define NAUTILUS_ACTION_NEW_LAUNCHER_DESKTOP "New Launcher Desktop" +#define NAUTILUS_ACTION_RENAME "Rename" +#define NAUTILUS_ACTION_DUPLICATE "Duplicate" +#define NAUTILUS_ACTION_CREATE_LINK "Create Link" +#define NAUTILUS_ACTION_SELECT_ALL "Select All" +#define NAUTILUS_ACTION_INVERT_SELECTION "Invert Selection" +#define NAUTILUS_ACTION_SELECT_PATTERN "Select Pattern" +#define NAUTILUS_ACTION_TRASH "Trash" +#define NAUTILUS_ACTION_LOCATION_TRASH "LocationTrash" +#define NAUTILUS_ACTION_DELETE "Delete" +#define NAUTILUS_ACTION_LOCATION_DELETE "LocationDelete" +#define NAUTILUS_ACTION_RESTORE_FROM_TRASH "Restore From Trash" +#define NAUTILUS_ACTION_LOCATION_RESTORE_FROM_TRASH "LocationRestoreFromTrash" +#define NAUTILUS_ACTION_SHOW_HIDDEN_FILES "Show Hidden Files" +#define NAUTILUS_ACTION_CONNECT_TO_SERVER_LINK "Connect To Server Link" +#define NAUTILUS_ACTION_MOUNT_VOLUME "Mount Volume" +#define NAUTILUS_ACTION_UNMOUNT_VOLUME "Unmount Volume" +#define NAUTILUS_ACTION_EJECT_VOLUME "Eject Volume" +#define NAUTILUS_ACTION_START_VOLUME "Start Volume" +#define NAUTILUS_ACTION_STOP_VOLUME "Stop Volume" +#define NAUTILUS_ACTION_POLL "Poll" +#define NAUTILUS_ACTION_SELF_MOUNT_VOLUME "Self Mount Volume" +#define NAUTILUS_ACTION_SELF_UNMOUNT_VOLUME "Self Unmount Volume" +#define NAUTILUS_ACTION_SELF_EJECT_VOLUME "Self Eject Volume" +#define NAUTILUS_ACTION_SELF_START_VOLUME "Self Start Volume" +#define NAUTILUS_ACTION_SELF_STOP_VOLUME "Self Stop Volume" +#define NAUTILUS_ACTION_SELF_POLL "Self Poll" +#define NAUTILUS_ACTION_LOCATION_MOUNT_VOLUME "Location Mount Volume" +#define NAUTILUS_ACTION_LOCATION_UNMOUNT_VOLUME "Location Unmount Volume" +#define NAUTILUS_ACTION_LOCATION_EJECT_VOLUME "Location Eject Volume" +#define NAUTILUS_ACTION_LOCATION_START_VOLUME "Location Start Volume" +#define NAUTILUS_ACTION_LOCATION_STOP_VOLUME "Location Stop Volume" +#define NAUTILUS_ACTION_LOCATION_POLL "Location Poll" +#define NAUTILUS_ACTION_SCRIPTS "Scripts" +#define NAUTILUS_ACTION_NEW_DOCUMENTS "New Documents" +#define NAUTILUS_ACTION_NEW_EMPTY_DOCUMENT "New Empty Document" +#define NAUTILUS_ACTION_EMPTY_TRASH_CONDITIONAL "Empty Trash Conditional" +#define NAUTILUS_ACTION_MANUAL_LAYOUT "Manual Layout" +#define NAUTILUS_ACTION_TIGHTER_LAYOUT "Tighter Layout" +#define NAUTILUS_ACTION_REVERSED_ORDER "Reversed Order" +#define NAUTILUS_ACTION_CLEAN_UP "Clean Up" +#define NAUTILUS_ACTION_KEEP_ALIGNED "Keep Aligned" +#define NAUTILUS_ACTION_ARRANGE_ITEMS "Arrange Items" +#define NAUTILUS_ACTION_STRETCH "Stretch" +#define NAUTILUS_ACTION_UNSTRETCH "Unstretch" +#define NAUTILUS_ACTION_ZOOM_ITEMS "Zoom Items" +#define NAUTILUS_ACTION_SORT_TRASH_TIME "Sort by Trash Time" #endif /* NAUTILUS_ACTIONS_H */ diff --git a/src/nautilus-desktop-icon-view.c b/src/nautilus-desktop-icon-view.c index 5c95e4fcf..c7680b022 100644 --- a/src/nautilus-desktop-icon-view.c +++ b/src/nautilus-desktop-icon-view.c @@ -742,14 +742,14 @@ real_update_menus (NautilusView *view) /* New Launcher */ disable_command_line = g_settings_get_boolean (gnome_lockdown_preferences, NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE); action = gtk_action_group_get_action (desktop_view->details->desktop_action_group, - FM_ACTION_NEW_LAUNCHER_DESKTOP); + NAUTILUS_ACTION_NEW_LAUNCHER_DESKTOP); gtk_action_set_visible (action, !disable_command_line); /* Empty Trash */ include_empty_trash = trash_link_is_selection (view); action = gtk_action_group_get_action (desktop_view->details->desktop_action_group, - FM_ACTION_EMPTY_TRASH_CONDITIONAL); + NAUTILUS_ACTION_EMPTY_TRASH_CONDITIONAL); gtk_action_set_visible (action, include_empty_trash); if (include_empty_trash) { diff --git a/src/nautilus-desktop-item-properties.c b/src/nautilus-desktop-item-properties.c index aebd272b3..8a9f51273 100644 --- a/src/nautilus-desktop-item-properties.c +++ b/src/nautilus-desktop-item-properties.c @@ -156,11 +156,11 @@ item_entry_free (ItemEntry *entry) } static void -fm_ditem_page_url_drag_data_received (GtkWidget *widget, GdkDragContext *context, - int x, int y, - GtkSelectionData *selection_data, - guint info, guint time, - GtkEntry *entry) +nautilus_desktop_item_properties_url_drag_data_received (GtkWidget *widget, GdkDragContext *context, + int x, int y, + GtkSelectionData *selection_data, + guint info, guint time, + GtkEntry *entry) { char **uris; gboolean exactly_one; @@ -186,11 +186,11 @@ fm_ditem_page_url_drag_data_received (GtkWidget *widget, GdkDragContext *context } static void -fm_ditem_page_exec_drag_data_received (GtkWidget *widget, GdkDragContext *context, - int x, int y, - GtkSelectionData *selection_data, - guint info, guint time, - GtkEntry *entry) +nautilus_desktop_item_properties_exec_drag_data_received (GtkWidget *widget, GdkDragContext *context, + int x, int y, + GtkSelectionData *selection_data, + guint info, guint time, + GtkEntry *entry) { char **uris; gboolean exactly_one; @@ -366,7 +366,7 @@ build_table (GtkWidget *container, GDK_ACTION_COPY | GDK_ACTION_MOVE); g_signal_connect (entry, "drag_data_received", - G_CALLBACK (fm_ditem_page_url_drag_data_received), + G_CALLBACK (nautilus_desktop_item_properties_url_drag_data_received), entry); } else if (strcmp (item_entry->field, "Exec") == 0) { gtk_drag_dest_set (GTK_WIDGET (entry), @@ -375,7 +375,7 @@ build_table (GtkWidget *container, GDK_ACTION_COPY | GDK_ACTION_MOVE); g_signal_connect (entry, "drag_data_received", - G_CALLBACK (fm_ditem_page_exec_drag_data_received), + G_CALLBACK (nautilus_desktop_item_properties_exec_drag_data_received), entry); } @@ -473,8 +473,8 @@ ditem_read_cb (GObject *source_object, } static void -fm_ditem_page_create_begin (const char *uri, - GtkWidget *box) +nautilus_desktop_item_properties_create_begin (const char *uri, + GtkWidget *box) { GFile *location; @@ -485,14 +485,14 @@ fm_ditem_page_create_begin (const char *uri, } GtkWidget * -fm_ditem_page_make_box (GtkSizeGroup *label_size_group, - GList *files) +nautilus_desktop_item_properties_make_box (GtkSizeGroup *label_size_group, + GList *files) { NautilusFileInfo *info; char *uri; GtkWidget *box; - g_assert (fm_ditem_page_should_show (files)); + g_assert (nautilus_desktop_item_properties_should_show (files)); box = gtk_vbox_new (FALSE, 6); g_object_set_data_full (G_OBJECT (box), "label-size-group", @@ -501,14 +501,14 @@ fm_ditem_page_make_box (GtkSizeGroup *label_size_group, info = NAUTILUS_FILE_INFO (files->data); uri = nautilus_file_info_get_uri (info); - fm_ditem_page_create_begin (uri, box); + nautilus_desktop_item_properties_create_begin (uri, box); g_free (uri); return box; } gboolean -fm_ditem_page_should_show (GList *files) +nautilus_desktop_item_properties_should_show (GList *files) { NautilusFileInfo *info; diff --git a/src/nautilus-desktop-item-properties.h b/src/nautilus-desktop-item-properties.h index 220ad2546..346864bd0 100644 --- a/src/nautilus-desktop-item-properties.h +++ b/src/nautilus-desktop-item-properties.h @@ -21,8 +21,8 @@ * */ -#ifndef FM_DITEM_PAGE_H -#define FM_DITEM_PAGE_H +#ifndef NAUTILUS_DESKTOP_ITEM_PROPERTIES_H +#define NAUTILUS_DESKTOP_ITEM_PROPERTIES_H #include <glib.h> #include <glib-object.h> @@ -38,10 +38,10 @@ G_BEGIN_DECLS * routines are left. */ -GtkWidget *fm_ditem_page_make_box (GtkSizeGroup *label_size_group, - GList *files); -gboolean fm_ditem_page_should_show (GList *files); +GtkWidget *nautilus_desktop_item_properties_make_box (GtkSizeGroup *label_size_group, + GList *files); +gboolean nautilus_desktop_item_properties_should_show (GList *files); G_END_DECLS -#endif +#endif /* NAUTILUS_DESKTOP_ITEM_PROPERTIES_H */ diff --git a/src/nautilus-error-reporting.c b/src/nautilus-error-reporting.c index ea8ace83e..db67dd61e 100644 --- a/src/nautilus-error-reporting.c +++ b/src/nautilus-error-reporting.c @@ -1,7 +1,7 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* fm-error-reporting.h - implementation of file manager functions that report - errors to the user. +/* nautilus-error-reporting.h - implementation of file manager functions that report + errors to the user. Copyright (C) 2000 Eazel, Inc. @@ -42,9 +42,9 @@ static void finish_rename (NautilusFile *file, gboolean stop_timer, GError *error); void -fm_report_error_loading_directory (NautilusFile *file, - GError *error, - GtkWindow *parent_window) +nautilus_report_error_loading_directory (NautilusFile *file, + GError *error, + GtkWindow *parent_window) { char *file_name; char *message; @@ -84,86 +84,12 @@ fm_report_error_loading_directory (NautilusFile *file, g_free (file_name); g_free (message); -} - -void -fm_report_error_renaming_file (NautilusFile *file, - const char *new_name, - GError *error, - GtkWindow *parent_window) -{ - char *original_name, *original_name_truncated; - char *new_name_truncated; - char *message; - - /* Truncate names for display since very long file names with no spaces - * in them won't get wrapped, and can create insanely wide dialog boxes. - */ - original_name = nautilus_file_get_display_name (file); - original_name_truncated = eel_str_middle_truncate (original_name, MAXIMUM_DISPLAYED_FILE_NAME_LENGTH); - g_free (original_name); - - new_name_truncated = eel_str_middle_truncate (new_name, MAXIMUM_DISPLAYED_FILE_NAME_LENGTH); - - message = NULL; - if (error->domain == G_IO_ERROR) { - switch (error->code) { - case G_IO_ERROR_EXISTS: - message = g_strdup_printf (_("The name \"%s\" is already used in this folder. " - "Please use a different name."), - new_name_truncated); - break; - case G_IO_ERROR_NOT_FOUND: - message = g_strdup_printf (_("There is no \"%s\" in this folder. " - "Perhaps it was just moved or deleted?"), - original_name_truncated); - break; - case G_IO_ERROR_PERMISSION_DENIED: - message = g_strdup_printf (_("You do not have the permissions necessary to rename \"%s\"."), - original_name_truncated); - break; - case G_IO_ERROR_INVALID_FILENAME: - if (strchr (new_name, '/') != NULL) { - message = g_strdup_printf (_("The name \"%s\" is not valid because it contains the character \"/\". " - "Please use a different name."), - new_name_truncated); - } else { - message = g_strdup_printf (_("The name \"%s\" is not valid. " - "Please use a different name."), - new_name_truncated); - } - break; - case G_IO_ERROR_FILENAME_TOO_LONG: - message = g_strdup_printf (_("The name \"%s\" is too long. " - "Please use a different name."), - new_name_truncated); - break; - default: - break; - } - } - - if (message == NULL) { - /* We should invent decent error messages for every case we actually experience. */ - g_warning ("Hit unhandled case %s:%d in fm_report_error_renaming_file", - g_quark_to_string (error->domain), error->code); - /* fall through */ - message = g_strdup_printf (_("Sorry, could not rename \"%s\" to \"%s\": %s"), - original_name_truncated, new_name_truncated, - error->message); - } - - g_free (original_name_truncated); - g_free (new_name_truncated); - - eel_show_error_dialog (_("The item could not be renamed."), message, parent_window); - g_free (message); } void -fm_report_error_setting_group (NautilusFile *file, - GError *error, - GtkWindow *parent_window) +nautilus_report_error_setting_group (NautilusFile *file, + GError *error, + GtkWindow *parent_window) { char *file_name; char *message; @@ -188,7 +114,7 @@ fm_report_error_setting_group (NautilusFile *file, if (message == NULL) { /* We should invent decent error messages for every case we actually experience. */ - g_warning ("Hit unhandled case %s:%d in fm_report_error_setting_group", + g_warning ("Hit unhandled case %s:%d in nautilus_report_error_setting_group", g_quark_to_string (error->domain), error->code); /* fall through */ message = g_strdup_printf (_("Sorry, could not change the group of \"%s\": %s"), file_name, @@ -203,9 +129,9 @@ fm_report_error_setting_group (NautilusFile *file, } void -fm_report_error_setting_owner (NautilusFile *file, - GError *error, - GtkWindow *parent_window) +nautilus_report_error_setting_owner (NautilusFile *file, + GError *error, + GtkWindow *parent_window) { char *file_name; char *message; @@ -225,9 +151,9 @@ fm_report_error_setting_owner (NautilusFile *file, } void -fm_report_error_setting_permissions (NautilusFile *file, - GError *error, - GtkWindow *parent_window) +nautilus_report_error_setting_permissions (NautilusFile *file, + GError *error, + GtkWindow *parent_window) { char *file_name; char *message; @@ -246,14 +172,88 @@ fm_report_error_setting_permissions (NautilusFile *file, g_free (message); } -typedef struct _FMRenameData { +typedef struct _NautilusRenameData { char *name; NautilusFileOperationCallback callback; gpointer callback_data; -} FMRenameData; +} NautilusRenameData; + +void +nautilus_report_error_renaming_file (NautilusFile *file, + const char *new_name, + GError *error, + GtkWindow *parent_window) +{ + char *original_name, *original_name_truncated; + char *new_name_truncated; + char *message; + + /* Truncate names for display since very long file names with no spaces + * in them won't get wrapped, and can create insanely wide dialog boxes. + */ + original_name = nautilus_file_get_display_name (file); + original_name_truncated = eel_str_middle_truncate (original_name, MAXIMUM_DISPLAYED_FILE_NAME_LENGTH); + g_free (original_name); + + new_name_truncated = eel_str_middle_truncate (new_name, MAXIMUM_DISPLAYED_FILE_NAME_LENGTH); + + message = NULL; + if (error->domain == G_IO_ERROR) { + switch (error->code) { + case G_IO_ERROR_EXISTS: + message = g_strdup_printf (_("The name \"%s\" is already used in this folder. " + "Please use a different name."), + new_name_truncated); + break; + case G_IO_ERROR_NOT_FOUND: + message = g_strdup_printf (_("There is no \"%s\" in this folder. " + "Perhaps it was just moved or deleted?"), + original_name_truncated); + break; + case G_IO_ERROR_PERMISSION_DENIED: + message = g_strdup_printf (_("You do not have the permissions necessary to rename \"%s\"."), + original_name_truncated); + break; + case G_IO_ERROR_INVALID_FILENAME: + if (strchr (new_name, '/') != NULL) { + message = g_strdup_printf (_("The name \"%s\" is not valid because it contains the character \"/\". " + "Please use a different name."), + new_name_truncated); + } else { + message = g_strdup_printf (_("The name \"%s\" is not valid. " + "Please use a different name."), + new_name_truncated); + } + break; + case G_IO_ERROR_FILENAME_TOO_LONG: + message = g_strdup_printf (_("The name \"%s\" is too long. " + "Please use a different name."), + new_name_truncated); + break; + default: + break; + } + } + + if (message == NULL) { + /* We should invent decent error messages for every case we actually experience. */ + g_warning ("Hit unhandled case %s:%d in nautilus_report_error_renaming_file", + g_quark_to_string (error->domain), error->code); + /* fall through */ + message = g_strdup_printf (_("Sorry, could not rename \"%s\" to \"%s\": %s"), + original_name_truncated, new_name_truncated, + error->message); + } + + g_free (original_name_truncated); + g_free (new_name_truncated); + + eel_show_error_dialog (_("The item could not be renamed."), message, parent_window); + g_free (message); +} static void -fm_rename_data_free (FMRenameData *data) +nautilus_rename_data_free (NautilusRenameData *data) { g_free (data->name); g_free (data); @@ -263,7 +263,7 @@ static void rename_callback (NautilusFile *file, GFile *result_location, GError *error, gpointer callback_data) { - FMRenameData *data; + NautilusRenameData *data; g_assert (NAUTILUS_IS_FILE (file)); g_assert (callback_data == NULL); @@ -274,7 +274,7 @@ rename_callback (NautilusFile *file, GFile *result_location, if (error && !(error->domain == G_IO_ERROR && error->code == G_IO_ERROR_CANCELLED)) { /* If rename failed, notify the user. */ - fm_report_error_renaming_file (file, data->name, error, NULL); + nautilus_report_error_renaming_file (file, data->name, error, NULL); } finish_rename (file, TRUE, error); @@ -293,7 +293,7 @@ cancel_rename_callback (gpointer callback_data) static void finish_rename (NautilusFile *file, gboolean stop_timer, GError *error) { - FMRenameData *data; + NautilusRenameData *data; data = g_object_get_data (G_OBJECT (file), NEW_NAME_TAG); if (data == NULL) { @@ -315,13 +315,13 @@ finish_rename (NautilusFile *file, gboolean stop_timer, GError *error) } void -fm_rename_file (NautilusFile *file, - const char *new_name, - NautilusFileOperationCallback callback, - gpointer callback_data) +nautilus_rename_file (NautilusFile *file, + const char *new_name, + NautilusFileOperationCallback callback, + gpointer callback_data) { char *old_name, *wait_message; - FMRenameData *data; + NautilusRenameData *data; char *uri; GError *error; @@ -333,7 +333,7 @@ fm_rename_file (NautilusFile *file, finish_rename (file, TRUE, error); g_error_free (error); - data = g_new0 (FMRenameData, 1); + data = g_new0 (NautilusRenameData, 1); data->name = g_strdup (new_name); data->callback = callback; data->callback_data = callback_data; @@ -341,7 +341,7 @@ fm_rename_file (NautilusFile *file, /* Attach the new name to the file. */ g_object_set_data_full (G_OBJECT (file), NEW_NAME_TAG, - data, (GDestroyNotify)fm_rename_data_free); + data, (GDestroyNotify)nautilus_rename_data_free); /* Start the timed wait to cancel the rename. */ old_name = nautilus_file_get_display_name (file); diff --git a/src/nautilus-error-reporting.h b/src/nautilus-error-reporting.h index c539af867..4272982c6 100644 --- a/src/nautilus-error-reporting.h +++ b/src/nautilus-error-reporting.h @@ -23,33 +23,33 @@ Authors: John Sullivan <sullivan@eazel.com> */ -#ifndef FM_ERROR_REPORTING_H -#define FM_ERROR_REPORTING_H +#ifndef NAUTILUS_ERROR_REPORTING_H +#define NAUTILUS_ERROR_REPORTING_H #include <gtk/gtk.h> #include <libnautilus-private/nautilus-file.h> -void fm_report_error_loading_directory (NautilusFile *file, - GError *error, - GtkWindow *parent_window); -void fm_report_error_renaming_file (NautilusFile *file, - const char *new_name, - GError *error, - GtkWindow *parent_window); -void fm_report_error_setting_permissions (NautilusFile *file, - GError *error, - GtkWindow *parent_window); -void fm_report_error_setting_owner (NautilusFile *file, - GError *error, - GtkWindow *parent_window); -void fm_report_error_setting_group (NautilusFile *file, - GError *error, - GtkWindow *parent_window); +void nautilus_report_error_loading_directory (NautilusFile *file, + GError *error, + GtkWindow *parent_window); +void nautilus_report_error_renaming_file (NautilusFile *file, + const char *new_name, + GError *error, + GtkWindow *parent_window); +void nautilus_report_error_setting_permissions (NautilusFile *file, + GError *error, + GtkWindow *parent_window); +void nautilus_report_error_setting_owner (NautilusFile *file, + GError *error, + GtkWindow *parent_window); +void nautilus_report_error_setting_group (NautilusFile *file, + GError *error, + GtkWindow *parent_window); /* FIXME bugzilla.gnome.org 42394: Should this file be renamed or should this function be moved? */ -void fm_rename_file (NautilusFile *file, - const char *new_name, - NautilusFileOperationCallback callback, - gpointer callback_data); +void nautilus_rename_file (NautilusFile *file, + const char *new_name, + NautilusFileOperationCallback callback, + gpointer callback_data); -#endif /* FM_ERROR_REPORTING_H */ +#endif /* NAUTILUS_ERROR_REPORTING_H */ diff --git a/src/nautilus-icon-view.c b/src/nautilus-icon-view.c index a4b90ca7a..28a11761c 100644 --- a/src/nautilus-icon-view.c +++ b/src/nautilus-icon-view.c @@ -657,26 +657,26 @@ update_layout_menus (NautilusIconView *view) if (nautilus_icon_view_supports_auto_layout (view)) { /* Mark sort criterion. */ - action_name = is_auto_layout ? view->details->sort->action : FM_ACTION_MANUAL_LAYOUT; + action_name = is_auto_layout ? view->details->sort->action : NAUTILUS_ACTION_MANUAL_LAYOUT; action = gtk_action_group_get_action (view->details->icon_action_group, action_name); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); action = gtk_action_group_get_action (view->details->icon_action_group, - FM_ACTION_TIGHTER_LAYOUT); + NAUTILUS_ACTION_TIGHTER_LAYOUT); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), nautilus_icon_view_using_tighter_layout (view)); gtk_action_set_sensitive (action, nautilus_icon_view_supports_tighter_layout (view)); gtk_action_set_visible (action, nautilus_icon_view_supports_tighter_layout (view)); action = gtk_action_group_get_action (view->details->icon_action_group, - FM_ACTION_REVERSED_ORDER); + NAUTILUS_ACTION_REVERSED_ORDER); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), view->details->sort_reversed); gtk_action_set_sensitive (action, is_auto_layout); action = gtk_action_group_get_action (view->details->icon_action_group, - FM_ACTION_SORT_TRASH_TIME); + NAUTILUS_ACTION_SORT_TRASH_TIME); if (file != NULL && nautilus_file_is_in_trash (file)) { gtk_action_set_visible (action, TRUE); @@ -686,13 +686,13 @@ update_layout_menus (NautilusIconView *view) } action = gtk_action_group_get_action (view->details->icon_action_group, - FM_ACTION_MANUAL_LAYOUT); + NAUTILUS_ACTION_MANUAL_LAYOUT); gtk_action_set_visible (action, nautilus_icon_view_supports_manual_layout (view)); /* Clean Up is only relevant for manual layout */ action = gtk_action_group_get_action (view->details->icon_action_group, - FM_ACTION_CLEAN_UP); + NAUTILUS_ACTION_CLEAN_UP); gtk_action_set_sensitive (action, !is_auto_layout); if (NAUTILUS_IS_DESKTOP_ICON_VIEW (view)) { @@ -700,7 +700,7 @@ update_layout_menus (NautilusIconView *view) } action = gtk_action_group_get_action (view->details->icon_action_group, - FM_ACTION_KEEP_ALIGNED); + NAUTILUS_ACTION_KEEP_ALIGNED); gtk_action_set_visible (action, nautilus_icon_view_supports_keep_aligned (view)); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), @@ -1641,7 +1641,7 @@ nautilus_icon_view_merge_menus (NautilusView *view) */ if (!nautilus_icon_view_supports_auto_layout (icon_view)) { action = gtk_action_group_get_action (action_group, - FM_ACTION_ARRANGE_ITEMS); + NAUTILUS_ACTION_ARRANGE_ITEMS); gtk_action_set_visible (action, FALSE); } @@ -1649,15 +1649,15 @@ nautilus_icon_view_merge_menus (NautilusView *view) gtk_ui_manager_add_ui (ui_manager, icon_view->details->icon_merge_id, POPUP_PATH_ICON_APPEARANCE, - FM_ACTION_STRETCH, - FM_ACTION_STRETCH, + NAUTILUS_ACTION_STRETCH, + NAUTILUS_ACTION_STRETCH, GTK_UI_MANAGER_MENUITEM, FALSE); gtk_ui_manager_add_ui (ui_manager, icon_view->details->icon_merge_id, POPUP_PATH_ICON_APPEARANCE, - FM_ACTION_UNSTRETCH, - FM_ACTION_UNSTRETCH, + NAUTILUS_ACTION_UNSTRETCH, + NAUTILUS_ACTION_UNSTRETCH, GTK_UI_MANAGER_MENUITEM, FALSE); } @@ -1700,7 +1700,7 @@ nautilus_icon_view_update_menus (NautilusView *view) icon_container = get_icon_container (icon_view); action = gtk_action_group_get_action (icon_view->details->icon_action_group, - FM_ACTION_STRETCH); + NAUTILUS_ACTION_STRETCH); gtk_action_set_sensitive (action, selection_count == 1 && icon_container != NULL @@ -1710,7 +1710,7 @@ nautilus_icon_view_update_menus (NautilusView *view) nautilus_icon_view_supports_scaling (icon_view)); action = gtk_action_group_get_action (icon_view->details->icon_action_group, - FM_ACTION_UNSTRETCH); + NAUTILUS_ACTION_UNSTRETCH); g_object_set (action, "label", (selection_count > 1) ? _("Restore Icons' Original Si_zes") @@ -1725,7 +1725,7 @@ nautilus_icon_view_update_menus (NautilusView *view) editable = nautilus_view_is_editable (view); action = gtk_action_group_get_action (icon_view->details->icon_action_group, - FM_ACTION_MANUAL_LAYOUT); + NAUTILUS_ACTION_MANUAL_LAYOUT); gtk_action_set_sensitive (action, editable); } @@ -2398,7 +2398,7 @@ nautilus_icon_view_icon_text_changed_callback (NautilusIconContainer *container, if (new_name[0] == '\0') { return; } - fm_rename_file (file, new_name, NULL, NULL); + nautilus_rename_file (file, new_name, NULL, NULL); } static char * diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c index 41b5217a7..92f02c57e 100644 --- a/src/nautilus-list-view.c +++ b/src/nautilus-list-view.c @@ -1241,7 +1241,7 @@ cell_renderer_edited (GtkCellRendererText *cell, if (strcmp (new_text, view->details->original_name) != 0) { view->details->renaming_file = nautilus_file_ref (file); view->details->rename_done = FALSE; - fm_rename_file (file, new_text, nautilus_list_view_rename_callback, g_object_ref (view)); + nautilus_rename_file (file, new_text, nautilus_list_view_rename_callback, g_object_ref (view)); g_free (view->details->original_name); view->details->original_name = g_strdup (new_text); } diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index 0e7cb946d..96c864556 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -749,10 +749,10 @@ rename_callback (NautilusFile *file, GFile *res_loc, GError *error, gpointer cal /* Complain to user if rename failed. */ if (error != NULL) { new_name = window->details->pending_name; - fm_report_error_renaming_file (file, - window->details->pending_name, - error, - GTK_WINDOW (window)); + nautilus_report_error_renaming_file (file, + window->details->pending_name, + error, + GTK_WINDOW (window)); if (window->details->name_field != NULL) { name_field_restore_original_name (NAUTILUS_ENTRY (window->details->name_field)); } @@ -1346,7 +1346,7 @@ group_change_callback (NautilusFile *file, /* Report the error if it's an error. */ eel_timed_wait_stop ((EelCancelCallback) cancel_group_change_callback, window); - fm_report_error_setting_group (file, error, GTK_WINDOW (window)); + nautilus_report_error_setting_group (file, error, GTK_WINDOW (window)); nautilus_file_unref (file); g_free (group); @@ -1764,7 +1764,7 @@ owner_change_callback (NautilusFile *file, /* Report the error if it's an error. */ eel_timed_wait_stop ((EelCancelCallback) cancel_owner_change_callback, window); - fm_report_error_setting_owner (file, error, GTK_WINDOW (window)); + nautilus_report_error_setting_owner (file, error, GTK_WINDOW (window)); nautilus_file_unref (file); g_free (owner); @@ -3087,7 +3087,7 @@ create_basic_page (NautilusPropertiesWindow *window) gtk_widget_grab_focus (GTK_WIDGET (window->details->name_field)); } - if (fm_ditem_page_should_show (window->details->target_files)) { + if (nautilus_desktop_item_properties_should_show (window->details->target_files)) { GtkSizeGroup *label_size_group; GtkWidget *box; @@ -3096,8 +3096,8 @@ create_basic_page (NautilusPropertiesWindow *window) label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); gtk_size_group_add_widget (label_size_group, GTK_WIDGET (window->details->name_label)); - box = fm_ditem_page_make_box (label_size_group, - window->details->target_files); + box = nautilus_desktop_item_properties_make_box (label_size_group, + window->details->target_files); gtk_table_attach (window->details->basic_table, box, TITLE_COLUMN, VALUE_COLUMN + 1, @@ -3268,7 +3268,7 @@ permission_change_callback (NautilusFile *file, end_long_operation (window); /* Report the error if it's an error. */ - fm_report_error_setting_permissions (file, error, NULL); + nautilus_report_error_setting_permissions (file, error, NULL); g_object_unref (window); } diff --git a/src/nautilus-view.c b/src/nautilus-view.c index a56fd7d78..1b081c1ad 100644 --- a/src/nautilus-view.c +++ b/src/nautilus-view.c @@ -1346,7 +1346,7 @@ real_trash (NautilusView *view) GtkAction *action; action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_TRASH); + NAUTILUS_ACTION_TRASH); if (gtk_action_get_sensitive (action) && gtk_action_get_visible (action)) { trash_or_delete_selected_files (view); @@ -1417,7 +1417,7 @@ real_delete (NautilusView *view) GtkAction *action; action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_DELETE); + NAUTILUS_ACTION_DELETE); if (gtk_action_get_sensitive (action) && gtk_action_get_visible (action)) { delete_selected_files (view); @@ -3800,7 +3800,7 @@ real_load_error (NautilusView *view, GError *error) * directory. */ if (!view->details->reported_load_error) { - fm_report_error_loading_directory + nautilus_report_error_loading_directory (nautilus_view_get_directory_as_file (view), error, nautilus_view_get_containing_window (view)); @@ -4563,17 +4563,17 @@ reset_open_with_menu (NautilusView *view, GList *selection) if (submenu_visible) { action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OTHER_APPLICATION1); + NAUTILUS_ACTION_OTHER_APPLICATION1); gtk_action_set_visible (action, open_with_chooser_visible); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OTHER_APPLICATION2); + NAUTILUS_ACTION_OTHER_APPLICATION2); gtk_action_set_visible (action, FALSE); } else { action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OTHER_APPLICATION1); + NAUTILUS_ACTION_OTHER_APPLICATION1); gtk_action_set_visible (action, FALSE); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OTHER_APPLICATION2); + NAUTILUS_ACTION_OTHER_APPLICATION2); gtk_action_set_visible (action, open_with_chooser_visible); } } @@ -5397,7 +5397,7 @@ update_scripts_menu (NautilusView *view) } nautilus_directory_list_free (sorted_copy); - action = gtk_action_group_get_action (view->details->dir_action_group, FM_ACTION_SCRIPTS); + action = gtk_action_group_get_action (view->details->dir_action_group, NAUTILUS_ACTION_SCRIPTS); gtk_action_set_visible (action, any_scripts); } @@ -5662,7 +5662,7 @@ update_templates_menu (NautilusView *view) } nautilus_directory_list_free (sorted_copy); - action = gtk_action_group_get_action (view->details->dir_action_group, FM_ACTION_NO_TEMPLATES); + action = gtk_action_group_get_action (view->details->dir_action_group, NAUTILUS_ACTION_NO_TEMPLATES); gtk_action_set_visible (action, !any_templates); g_free (templates_directory_uri); @@ -7170,42 +7170,42 @@ static const GtkActionEntry directory_view_entries[] = { G_CALLBACK (action_save_search_as_callback) }, /* Location-specific actions */ - /* name, stock id */ { FM_ACTION_LOCATION_OPEN_ALTERNATE, NULL, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_OPEN_ALTERNATE, NULL, /* label, accelerator */ N_("Open in Navigation Window"), "", /* tooltip */ N_("Open this folder in a navigation window"), G_CALLBACK (action_location_open_alternate_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_OPEN_IN_NEW_TAB, NULL, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_OPEN_IN_NEW_TAB, NULL, /* label, accelerator */ N_("Open in New _Tab"), "", /* tooltip */ N_("Open this folder in a new tab"), G_CALLBACK (action_location_open_in_new_tab_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_OPEN_FOLDER_WINDOW, NULL, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_OPEN_FOLDER_WINDOW, NULL, /* label, accelerator */ N_("Open in _Folder Window"), "", /* tooltip */ N_("Open this folder in a folder window"), G_CALLBACK (action_location_open_folder_window_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_CUT, GTK_STOCK_CUT, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_CUT, GTK_STOCK_CUT, /* label, accelerator */ NULL, "", /* tooltip */ N_("Prepare this folder to be moved with a Paste command"), G_CALLBACK (action_location_cut_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_COPY, GTK_STOCK_COPY, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_COPY, GTK_STOCK_COPY, /* label, accelerator */ NULL, "", /* tooltip */ N_("Prepare this folder to be copied with a Paste command"), G_CALLBACK (action_location_copy_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_PASTE_FILES_INTO, GTK_STOCK_PASTE, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO, GTK_STOCK_PASTE, /* label, accelerator */ N_("_Paste Into Folder"), "", /* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command into this folder"), G_CALLBACK (action_location_paste_files_into_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_TRASH, NULL, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_TRASH, NULL, /* label, accelerator */ N_("Mo_ve to Trash"), "", /* tooltip */ N_("Move this folder to the Trash"), G_CALLBACK (action_location_trash_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_DELETE, NAUTILUS_ICON_DELETE, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_DELETE, NAUTILUS_ICON_DELETE, /* label, accelerator */ N_("_Delete"), "", /* tooltip */ N_("Delete this folder, without moving to the Trash"), G_CALLBACK (action_location_delete_callback) }, - /* name, stock id */ { FM_ACTION_LOCATION_RESTORE_FROM_TRASH, NULL, + /* name, stock id */ { NAUTILUS_ACTION_LOCATION_RESTORE_FROM_TRASH, NULL, /* label, accelerator */ N_("_Restore"), NULL, NULL, G_CALLBACK (action_location_restore_from_trash_callback) }, @@ -7239,25 +7239,25 @@ static const GtkActionEntry directory_view_entries[] = { /* tooltip */ N_("View or modify the properties of this folder"), G_CALLBACK (action_location_properties_callback) }, - /* name, stock id, label */ {FM_ACTION_COPY_TO_NEXT_PANE, NULL, N_("_Other pane"), + /* name, stock id, label */ {NAUTILUS_ACTION_COPY_TO_NEXT_PANE, NULL, N_("_Other pane"), NULL, N_("Copy the current selection to the other pane in the window"), G_CALLBACK (action_copy_to_next_pane_callback) }, - /* name, stock id, label */ {FM_ACTION_MOVE_TO_NEXT_PANE, NULL, N_("_Other pane"), + /* name, stock id, label */ {NAUTILUS_ACTION_MOVE_TO_NEXT_PANE, NULL, N_("_Other pane"), NULL, N_("Move the current selection to the other pane in the window"), G_CALLBACK (action_move_to_next_pane_callback) }, - /* name, stock id, label */ {FM_ACTION_COPY_TO_HOME, NAUTILUS_ICON_HOME, + /* name, stock id, label */ {NAUTILUS_ACTION_COPY_TO_HOME, NAUTILUS_ICON_HOME, N_("_Home"), NULL, N_("Copy the current selection to the home folder"), G_CALLBACK (action_copy_to_home_callback) }, - /* name, stock id, label */ {FM_ACTION_MOVE_TO_HOME, NAUTILUS_ICON_HOME, + /* name, stock id, label */ {NAUTILUS_ACTION_MOVE_TO_HOME, NAUTILUS_ICON_HOME, N_("_Home"), NULL, N_("Move the current selection to the home folder"), G_CALLBACK (action_move_to_home_callback) }, - /* name, stock id, label */ {FM_ACTION_COPY_TO_DESKTOP, NAUTILUS_ICON_DESKTOP, + /* name, stock id, label */ {NAUTILUS_ACTION_COPY_TO_DESKTOP, NAUTILUS_ICON_DESKTOP, N_("_Desktop"), NULL, N_("Copy the current selection to the desktop"), G_CALLBACK (action_copy_to_desktop_callback) }, - /* name, stock id, label */ {FM_ACTION_MOVE_TO_DESKTOP, NAUTILUS_ICON_DESKTOP, + /* name, stock id, label */ {NAUTILUS_ACTION_MOVE_TO_DESKTOP, NAUTILUS_ICON_DESKTOP, N_("_Desktop"), NULL, N_("Move the current selection to the desktop"), G_CALLBACK (action_move_to_desktop_callback) }, @@ -7272,7 +7272,7 @@ connect_proxy (NautilusView *view, GdkPixbuf *pixbuf; GtkWidget *image; - if (strcmp (gtk_action_get_name (action), FM_ACTION_NEW_EMPTY_DOCUMENT) == 0 && + if (strcmp (gtk_action_get_name (action), NAUTILUS_ACTION_NEW_EMPTY_DOCUMENT) == 0 && GTK_IS_IMAGE_MENU_ITEM (proxy)) { pixbuf = get_menu_icon ("text-x-generic"); if (pixbuf != NULL) { @@ -7346,7 +7346,7 @@ real_merge_menus (NautilusView *view) g_object_unref (action); g_free (tooltip); - action = gtk_action_group_get_action (action_group, FM_ACTION_NO_TEMPLATES); + action = gtk_action_group_get_action (action_group, NAUTILUS_ACTION_NO_TEMPLATES); gtk_action_set_sensitive (action, FALSE); g_signal_connect_object (action_group, "connect-proxy", @@ -7435,18 +7435,18 @@ clipboard_targets_received (GtkClipboard *clipboard, count = g_list_length (selection); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_PASTE); + NAUTILUS_ACTION_PASTE); gtk_action_set_sensitive (action, can_paste && !nautilus_view_is_read_only (view)); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_PASTE_FILES_INTO); + NAUTILUS_ACTION_PASTE_FILES_INTO); gtk_action_set_sensitive (action, can_paste && count == 1 && can_paste_into_file (NAUTILUS_FILE (selection->data))); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_PASTE_FILES_INTO); + NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO); g_object_set_data (G_OBJECT (action), "can-paste-according-to-clipboard", GINT_TO_POINTER (can_paste)); @@ -7835,23 +7835,23 @@ real_update_menus_volumes (NautilusView *view, } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_CONNECT_TO_SERVER_LINK); + NAUTILUS_ACTION_CONNECT_TO_SERVER_LINK); gtk_action_set_visible (action, show_connect); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_MOUNT_VOLUME); + NAUTILUS_ACTION_MOUNT_VOLUME); gtk_action_set_visible (action, show_mount); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_UNMOUNT_VOLUME); + NAUTILUS_ACTION_UNMOUNT_VOLUME); gtk_action_set_visible (action, show_unmount); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_EJECT_VOLUME); + NAUTILUS_ACTION_EJECT_VOLUME); gtk_action_set_visible (action, show_eject); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_START_VOLUME); + NAUTILUS_ACTION_START_VOLUME); gtk_action_set_visible (action, show_start); if (show_start) { switch (start_stop_type) { @@ -7880,7 +7880,7 @@ real_update_menus_volumes (NautilusView *view, } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_STOP_VOLUME); + NAUTILUS_ACTION_STOP_VOLUME); gtk_action_set_visible (action, show_stop); if (show_stop) { switch (start_stop_type) { @@ -7909,7 +7909,7 @@ real_update_menus_volumes (NautilusView *view, } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_POLL); + NAUTILUS_ACTION_POLL); gtk_action_set_visible (action, show_poll); show_self_mount = show_self_unmount = show_self_eject = @@ -7926,19 +7926,19 @@ real_update_menus_volumes (NautilusView *view, &self_start_stop_type); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELF_MOUNT_VOLUME); + NAUTILUS_ACTION_SELF_MOUNT_VOLUME); gtk_action_set_visible (action, show_self_mount); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELF_UNMOUNT_VOLUME); + NAUTILUS_ACTION_SELF_UNMOUNT_VOLUME); gtk_action_set_visible (action, show_self_unmount); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELF_EJECT_VOLUME); + NAUTILUS_ACTION_SELF_EJECT_VOLUME); gtk_action_set_visible (action, show_self_eject); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELF_START_VOLUME); + NAUTILUS_ACTION_SELF_START_VOLUME); gtk_action_set_visible (action, show_self_start); if (show_self_start) { switch (self_start_stop_type) { @@ -7967,7 +7967,7 @@ real_update_menus_volumes (NautilusView *view, } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELF_STOP_VOLUME); + NAUTILUS_ACTION_SELF_STOP_VOLUME); gtk_action_set_visible (action, show_self_stop); if (show_self_stop) { switch (self_start_stop_type) { @@ -7996,7 +7996,7 @@ real_update_menus_volumes (NautilusView *view, } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELF_POLL); + NAUTILUS_ACTION_SELF_POLL); gtk_action_set_visible (action, show_self_poll); } @@ -8030,19 +8030,19 @@ real_update_location_menu_volumes (NautilusView *view) &start_stop_type); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_MOUNT_VOLUME); + NAUTILUS_ACTION_LOCATION_MOUNT_VOLUME); gtk_action_set_visible (action, show_mount); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_UNMOUNT_VOLUME); + NAUTILUS_ACTION_LOCATION_UNMOUNT_VOLUME); gtk_action_set_visible (action, show_unmount); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_EJECT_VOLUME); + NAUTILUS_ACTION_LOCATION_EJECT_VOLUME); gtk_action_set_visible (action, show_eject); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_START_VOLUME); + NAUTILUS_ACTION_LOCATION_START_VOLUME); gtk_action_set_visible (action, show_start); if (show_start) { switch (start_stop_type) { @@ -8071,7 +8071,7 @@ real_update_location_menu_volumes (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_STOP_VOLUME); + NAUTILUS_ACTION_LOCATION_STOP_VOLUME); gtk_action_set_visible (action, show_stop); if (show_stop) { switch (start_stop_type) { @@ -8100,7 +8100,7 @@ real_update_location_menu_volumes (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_POLL); + NAUTILUS_ACTION_LOCATION_POLL); gtk_action_set_visible (action, show_poll); } @@ -8128,11 +8128,11 @@ real_update_paste_menu (NautilusView *view, can_paste_into_file (NAUTILUS_FILE (selection->data))); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_PASTE); + NAUTILUS_ACTION_PASTE); gtk_action_set_sensitive (action, !is_read_only); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_PASTE_FILES_INTO); + NAUTILUS_ACTION_PASTE_FILES_INTO); gtk_action_set_visible (action, can_paste_files_into); gtk_action_set_sensitive (action, !selection_is_read_only); @@ -8175,13 +8175,13 @@ real_update_location_menu (NautilusView *view) "_Browse Folders", 1)); } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_OPEN_ALTERNATE); + NAUTILUS_ACTION_LOCATION_OPEN_ALTERNATE); g_object_set (action, "label", label, NULL); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_OPEN_IN_NEW_TAB); + NAUTILUS_ACTION_LOCATION_OPEN_IN_NEW_TAB); gtk_action_set_visible (action, show_open_in_new_tab); if (show_open_in_new_tab) { @@ -8196,7 +8196,7 @@ real_update_location_menu (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_OPEN_FOLDER_WINDOW); + NAUTILUS_ACTION_LOCATION_OPEN_FOLDER_WINDOW); gtk_action_set_visible (action, show_open_folder_window); file = view->details->location_popup_directory_as_file; @@ -8215,11 +8215,11 @@ real_update_location_menu (NautilusView *view) !is_desktop_or_home_dir; action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_CUT); + NAUTILUS_ACTION_LOCATION_CUT); gtk_action_set_sensitive (action, can_delete_file); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_PASTE_FILES_INTO); + NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO); g_object_set_data (G_OBJECT (action), "can-paste-according-to-destination", GINT_TO_POINTER (can_paste_into_file (file))); @@ -8247,7 +8247,7 @@ real_update_location_menu (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_TRASH); + NAUTILUS_ACTION_LOCATION_TRASH); g_object_set (action, "label", label, "tooltip", tip, @@ -8259,7 +8259,7 @@ real_update_location_menu (NautilusView *view) gtk_action_set_visible (action, show_delete); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_DELETE); + NAUTILUS_ACTION_LOCATION_DELETE); gtk_action_set_visible (action, show_separate_delete_command); if (show_separate_delete_command) { gtk_action_set_sensitive (action, can_delete_file); @@ -8270,7 +8270,7 @@ real_update_location_menu (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_LOCATION_RESTORE_FROM_TRASH); + NAUTILUS_ACTION_LOCATION_RESTORE_FROM_TRASH); l.prev = NULL; l.next = NULL; l.data = file; @@ -8377,7 +8377,7 @@ real_update_menus (NautilusView *view) vfolder_directory = we_are_in_vfolder_desktop_dir (view); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_RENAME); + NAUTILUS_ACTION_RENAME); /* rename sensitivity depending on selection */ if (selection_count > 1) { /* If multiple files are selected, sensitivity depends on whether a bulk renamer is registered. */ @@ -8389,11 +8389,11 @@ real_update_menus (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_NEW_FOLDER); + NAUTILUS_ACTION_NEW_FOLDER); gtk_action_set_sensitive (action, can_create_files); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OPEN); + NAUTILUS_ACTION_OPEN); gtk_action_set_sensitive (action, selection_count != 0); can_open = show_app = selection_count != 0; @@ -8501,7 +8501,7 @@ real_update_menus (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OPEN_ALTERNATE); + NAUTILUS_ACTION_OPEN_ALTERNATE); g_object_set (action, "label", label_with_underscore, NULL); @@ -8533,7 +8533,7 @@ real_update_menus (NautilusView *view) } } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OPEN_IN_NEW_TAB); + NAUTILUS_ACTION_OPEN_IN_NEW_TAB); gtk_action_set_sensitive (action, selection_count != 0); gtk_action_set_visible (action, show_open_alternate); g_object_set (action, "label", @@ -8542,22 +8542,22 @@ real_update_menus (NautilusView *view) g_free (label_with_underscore); } else { action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OPEN_IN_NEW_TAB); + NAUTILUS_ACTION_OPEN_IN_NEW_TAB); gtk_action_set_visible (action, FALSE); } /* next pane actions, only in navigation mode */ if (nautilus_window_get_window_type (view->details->window) != NAUTILUS_WINDOW_NAVIGATION) { action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_COPY_TO_NEXT_PANE); + NAUTILUS_ACTION_COPY_TO_NEXT_PANE); gtk_action_set_visible (action, FALSE); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_MOVE_TO_NEXT_PANE); + NAUTILUS_ACTION_MOVE_TO_NEXT_PANE); gtk_action_set_visible (action, FALSE); } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_OPEN_FOLDER_WINDOW); + NAUTILUS_ACTION_OPEN_FOLDER_WINDOW); gtk_action_set_visible (action, show_open_folder_window); /* Broken into its own function just for convenience */ @@ -8575,7 +8575,7 @@ real_update_menus (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_TRASH); + NAUTILUS_ACTION_TRASH); g_object_set (action, "label", label, "tooltip", tip, @@ -8585,7 +8585,7 @@ real_update_menus (NautilusView *view) gtk_action_set_sensitive (action, can_delete_files); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_DELETE); + NAUTILUS_ACTION_DELETE); gtk_action_set_visible (action, show_separate_delete_command); if (show_separate_delete_command) { @@ -8598,15 +8598,15 @@ real_update_menus (NautilusView *view) action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_RESTORE_FROM_TRASH); + NAUTILUS_ACTION_RESTORE_FROM_TRASH); update_restore_from_trash_action (action, selection, FALSE); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_DUPLICATE); + NAUTILUS_ACTION_DUPLICATE); gtk_action_set_sensitive (action, can_duplicate_files); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_CREATE_LINK); + NAUTILUS_ACTION_CREATE_LINK); gtk_action_set_sensitive (action, can_link_files); g_object_set (action, "label", ngettext ("Ma_ke Link", @@ -8617,7 +8617,7 @@ real_update_menus (NautilusView *view) show_properties = (!NAUTILUS_IS_DESKTOP_ICON_VIEW (view) || selection_count > 0); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_PROPERTIES); + NAUTILUS_ACTION_PROPERTIES); gtk_action_set_sensitive (action, show_properties); @@ -8630,12 +8630,12 @@ real_update_menus (NautilusView *view) gtk_action_set_visible (action, show_properties); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_PROPERTIES_ACCEL); + NAUTILUS_ACTION_PROPERTIES_ACCEL); gtk_action_set_sensitive (action, show_properties); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_EMPTY_TRASH); + NAUTILUS_ACTION_EMPTY_TRASH); g_object_set (action, "label", _("E_mpty Trash"), NULL); @@ -8658,39 +8658,39 @@ real_update_menus (NautilusView *view) } } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SAVE_SEARCH); + NAUTILUS_ACTION_SAVE_SEARCH); gtk_action_set_visible (action, show_save_search); gtk_action_set_sensitive (action, save_search_sensitive); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SAVE_SEARCH_AS); + NAUTILUS_ACTION_SAVE_SEARCH_AS); gtk_action_set_visible (action, show_save_search_as); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELECT_ALL); + NAUTILUS_ACTION_SELECT_ALL); gtk_action_set_sensitive (action, !nautilus_view_is_empty (view)); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_SELECT_PATTERN); + NAUTILUS_ACTION_SELECT_PATTERN); gtk_action_set_sensitive (action, !nautilus_view_is_empty (view)); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_INVERT_SELECTION); + NAUTILUS_ACTION_INVERT_SELECTION); gtk_action_set_sensitive (action, !nautilus_view_is_empty (view)); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_CUT); + NAUTILUS_ACTION_CUT); gtk_action_set_sensitive (action, can_delete_files); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_COPY); + NAUTILUS_ACTION_COPY); gtk_action_set_sensitive (action, can_copy_files); real_update_paste_menu (view, selection, selection_count); disable_command_line = g_settings_get_boolean (gnome_lockdown_preferences, NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_NEW_LAUNCHER); + NAUTILUS_ACTION_NEW_LAUNCHER); gtk_action_set_visible (action, vfolder_directory && !disable_command_line); gtk_action_set_sensitive (action, can_create_files); @@ -8703,7 +8703,7 @@ real_update_menus (NautilusView *view) } action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_NEW_DOCUMENTS); + NAUTILUS_ACTION_NEW_DOCUMENTS); gtk_action_set_sensitive (action, can_create_files); if (can_create_files && view->details->templates_invalid) { @@ -8714,27 +8714,27 @@ real_update_menus (NautilusView *view) /* next pane: works if file is copyable, and next pane is writable */ action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_COPY_TO_NEXT_PANE); + NAUTILUS_ACTION_COPY_TO_NEXT_PANE); gtk_action_set_sensitive (action, can_copy_files && next_pane_is_writable); /* move to next pane: works if file is cuttable, and next pane is writable */ action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_MOVE_TO_NEXT_PANE); + NAUTILUS_ACTION_MOVE_TO_NEXT_PANE); gtk_action_set_sensitive (action, can_delete_files && next_pane_is_writable); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_COPY_TO_HOME); + NAUTILUS_ACTION_COPY_TO_HOME); gtk_action_set_sensitive (action, can_copy_files); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_COPY_TO_DESKTOP); + NAUTILUS_ACTION_COPY_TO_DESKTOP); gtk_action_set_sensitive (action, can_copy_files); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_MOVE_TO_HOME); + NAUTILUS_ACTION_MOVE_TO_HOME); gtk_action_set_sensitive (action, can_delete_files); action = gtk_action_group_get_action (view->details->dir_action_group, - FM_ACTION_MOVE_TO_DESKTOP); + NAUTILUS_ACTION_MOVE_TO_DESKTOP); gtk_action_set_sensitive (action, can_delete_files); action = gtk_action_group_get_action (view->details->dir_action_group, |