summaryrefslogtreecommitdiff
path: root/src/file-manager/fm-directory-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file-manager/fm-directory-view.c')
-rw-r--r--src/file-manager/fm-directory-view.c56
1 files changed, 32 insertions, 24 deletions
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 405f71650..b612491a8 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -642,7 +642,6 @@ fm_directory_view_confirm_multiple_windows (FMDirectoryView *view, int count)
{
GtkDialog *dialog;
char *prompt;
- char *title;
char *detail;
int response;
@@ -650,15 +649,13 @@ fm_directory_view_confirm_multiple_windows (FMDirectoryView *view, int count)
return TRUE;
}
- title = g_strdup_printf (ngettext("Open %d Window?", "Open %d Windows?", count), count);
prompt = _("Are you sure you want to open all files?");
detail = g_strdup_printf (ngettext("This will open %d separate window.",
"This will open %d separate windows.", count), count);
- dialog = eel_show_yes_no_dialog (prompt, detail, title,
+ dialog = eel_show_yes_no_dialog (prompt, detail,
GTK_STOCK_OK, GTK_STOCK_CANCEL,
fm_directory_view_get_containing_window (view));
g_free (detail);
- g_free (title);
response = gtk_dialog_run (dialog);
gtk_object_destroy (GTK_OBJECT (dialog));
@@ -995,8 +992,7 @@ confirm_delete_directly (FMDirectoryView *view,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
prompt,
- _("If you delete an item, it is permanently lost."),
- ""));
+ _("If you delete an item, it is permanently lost.")));
gtk_dialog_add_button (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (dialog, GTK_STOCK_DELETE, GTK_RESPONSE_YES);
@@ -2305,7 +2301,6 @@ real_file_limit_reached (FMDirectoryView *view)
dialog = eel_show_warning_dialog (message,
_("Some files will not be displayed."),
- _("Too Many Files"),
fm_directory_view_get_containing_window (view));
g_free (message);
}
@@ -3717,7 +3712,7 @@ fm_directory_view_confirm_deletion (FMDirectoryView *view, GList *uris, gboolean
dialog = eel_show_yes_no_dialog
(prompt,
- detail, _("Delete Immediately?"), GTK_STOCK_DELETE, GTK_STOCK_CANCEL,
+ detail, GTK_STOCK_DELETE, GTK_STOCK_CANCEL,
fm_directory_view_get_containing_window (view));
g_free (detail);
@@ -3763,7 +3758,7 @@ confirm_delete_from_trash (FMDirectoryView *view, GList *uris)
dialog = eel_show_yes_no_dialog (
prompt, _("If you delete an item, it will be permanently lost."),
- _("Delete From Trash?"), GTK_STOCK_DELETE, GTK_STOCK_CANCEL,
+ GTK_STOCK_DELETE, GTK_STOCK_CANCEL,
fm_directory_view_get_containing_window (view));
g_free (prompt);
@@ -4438,7 +4433,6 @@ get_executable_text_file_action (FMDirectoryView *view, NautilusFile *file)
dialog = eel_create_question_dialog (prompt,
detail,
- _("Run or Display?"),
_("Run in _Terminal"), RESPONSE_RUN_IN_TERMINAL,
_("_Display"), RESPONSE_DISPLAY,
fm_directory_view_get_containing_window (view));
@@ -4666,6 +4660,7 @@ typedef struct
NautilusMenuItem *item;
FMDirectoryView *view;
GList *selection;
+ GtkAction *action;
} ExtensionActionCallbackData;
@@ -4720,6 +4715,8 @@ extension_action_slow_mime_types_ready_callback (GList *selection,
if (is_valid) {
nautilus_menu_item_activate (data->item);
}
+
+ g_object_unref (data->action);
}
static void
@@ -4730,6 +4727,8 @@ extension_action_callback (GtkAction *action,
data = callback_data;
+ g_object_ref (action);
+
nautilus_file_list_call_when_ready
(data->selection,
NAUTILUS_FILE_ATTRIBUTE_SLOW_MIME_TYPE,
@@ -4780,6 +4779,7 @@ add_extension_action_for_files (FMDirectoryView *view,
data->item = g_object_ref (item);
data->view = view;
data->selection = nautilus_file_list_copy (files);
+ data->action = action;
g_signal_connect_data (action, "activate",
G_CALLBACK (extension_action_callback),
@@ -4851,8 +4851,7 @@ warn_mismatched_mime_types (FMDirectoryView *view,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_NONE,
primary,
- secondary,
- primary);
+ secondary);
g_free (primary);
g_free (secondary);
@@ -5685,7 +5684,6 @@ action_open_scripts_folder_callback (GtkAction *action,
"Scripts menu."),
_("Choosing a script from the menu will run "
"that script with any selected items as input."),
- _("About Scripts"),
_("All executable files in this folder will appear in the "
"Scripts menu. Choosing a script from the menu will run "
"that script.\n\n"
@@ -6085,7 +6083,7 @@ drive_mounted_callback (gboolean succeeded,
{
if (!succeeded) {
eel_show_error_dialog_with_details (error, NULL,
- _("Mount Error"), detailed_error, NULL);
+ detailed_error, NULL);
}
}
@@ -6137,7 +6135,7 @@ volume_or_drive_unmounted_callback (gboolean succeeded,
{
if (!succeeded) {
eel_show_error_dialog_with_details (error, NULL,
- _("Unmount Error"), detailed_error, NULL);
+ detailed_error, NULL);
}
}
@@ -6150,7 +6148,7 @@ volume_or_drive_ejected_callback (gboolean succeeded,
{
if (!succeeded) {
eel_show_error_dialog_with_details (error, NULL,
- _("Eject Error"), detailed_error, NULL);
+ detailed_error, NULL);
}
}
@@ -7652,6 +7650,7 @@ static void
report_broken_symbolic_link (FMDirectoryView *view, NautilusFile *file)
{
char *target_path;
+ char *display_name;
char *prompt;
char *detail;
GtkDialog *dialog;
@@ -7660,17 +7659,29 @@ report_broken_symbolic_link (FMDirectoryView *view, NautilusFile *file)
g_assert (nautilus_file_is_broken_symbolic_link (file));
+ display_name = nautilus_file_get_display_name (file);
+ if (nautilus_file_is_in_trash (file)) {
+ prompt = g_strdup_printf (_("The Link \"%s\" is Broken."), display_name);
+ } else {
+ prompt = g_strdup_printf (_("The Link \"%s\" is Broken. Move it to Trash?"), display_name);
+ }
+ g_free (display_name);
+
target_path = nautilus_file_get_symbolic_link_target_path (file);
- prompt = _("The link is broken, do you want to move it to the Trash?");
if (target_path == NULL) {
detail = g_strdup (_("This link can't be used, because it has no target."));
} else {
detail = g_strdup_printf (_("This link can't be used, because its target "
"\"%s\" doesn't exist."), target_path);
}
+
+ if (nautilus_file_is_in_trash (file)) {
+ eel_run_simple_dialog (GTK_WIDGET (view), FALSE, GTK_MESSAGE_WARNING,
+ prompt, detail, "", GTK_STOCK_CANCEL, NULL);
+ goto out;
+ }
- dialog = eel_show_yes_no_dialog (prompt,
- detail, _("Broken Link"), _("Mo_ve to Trash"), GTK_STOCK_CANCEL,
+ dialog = eel_show_yes_no_dialog (prompt, detail, _("Mo_ve to Trash"), GTK_STOCK_CANCEL,
fm_directory_view_get_containing_window (view));
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_YES);
@@ -7694,6 +7705,8 @@ report_broken_symbolic_link (FMDirectoryView *view, NautilusFile *file)
trash_or_delete_files (view, &file_as_list);
}
+out:
+ g_free (prompt);
g_free (target_path);
g_free (detail);
}
@@ -7956,7 +7969,6 @@ activation_drive_mounted_callback (gboolean succeeded,
if (!succeeded && !parameters->cancelled) {
eel_show_error_dialog_with_details (error, NULL,
- _("Mount Error"),
detailed_error,
NULL);
}
@@ -8173,7 +8185,6 @@ fm_directory_view_activate_files (FMDirectoryView *view,
(DELAY_UNTIL_CANCEL_MSECS,
cancel_activate_callback,
parameters,
- _("Cancel Open?"),
timed_wait_prompt,
fm_directory_view_get_containing_window (view));
g_free (timed_wait_prompt);
@@ -9127,7 +9138,6 @@ fm_directory_view_handle_url_drop (FMDirectoryView *view,
EEL_VFS_CAPABILITY_IS_REMOTE_AND_SLOW)) {
eel_show_warning_dialog (_("Drag and drop is not supported."),
_("Drag and drop is only supported on local file systems."),
- _("Drag and Drop Error"),
fm_directory_view_get_containing_window (view));
g_free (container_uri);
return;
@@ -9180,7 +9190,6 @@ fm_directory_view_handle_url_drop (FMDirectoryView *view,
(action != GDK_ACTION_LINK)) {
eel_show_warning_dialog (_("Drag and drop is not supported."),
_("An invalid drag type was used."),
- _("Drag and Drop Error"),
fm_directory_view_get_containing_window (view));
g_free (container_uri);
return;
@@ -9278,7 +9287,6 @@ fm_directory_view_handle_uri_list_drop (FMDirectoryView *view,
(action != GDK_ACTION_LINK)) {
eel_show_warning_dialog (_("Drag and drop is not supported."),
_("An invalid drag type was used."),
- _("Drag and Drop Error"),
fm_directory_view_get_containing_window (view));
g_free (container_uri);
return;