summaryrefslogtreecommitdiff
path: root/src/nautilus-mime-actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nautilus-mime-actions.c')
-rw-r--r--src/nautilus-mime-actions.c106
1 files changed, 1 insertions, 105 deletions
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index cb2d4ea57..c947945bb 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -46,7 +46,6 @@
typedef enum
{
- ACTIVATION_ACTION_ASK,
ACTIVATION_ACTION_LAUNCH,
ACTIVATION_ACTION_LAUNCH_IN_TERMINAL,
ACTIVATION_ACTION_OPEN_IN_VIEW,
@@ -221,10 +220,6 @@ struct
/* Number of seconds until cancel dialog shows up */
#define DELAY_UNTIL_CANCEL_MSECS 5000
-#define RESPONSE_RUN 1000
-#define RESPONSE_DISPLAY 1001
-#define RESPONSE_RUN_IN_TERMINAL 1002
-
#define SILENT_WINDOW_OPEN_LIMIT 5
#define SILENT_OPEN_LIMIT 5
@@ -597,17 +592,9 @@ out:
}
static ActivationAction
-get_executable_text_file_action (GtkWindow *parent_window,
- NautilusFile *file)
+get_default_executable_text_file_action (void)
{
- GtkDialog *dialog;
- char *file_name;
- char *prompt;
- char *detail;
int preferences_value;
- int response;
-
- g_assert (nautilus_file_contains_text (file));
preferences_value = g_settings_get_enum (nautilus_preferences,
NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION);
@@ -623,86 +610,10 @@ get_executable_text_file_action (GtkWindow *parent_window,
return ACTIVATION_ACTION_OPEN_IN_APPLICATION;
}
- case NAUTILUS_EXECUTABLE_TEXT_ASK:
- {
- }
- break;
-
default:
- /* Complain non-fatally, since preference data can't be trusted */
- g_warning ("Unknown value %d for NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION",
- preferences_value);
- }
-
-
- file_name = nautilus_file_get_display_name (file);
- prompt = g_strdup_printf (_("Do you want to run ā€œ%sā€, or display its contents?"),
- file_name);
- detail = g_strdup_printf (_("ā€œ%sā€ is an executable text file."),
- file_name);
- g_free (file_name);
-
- dialog = eel_create_question_dialog (prompt,
- detail,
- _("Run in _Terminal"), RESPONSE_RUN_IN_TERMINAL,
- _("_Display"), RESPONSE_DISPLAY,
- parent_window);
- gtk_dialog_add_button (dialog, _("_Cancel"), GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (dialog, _("_Run"), RESPONSE_RUN);
- gtk_dialog_set_default_response (dialog, GTK_RESPONSE_CANCEL);
- gtk_widget_show (GTK_WIDGET (dialog));
-
- g_free (prompt);
- g_free (detail);
-
- response = gtk_dialog_run (dialog);
- gtk_widget_destroy (GTK_WIDGET (dialog));
-
- switch (response)
- {
- case RESPONSE_RUN:
- {
- return ACTIVATION_ACTION_LAUNCH;
- }
-
- case RESPONSE_RUN_IN_TERMINAL:
- {
- return ACTIVATION_ACTION_LAUNCH_IN_TERMINAL;
- }
-
- case RESPONSE_DISPLAY:
- {
return ACTIVATION_ACTION_OPEN_IN_APPLICATION;
- }
-
- default:
- return ACTIVATION_ACTION_DO_NOTHING;
}
-}
-
-static ActivationAction
-get_default_executable_text_file_action (void)
-{
- int preferences_value;
-
- preferences_value = g_settings_get_enum (nautilus_preferences,
- NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION);
- switch (preferences_value)
- {
- case NAUTILUS_EXECUTABLE_TEXT_LAUNCH:
- {
- return ACTIVATION_ACTION_LAUNCH;
- }
-
- case NAUTILUS_EXECUTABLE_TEXT_DISPLAY:
- {
- return ACTIVATION_ACTION_OPEN_IN_APPLICATION;
- }
- case NAUTILUS_EXECUTABLE_TEXT_ASK:
- default:
- return ACTIVATION_ACTION_ASK;
- }
}
static ActivationAction
@@ -1443,15 +1354,6 @@ activate_files (ActivateParameters *parameters)
}
action = get_activation_action (file);
- if (action == ACTIVATION_ACTION_ASK)
- {
- /* Special case for executable text files, since it might be
- * dangerous & unexpected to launch these.
- */
- pause_activation_timed_cancel (parameters);
- action = get_executable_text_file_action (parameters->parent_window, file);
- unpause_activation_timed_cancel (parameters);
- }
switch (action)
{
@@ -1490,12 +1392,6 @@ activate_files (ActivateParameters *parameters)
g_assert_not_reached ();
}
break;
-
- case ACTIVATION_ACTION_ASK:
- {
- g_assert_not_reached ();
- }
- break;
}
}