Skip to content

Commit

Permalink
Fix #447: Preferences Enable Delete key
Browse files Browse the repository at this point in the history
#447

The preference "Enable Delete key" is now used in the main window
  • Loading branch information
Colin Clark committed Jan 1, 2017
1 parent 2c77669 commit 0a8ad06
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/layout_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@ static void layout_menu_delete_cb(GtkAction *action, gpointer data)
file_util_delete(NULL, layout_selection_list(lw), layout_window(lw));
}

static void layout_menu_delete_key_cb(GtkAction *action, gpointer data)
{
LayoutWindow *lw = data;

if (options->file_ops.enable_delete_key)
{
file_util_delete(NULL, layout_selection_list(lw), layout_window(lw));
}
}

static void layout_menu_disable_grouping_cb(GtkAction *action, gpointer data)
{
LayoutWindow *lw = data;
Expand Down Expand Up @@ -1480,8 +1490,8 @@ static GtkActionEntry menu_entries[] = {
{ "Move", NULL, N_("_Move..."), "<control>M", N_("Move..."), CB(layout_menu_move_cb) },
{ "Rename", NULL, N_("_Rename..."), "<control>R", N_("Rename..."), CB(layout_menu_rename_cb) },
{ "Delete", GTK_STOCK_DELETE, N_("_Delete..."), "<control>D", N_("Delete..."), CB(layout_menu_delete_cb) },
{ "DeleteAlt1", GTK_STOCK_DELETE, N_("_Delete..."), "Delete", N_("Delete..."), CB(layout_menu_delete_cb) },
{ "DeleteAlt2", GTK_STOCK_DELETE, N_("_Delete..."), "KP_Delete", N_("Delete..."), CB(layout_menu_delete_cb) },
{ "DeleteAlt1", GTK_STOCK_DELETE, N_("_Delete..."), "Delete", N_("Delete..."), CB(layout_menu_delete_key_cb) },
{ "DeleteAlt2", GTK_STOCK_DELETE, N_("_Delete..."), "KP_Delete", N_("Delete..."), CB(layout_menu_delete_key_cb) },
{ "EnableGrouping", NULL, N_("Enable file _grouping"), NULL, N_("Enable file grouping"), CB(layout_menu_enable_grouping_cb) },
{ "DisableGrouping", NULL, N_("Disable file groupi_ng"), NULL, N_("Disable file grouping"), CB(layout_menu_disable_grouping_cb) },
{ "CopyPath", NULL, N_("_Copy path to clipboard"), NULL, N_("Copy path to clipboard"), CB(layout_menu_copy_path_cb) },
Expand Down

0 comments on commit 0a8ad06

Please sign in to comment.