Mercurial > geeqie.yaz
changeset 326:509b84801d66
Rename slideshow options.
author | zas_ |
---|---|
date | Sat, 12 Apr 2008 07:46:01 +0000 |
parents | a0fcd4934266 |
children | 049d6b00cc14 |
files | src/globals.c src/main.c src/preferences.c src/rcfile.c src/slideshow.c src/typedefs.h |
diffstat | 6 files changed, 32 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/src/globals.c Sat Apr 12 07:09:19 2008 +0000 +++ b/src/globals.c Sat Apr 12 07:46:01 2008 +0000 @@ -75,9 +75,9 @@ 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;
--- a/src/main.c Sat Apr 12 07:09:19 2008 +0000 +++ b/src/main.c Sat Apr 12 07:46:01 2008 +0000 @@ -403,7 +403,7 @@ 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)
--- a/src/preferences.c Sat Apr 12 07:09:19 2008 +0000 +++ b/src/preferences.c Sat Apr 12 07:46:01 2008 +0000 @@ -133,7 +133,7 @@ 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); } @@ -214,9 +214,9 @@ 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; @@ -847,15 +847,15 @@ 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 */
--- a/src/rcfile.c Sat Apr 12 07:09:19 2008 +0000 +++ b/src/rcfile.c Sat Apr 12 07:46:01 2008 +0000 @@ -372,10 +372,10 @@ 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"); @@ -678,12 +678,12 @@ /* 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 */
--- a/src/slideshow.c Sat Apr 12 07:09:19 2008 +0000 +++ b/src/slideshow.c Sat Apr 12 07:46:01 2008 +0000 @@ -94,7 +94,7 @@ if (ss->list) g_list_free(ss->list); - if (options->slideshow_random) + if (options->slideshow.random) { ss->list = generate_random_list(ss); } @@ -209,7 +209,7 @@ } } - if (!ss->list && options->slideshow_repeat) + if (!ss->list && options->slideshow.repeat) { slideshow_list_init(ss, -1); } @@ -274,10 +274,10 @@ { 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) @@ -350,7 +350,7 @@ { 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); } @@ -364,7 +364,7 @@ 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; }
--- a/src/typedefs.h Sat Apr 12 07:09:19 2008 +0000 +++ b/src/typedefs.h Sat Apr 12 07:46:01 2008 +0000 @@ -786,9 +786,11 @@ 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;