options->file_sort_method = SORT_NAME;
options->file_sort_ascending = TRUE;
- options->slideshow_delay = 150;
- options->slideshow_random = FALSE;
- options->slideshow_repeat = FALSE;
+ options->slideshow.delay = 150;
+ options->slideshow.random = FALSE;
+ options->slideshow.repeat = FALSE;
options->mousewheel_scrolls = FALSE;
options->enable_in_place_rename = TRUE;
return;
}
- options->slideshow_delay = (gint)(n * 10.0 + 0.01);
+ options->slideshow.delay = (gint)(n * 10.0 + 0.01);
}
static void gr_tools_show(const gchar *text, gpointer data)
static void slideshow_delay_cb(GtkWidget *spin, gpointer data)
{
- c_options->slideshow_delay = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) *
+ c_options->slideshow.delay = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) *
(double)SLIDESHOW_SUBSECOND_PRECISION + 0.01);
}
sidecar_ext_parse(gtk_entry_get_text(GTK_ENTRY(sidecar_ext_entry)), FALSE);
- options->slideshow_random = c_options->slideshow_random;
- options->slideshow_repeat = c_options->slideshow_repeat;
- options->slideshow_delay = c_options->slideshow_delay;
+ options->slideshow.random = c_options->slideshow.random;
+ options->slideshow.repeat = c_options->slideshow.repeat;
+ options->slideshow.delay = c_options->slideshow.delay;
options->mousewheel_scrolls = c_options->mousewheel_scrolls;
group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL);
- c_options->slideshow_delay = options->slideshow_delay;
+ c_options->slideshow.delay = options->slideshow.delay;
spin = pref_spin_new(group, _("Delay between image change:"), _("seconds"),
SLIDESHOW_MIN_SECONDS, SLIDESHOW_MAX_SECONDS, 1.0, 1,
- options->slideshow_delay ? (double)options->slideshow_delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0,
+ options->slideshow.delay ? (double)options->slideshow.delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0,
G_CALLBACK(slideshow_delay_cb), NULL);
gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS);
- pref_checkbox_new_int(group, _("Random"), options->slideshow_random, &c_options->slideshow_random);
- pref_checkbox_new_int(group, _("Repeat"), options->slideshow_repeat, &c_options->slideshow_repeat);
+ pref_checkbox_new_int(group, _("Random"), options->slideshow.random, &c_options->slideshow.random);
+ pref_checkbox_new_int(group, _("Repeat"), options->slideshow.repeat, &c_options->slideshow.repeat);
}
/* image tab */
secure_fprintf(ssi, "\n##### Slideshow Options #####\n\n");
- write_int_unit_option(ssi, "slideshow_delay", options->slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION);
+ write_int_unit_option(ssi, "slideshow.delay", options->slideshow.delay, SLIDESHOW_SUBSECOND_PRECISION);
- write_bool_option(ssi, "slideshow_random", options->slideshow_random);
- write_bool_option(ssi, "slideshow_repeat", options->slideshow_repeat);
+ write_bool_option(ssi, "slideshow.random", options->slideshow.random);
+ write_bool_option(ssi, "slideshow.repeat", options->slideshow.repeat);
secure_fprintf(ssi, "\n##### Filtering Options #####\n\n");
/* slideshow options */
- options->slideshow_delay = read_int_unit_option(f, option,
- "slideshow_delay", value, options->slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION);
- options->slideshow_random = read_bool_option(f, option,
- "slideshow_random", value, options->slideshow_random);
- options->slideshow_repeat = read_bool_option(f, option,
- "slideshow_repeat", value, options->slideshow_repeat);
+ options->slideshow.delay = read_int_unit_option(f, option,
+ "slideshow.delay", value, options->slideshow.delay, SLIDESHOW_SUBSECOND_PRECISION);
+ options->slideshow.random = read_bool_option(f, option,
+ "slideshow.random", value, options->slideshow.random);
+ options->slideshow.repeat = read_bool_option(f, option,
+ "slideshow.repeat", value, options->slideshow.repeat);
/* filtering options */
if (ss->list) g_list_free(ss->list);
- if (options->slideshow_random)
+ if (options->slideshow.random)
{
ss->list = generate_random_list(ss);
}
}
}
- if (!ss->list && options->slideshow_repeat)
+ if (!ss->list && options->slideshow.repeat)
{
slideshow_list_init(ss, -1);
}
{
if (reset)
{
- if (options->slideshow_delay < 1) options->slideshow_delay = 1;
+ if (options->slideshow.delay < 1) options->slideshow.delay = 1;
if (ss->timeout_id != -1) g_source_remove(ss->timeout_id);
- ss->timeout_id = g_timeout_add(options->slideshow_delay * 1000 / SLIDESHOW_SUBSECOND_PRECISION,
+ ss->timeout_id = g_timeout_add(options->slideshow.delay * 1000 / SLIDESHOW_SUBSECOND_PRECISION,
slideshow_loop_cb, ss);
}
else if (ss->timeout_id != -1)
{
collection_ref(ss->cd);
ss->slide_count = g_list_length(ss->cd->list);
- if (!options->slideshow_random && start_info)
+ if (!options->slideshow.random && start_info)
{
start_index = g_list_index(ss->cd->list, start_info);
}
if (ss->slide_count < 2)
{
ss->slide_count = layout_list_count(ss->layout, NULL);
- if (!options->slideshow_random && start_point >= 0 && start_point < ss->slide_count)
+ if (!options->slideshow.random && start_point >= 0 && start_point < ss->slide_count)
{
start_index = start_point;
}
SortType file_sort_method;
gint file_sort_ascending;
- gint slideshow_delay; /* in tenths of a second */
- gint slideshow_random;
- gint slideshow_repeat;
+ struct {
+ gint delay; /* in tenths of a second */
+ gint random;
+ gint repeat;
+ } slideshow;
gint mousewheel_scrolls;
gint enable_in_place_rename;