<?xml version="1.0" encoding="utf-8"?>\r
-<section id="GuideOptionsAdvanced">\r
- <title>External preview extraction</title>\r
- <para>\r
+ <section id="GuideOptionsAdvanced">\r
+<title>Advanced</title>\r
+ <section id="ExternalPreviewExtraction">\r
+ <title>External preview extraction</title>\r
+ <para>\r
The intention of this feature is to give the user the possibility to display image previews of files\r
that the standard libraries cannot decode.\r
<para />\r
</pre>\r
</para>\r
</section>\r
+<section id="ThreadPools">\r
+ <title>Thread Pools</title>\r
+ <para>This option will limit the number of threads (cores) that are used when performing a duplicate image search. A value of <code>0</code> means use all available threads. This will give the fastest processing time, but will slow other processes including user input response time.</para> \r
+</section>\r
+</section>\r
g_mutex_init(&dw->thread_count_mutex);
g_mutex_init(&dw->search_matches_mutex);
- dw->dupe_comparison_thread_pool = g_thread_pool_new(dupe_comparison_func, dw, -1, FALSE, NULL);
+ dw->dupe_comparison_thread_pool = g_thread_pool_new(dupe_comparison_func, dw, options->threads.duplicates, FALSE, NULL);
return dw;
}
#include "layout_config.h"
#include "layout_util.h"
#include "metadata.h"
+#include "misc.h"
#include "osd.h"
#include "pixbuf_util.h"
#include "rcfile.h"
options->star_rating.star = c_options->star_rating.star;
options->star_rating.rejected = c_options->star_rating.rejected;
+
+ options->threads.duplicates = c_options->threads.duplicates > 0 ? c_options->threads.duplicates : -1;
+
#ifdef DEBUG
set_debug_level(debug_c);
#endif
GdkPixbufFormat *fm;
gint i;
GString *types_string = g_string_new(NULL);
+ GtkWidget *types_string_label;
+ GtkWidget *threads_string_label;
+ GtkWidget *dupes_threads_spin;
vbox = scrolled_notebook_page(notebook, _("Advanced"));
group = pref_group_new(vbox, FALSE, _("External preview extraction"), GTK_ORIENTATION_VERTICAL);
}
types_string = g_string_prepend(types_string, _("Usable file types:\n"));
- pref_label_new(group, types_string->str);
- GtkWidget *types_string_label = gtk_label_new(types_string->str);
+ types_string_label = pref_label_new(group, types_string->str);
gtk_label_set_line_wrap(GTK_LABEL(types_string_label), TRUE);
pref_spacer(group, PREF_PAD_GROUP);
g_slist_free(formats_list);
string_list_free(extensions_list);
g_string_free(types_string, TRUE);
+
+ pref_spacer(group, PREF_PAD_GROUP);
+
+ pref_line(vbox, PREF_PAD_SPACE);
+ group = pref_group_new(vbox, FALSE, _("Thread pool limits"), GTK_ORIENTATION_VERTICAL);
+
+ threads_string_label = pref_label_new(group, "This option limits the number of threads (or cpu cores)\nthat Geeqie will use when running duplicate checks. The default value is 0, which means all avaialble cores will be used.");
+ gtk_label_set_line_wrap(GTK_LABEL(threads_string_label), TRUE);
+
+ pref_spacer(vbox, PREF_PAD_GROUP);
+
+ dupes_threads_spin = pref_spin_new_int(vbox, _("Duplicate check:"), _("max. threads"), 0, get_cpu_cores(), 1, options->threads.duplicates, &c_options->threads.duplicates);
+ gtk_widget_set_tooltip_markup(dupes_threads_spin, _("Set to 0 for unlimited"));
}
/* stereo tab */
WRITE_NL(); WRITE_BOOL(*options, printer.show_page_text);
WRITE_SEPARATOR();
+ /* Threads */
+ WRITE_NL(); WRITE_INT(*options, threads.duplicates);
+ WRITE_SEPARATOR();
+
/* user-definable mouse buttons */
WRITE_NL(); WRITE_CHAR(*options, mouse_button_8);
WRITE_NL(); WRITE_CHAR(*options, mouse_button_9);
if (READ_BOOL(*options, printer.show_image_text)) continue;
if (READ_BOOL(*options, printer.show_page_text)) continue;
+ /* Threads */
+ if (READ_INT(*options, threads.duplicates)) continue;
+
/* user-definable mouse buttons */
if (READ_CHAR(*options, mouse_button_8)) continue;
if (READ_CHAR(*options, mouse_button_9)) continue;