From 22829f0f98fd2aeb48ebe4db9486955c73ee6ef8 Mon Sep 17 00:00:00 2001 From: Serena <> Date: Sat, 18 May 2024 18:44:03 -0400 Subject: [PATCH] Add run in terminal to executable text file preferences --- .../nemo-file-management-properties.glade | 23 ++++++++++++++++--- libnemo-private/nemo-global-preferences.h | 3 ++- src/nemo-file-management-properties.c | 1 + src/nemo-mime-actions.c | 4 ++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/gresources/nemo-file-management-properties.glade b/gresources/nemo-file-management-properties.glade index 1b812dba7..9b38eedc5 100644 --- a/gresources/nemo-file-management-properties.glade +++ b/gresources/nemo-file-management-properties.glade @@ -1234,6 +1234,23 @@ along with . If not, see . False vertical 6 + + + _Run executable text files in the terminal when they are opened + True + True + False + True + 0 + True + True + + + False + False + 0 + + _Run executable text files when they are opened @@ -1248,7 +1265,7 @@ along with . If not, see . False False - 0 + 1 @@ -1265,7 +1282,7 @@ along with . If not, see . False False - 1 + 2 @@ -1282,7 +1299,7 @@ along with . If not, see . False False - 2 + 3 diff --git a/libnemo-private/nemo-global-preferences.h b/libnemo-private/nemo-global-preferences.h index d3f93b2e1..b9b1a9cac 100644 --- a/libnemo-private/nemo-global-preferences.h +++ b/libnemo-private/nemo-global-preferences.h @@ -194,7 +194,8 @@ enum { NEMO_EXECUTABLE_TEXT_LAUNCH, NEMO_EXECUTABLE_TEXT_DISPLAY, - NEMO_EXECUTABLE_TEXT_ASK + NEMO_EXECUTABLE_TEXT_ASK, + NEMO_EXECUTABLE_TEXT_LAUNCH_IN_TERMINAL, }; typedef enum diff --git a/src/nemo-file-management-properties.c b/src/nemo-file-management-properties.c index ffc86ad26..994e9e666 100644 --- a/src/nemo-file-management-properties.c +++ b/src/nemo-file-management-properties.c @@ -195,6 +195,7 @@ static const char * const executable_text_components[] = { "scripts_execute_radiobutton", "scripts_view_radiobutton", "scripts_confirm_radiobutton", + "scripts_execute_terminal_radiobutton", NULL }; diff --git a/src/nemo-mime-actions.c b/src/nemo-mime-actions.c index 0064d23fe..2cd2f7f1a 100644 --- a/src/nemo-mime-actions.c +++ b/src/nemo-mime-actions.c @@ -706,6 +706,8 @@ get_executable_text_file_action (GtkWindow *parent_window, NemoFile *file) preferences_value = g_settings_get_enum (nemo_preferences, NEMO_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION); switch (preferences_value) { + case NEMO_EXECUTABLE_TEXT_LAUNCH_IN_TERMINAL: + return ACTIVATION_ACTION_LAUNCH_IN_TERMINAL; case NEMO_EXECUTABLE_TEXT_LAUNCH: return ACTIVATION_ACTION_LAUNCH; case NEMO_EXECUTABLE_TEXT_DISPLAY: @@ -763,6 +765,8 @@ get_default_executable_text_file_action (void) preferences_value = g_settings_get_enum (nemo_preferences, NEMO_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION); switch (preferences_value) { + case NEMO_EXECUTABLE_TEXT_LAUNCH_IN_TERMINAL: + return ACTIVATION_ACTION_LAUNCH_IN_TERMINAL; case NEMO_EXECUTABLE_TEXT_LAUNCH: return ACTIVATION_ACTION_LAUNCH; case NEMO_EXECUTABLE_TEXT_DISPLAY: