Skip to content

Commit

Permalink
Partial fix 435: Duplicates in file selection
Browse files Browse the repository at this point in the history
#435

Right-click on a file selection has a menu option to open the Find
Duplicates window
  • Loading branch information
Colin Clark committed Dec 17, 2016
1 parent aa6a20a commit 22b4f6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/view_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "main.h"
#include "view_file.h"

#include "dupe.h"
#include "editors.h"
#include "layout.h"
#include "menu.h"
Expand Down Expand Up @@ -401,6 +402,15 @@ static void vf_pop_menu_enable_grouping_cb(GtkWidget *widget, gpointer data)
file_data_disable_grouping_list(vf_pop_menu_file_list(vf), FALSE);
}

static void vf_pop_menu_duplicates_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
DupeWindow *dw;

dw = dupe_window_new(DUPE_MATCH_NAME);
dupe_window_add_files(dw, vf_pop_menu_file_list(vf), FALSE);
}

static void vf_pop_menu_disable_grouping_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
Expand Down Expand Up @@ -615,6 +625,9 @@ GtkWidget *vf_pop_menu(ViewFile *vf)
G_CALLBACK(vf_pop_menu_disable_grouping_cb), vf);

menu_item_add_divider(menu);
menu_item_add_stock_sensitive(menu, _("_Find duplicates..."), GTK_STOCK_FIND, active,
G_CALLBACK(vf_pop_menu_duplicates_cb), vf);
menu_item_add_divider(menu);

submenu = submenu_add_sort(NULL, G_CALLBACK(vf_pop_menu_sort_cb), vf,
FALSE, FALSE, TRUE, vf->sort_method);
Expand Down

0 comments on commit 22b4f6c

Please sign in to comment.