Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run in terminal to executable text file preferences #3405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions gresources/nemo-file-management-properties.glade
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,23 @@ along with . If not, see <http://www.gnu.org/licenses/>.
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkRadioButton" id="scripts_execute_terminal_radiobutton">
<property name="label" translatable="yes">_Run executable text files in the terminal when they are opened</property>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of the _ in front of Run - this would normally indicate that pressing R should select this option. In reality these shortcuts don't work on this page, so we can leave it out (don't change the other options, as they've already been translated, and any change will void those translations).

<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to have:

<property name="group">scripts_execute_radiobutton</property>

This is in every entry except scripts_execute_radiobutton itself, and ties the other buttons together with that one (otherwise you have 2 buttons active at once).

</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="scripts_execute_radiobutton">
<property name="label" translatable="yes">_Run executable text files when they are opened</property>
Expand All @@ -1248,7 +1265,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
Expand All @@ -1265,7 +1282,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
Expand All @@ -1282,7 +1299,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
Expand Down
3 changes: 2 additions & 1 deletion libnemo-private/nemo-global-preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/nemo-file-management-properties.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
4 changes: 4 additions & 0 deletions src/nemo-mime-actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down