Hi,
Find the patch attached.
Feel free to comment about anything -I'd adjust the patch if after some
changes may go to master :)
Should the option be in some other place or named differently? (it's
based in the "repeat" name in the slideshow): tell me.
Thank you,
--
Carles Pina i Estany
Web: http://pinux.info || Blog: http://pintant.cat
>From a2b5615ed1cca621cd4a939c0bd2dd14883364af Mon Sep 17 00:00:00 2001
From: Carles Pina i Estany <car...@pina.cat>
Date: Sun, 17 Jun 2012 19:52:43 +0100
Subject: [PATCH] Adds an option to repeat automatically: if the user presses
next in the last image it goes back to the first image.
---
src/layout_image.c | 9 ++++++++-
src/options.h | 1 +
src/preferences.c | 3 +++
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/layout_image.c b/src/layout_image.c
index cfe0661..d2b826a 100644
--- a/src/layout_image.c
+++ b/src/layout_image.c
@@ -1212,7 +1212,14 @@ void layout_image_next(LayoutWindow *lw)
}
else
{
- image_osd_icon(lw->image, IMAGE_OSD_LAST, -1);
+ if (options->repeat)
+ {
+ layout_image_set_index(lw, 0);
+ }
+ else
+ {
+ image_osd_icon(lw->image, IMAGE_OSD_LAST, -1);
+ }
}
}
else
diff --git a/src/options.h b/src/options.h
index 5020aba..866f044 100644
--- a/src/options.h
+++ b/src/options.h
@@ -21,6 +21,7 @@ struct _ConfOptions
gboolean place_dialogs_under_mouse;
gboolean mousewheel_scrolls;
gboolean show_icon_names;
+ gboolean repeat;
/* various */
gboolean tree_descend_subdirs;
diff --git a/src/preferences.c b/src/preferences.c
index 19f8db9..00425bb 100644
--- a/src/preferences.c
+++ b/src/preferences.c
@@ -249,6 +249,7 @@ static void config_window_apply(void)
options->slideshow.delay = c_options->slideshow.delay;
options->mousewheel_scrolls = c_options->mousewheel_scrolls;
+ options->repeat = c_options->repeat;
options->file_ops.enable_in_place_rename = c_options->file_ops.enable_in_place_rename;
@@ -1940,6 +1941,8 @@ static void config_tab_behavior(GtkWidget *notebook)
options->progressive_key_scrolling, &c_options->progressive_key_scrolling);
pref_checkbox_new_int(group, _("Mouse wheel scrolls image"),
options->mousewheel_scrolls, &c_options->mousewheel_scrolls);
+ pref_checkbox_new_int(group, _("Repeat"),
+ options->repeat, &c_options->repeat);
group = pref_group_new(vbox, FALSE, _("Miscellaneous"), GTK_ORIENTATION_VERTICAL);
--
1.7.9.1
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geeqie-devel mailing list
Geeqie-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geeqie-devel