Commit 70b1acf6 authored by Cosimo Cecchi's avatar Cosimo Cecchi

Finish renaming fm_* -> nautilus_*

parent e0538b42
......@@ -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 */
......@@ -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) {
......
......@@ -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;
......
......@@ -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 */
/* -*- 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);
......
......@@ -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 */
......@@ -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,