summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLevi Smith <lsmith3@unbc.ca>2010-09-04 04:13:16 -0700
committerDaniel Friesel <derf@finalrewind.org>2010-09-05 16:25:41 +0200
commitc515ae7956ee16e7595294ed4cb7cba7f88c48ae (patch)
tree8a814d8b47dd540c74f3c2b12f6a4bdf656bb800
parentaa22a1466e747a67fbae482d0251545ebb73318f (diff)
Option --action-hold-slide. If specified, when in slideshow mode images will not automatically change after running user action. Otherwise, slideshow images will cycle after action as usual.
-rw-r--r--src/keyevents.c8
-rw-r--r--src/options.c11
-rw-r--r--src/options.h1
3 files changed, 17 insertions, 3 deletions
diff --git a/src/keyevents.c b/src/keyevents.c
index 8bb85f5..893d543 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -35,9 +35,11 @@ void feh_event_invoke_action(winwidget winwid, char *action)
D(("winwid is '%p'\n", winwid));
if (action) {
if (opt.slideshow) {
- feh_action_run(FEH_FILE(winwid->file->data), action);
- winwidget_update_caption(winwid);
- /* slideshow_change_image(winwid, SLIDE_NEXT); */
+ feh_action_run(FEH_FILE(winwid->file->data), action);
+ winwidget_update_caption(winwid);
+
+ if (! opt.action_hold_slide)
+ slideshow_change_image(winwid, SLIDE_NEXT);
} else if ((winwid->type == WIN_TYPE_SINGLE)
|| (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER)) {
diff --git a/src/options.c b/src/options.c
index 89fbe62..e2ccc74 100644
--- a/src/options.c
+++ b/src/options.c
@@ -42,6 +42,8 @@ fehoptions opt;
void init_parse_options(int argc, char **argv)
{
+ /* TODO: sort these to match declaration of __fehoptions */
+
/* For setting the command hint on X windows */
cmdargc = argc;
cmdargv = argv;
@@ -68,6 +70,9 @@ void init_parse_options(int argc, char **argv)
opt.prev_button = 4;
opt.next_button = 5;
+ opt.draw_actions = 0;
+ opt.action_hold_slide = 0;
+
opt.rotate_button = 2;
opt.no_rotate_ctrl_mask = 0;
opt.blur_button = 1;
@@ -318,6 +323,8 @@ static void feh_parse_option_array(int argc, char **argv)
static char stropts[] =
"a:A:b:B:cC:dD:e:E:f:Fg:GhH:iIj:J:kK:lL:mM:nNo:O:pPqQrR:sS:tT:uUvVwW:xXy:YzZ"
"0:1:2:4:5:8:9:.@:^:~:):|:_:+:";
+
+ /* (*name, has_arg, *flag, val) See: struct option in getopts.h */
static struct option lopts[] = {
{"help" , 0, 0, 'h'},
{"version" , 0, 0, 'v'},
@@ -415,6 +422,7 @@ static void feh_parse_option_array(int argc, char **argv)
{"index-size" , 1, 0, 231},
{"index-dim" , 1, 0, 232},
{"thumb-redraw" , 1, 0, 'J'},
+ {"action-hold-slide", 0, 0, 233},
{0, 0, 0, 0}
};
@@ -761,6 +769,9 @@ static void feh_parse_option_array(int argc, char **argv)
case 'J':
opt.thumb_redraw = atoi(optarg);
break;
+ case 233:
+ opt.action_hold_slide = 1;
+ break;
default:
break;
}
diff --git a/src/options.h b/src/options.h
index 6ef4f64..e9595b7 100644
--- a/src/options.h
+++ b/src/options.h
@@ -66,6 +66,7 @@ struct __fehoptions {
unsigned char screen_clip;
unsigned char hide_pointer;
unsigned char draw_actions;
+ unsigned char action_hold_slide;
unsigned char cache_thumbnails;
unsigned char cycle_once;