Commit 9087479e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Allow specifying slideshow-delay while starting the slideshow in paused mode

Set --slideshow-delay to a negative value to achieve that. In that case, the
actual slideshow-delay will be <value> * (-1), so -D-5 sets slideshow-delay 5
seconds but starts paused.

Closes: GH-4 <http://github.com/derf/feh/issues#issue/4>
parent e264613a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ git HEAD

    * Fix segfault in Thumbnail mode when trying to open a no longer
      existing image (e.g. when the file was renamed by a previous action)
    * Set a negative slideshow-delay to start the slideshow in paused mode

Sat Jun  5 21:35:25 CEST 2010  Daniel Friesel <derf@chaosdorf.de

+6 −1
Original line number Diff line number Diff line
@@ -313,6 +313,9 @@ managers.
For slideshow mode, wait
.Ar float
seconds between automatically changing slides.  Useful for presentations.
Specify a negative number to set the delay
.Pq which will then be Ar float No * (-1) ,
but start feh in paused mode.
.It Cm -S , --sort Ar sort_type
The file list may be sorted according to image parameters.  Allowed sort
types are: name, filename, width, height, pixels, size, format.  For sort
@@ -566,7 +569,9 @@ Toggle filename display
.It f , F
Save the current filelist to a unique filename
.It h , H
Pause the slideshow
Pause/Continue the slideshow.  When it is paused, it will not automatically
change slides based on
.Cm --slideshow-delay
.It m , M
Show menu
.It n , N , Ao space Ac , Aq right
+5 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ void init_parse_options(int argc, char **argv)
	memset(&opt, 0, sizeof(fehoptions));
	opt.display = 1;
	opt.aspect = 1;
	opt.slideshow_delay = -1.0;
	opt.slideshow_delay = 0.0;
	opt.thumb_w = 60;
	opt.thumb_h = 60;
	opt.thumb_redraw = 10;
@@ -597,6 +597,10 @@ static void feh_parse_option_array(int argc, char **argv)
			break;
		case 'D':
			opt.slideshow_delay = atof(optarg);
			if (opt.slideshow_delay < 0.0) {
				opt.slideshow_delay *= (-1);
				opt.paused = 1;
			}
			break;
		case 'R':
			opt.reload = atoi(optarg);
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ void init_slideshow_mode(void)
			free(s);
			success = 1;
			winwidget_show(w);
			if (opt.slideshow_delay >= 0.0)
			if (opt.slideshow_delay > 0.0)
				feh_add_timer(cb_slide_timer, w, opt.slideshow_delay, "SLIDE_CHANGE");
			else if (opt.reload > 0)
				feh_add_unique_timer(cb_reload_timer, w, opt.reload);
@@ -278,7 +278,7 @@ void slideshow_change_image(winwidget winwid, int change)
	if (filelist_len == 0)
		eprintf("No more slides in show");

	if (opt.slideshow_delay >= 0.0)
	if (opt.slideshow_delay > 0.0)
		feh_add_timer(cb_slide_timer, winwid, opt.slideshow_delay, "SLIDE_CHANGE");
	D_RETURN_(4);
}