Hi,
On Jun/17/2012, Carles Pina i Estany wrote:
>
> Hi,a
>
> On Jun/17/2012, Carles Pina i Estany wrote:
> >
> > 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.
>
> if there is interest in this feature to go to geeqie:
>
> a) I'll do that "back" on the first one goes to the last photo
> b) it seems that the option is not saved/restored, I'll fix and share
a new patch with everything included.
--
Carles Pina i Estany
Web: http://pinux.info || Blog: http://pintant.cat
>From c1a2d68955239bc1f24cde7be5a93bc9ce3d929b 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 | 18 ++++++++++++++++--
src/options.h | 1 +
src/preferences.c | 3 +++
src/rcfile.c | 2 ++
4 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/layout_image.c b/src/layout_image.c
index cfe0661..3323356 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
@@ -1285,7 +1292,14 @@ void layout_image_prev(LayoutWindow *lw)
}
else
{
- image_osd_icon(lw->image, IMAGE_OSD_FIRST, -1);
+ if (options->repeat)
+ {
+ layout_image_set_index(lw, layout_list_count(lw, NULL) - 1);
+ }
+ else
+ {
+ image_osd_icon(lw->image, IMAGE_OSD_FIRST, -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);
diff --git a/src/rcfile.c b/src/rcfile.c
index ae415b9..e738f79 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -276,6 +276,7 @@ static void write_global_attributes(GString *outstr, gint indent)
WRITE_SEPARATOR();
WRITE_NL(); WRITE_BOOL(*options, mousewheel_scrolls);
+ WRITE_NL(); WRITE_BOOL(*options, repeat);
WRITE_NL(); WRITE_INT(*options, open_recent_list_maxsize);
WRITE_NL(); WRITE_INT(*options, dnd_icon_size);
WRITE_NL(); WRITE_BOOL(*options, place_dialogs_under_mouse);
@@ -594,6 +595,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
if (READ_BOOL(*options, progressive_key_scrolling)) continue;
if (READ_BOOL(*options, mousewheel_scrolls)) continue;
+ if (READ_BOOL(*options, repeat)) continue;
if (READ_INT(*options, open_recent_list_maxsize)) continue;
if (READ_INT(*options, dnd_icon_size)) continue;
--
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