diff --git a/Makefile b/Makefile index a5d5ddd66737d881c2f479183d72f3a7488c6f0c..16c15e29ba830f156b892b1fbce01205722bf52e 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,8 @@ install-doc: @echo installing docs to ${doc_dir} @mkdir -p ${doc_dir} @cp AUTHORS ChangeLog README TODO ${doc_dir} - @chmod 644 ${doc_dir}/* + @chmod 644 ${doc_dir}/AUTHORS ${doc_dir}/ChangeLog ${doc_dir}/README \ + ${doc_dir}/TODO install-bin: @echo installing executables to ${bin_dir} diff --git a/src/keyevents.c b/src/keyevents.c index 827ab24ef8c5e042c29fdf194b6fb41b11108f59..64194dab5f8e22250483052bfd3e7176eca78752 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -345,10 +345,21 @@ void feh_event_invoke_action(winwidget winwid, unsigned char action) feh_reload_image(winwid, 1, 1); else winwidget_destroy(winwid); - } else if (winwid->type == WIN_TYPE_THUMBNAIL) - fputs("actions from the main thumb window aren't currently supported!\n" - "For now, open the image to perform the action on it.\n", - stdout); + } else if (winwid->type == WIN_TYPE_THUMBNAIL) { + feh_file *thumbfile; + /* also see events.c:306 */ + thumbfile = feh_thumbnail_get_selected_file(); + + if (thumbfile) { + feh_action_run(thumbfile, opt.actions[action]); + + /* so, reload/regenerate the thumbnail here? */ + if (!opt.hold_actions[action]) + winwidget_destroy(winwid); + } + else + fputs("no thumbnail selected\n", stderr); + } } return; } diff --git a/src/thumbnail.c b/src/thumbnail.c index 86d254b4522dcd914c315690de393b5c72050724..42e2a820c27c8a9378b3af3d9cd514674c58555e 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -902,6 +902,13 @@ inline void feh_thumbnail_show_selected() feh_thumbnail_show_fullsize(td.selected->file); } +inline feh_file* feh_thumbnail_get_selected_file() +{ + if (td.selected) + return td.selected->file; + return NULL; +} + int feh_thumbnail_setup_thumbnail_dir(void) { int status = 0; diff --git a/src/thumbnail.h b/src/thumbnail.h index a70b603de77a45f1108c42222ff29067acd73337..9b9572631b2ebd41272a6ebf854f832883c724fb 100644 --- a/src/thumbnail.h +++ b/src/thumbnail.h @@ -86,6 +86,7 @@ void feh_thumbnail_select(winwidget winwid, feh_thumbnail *thumbnail); void feh_thumbnail_select_next(winwidget winwid, int jump); void feh_thumbnail_select_prev(winwidget winwid, int jump); void feh_thumbnail_show_selected(); +feh_file *feh_thumbnail_get_selected_file(); int feh_thumbnail_setup_thumbnail_dir(void);