#include <glib/gi18n.h>
#include "background.h"
+#include "settings.h"
static GThreadPool *thread_pool = NULL;
static gboolean stop_all_threads = FALSE;
{
static gchar buf[20];
g_snprintf(buf, sizeof(buf), _("%d items"), bgitemcount);
- vik_window_signal_statusbar_update ( vw, buf, VIK_STATUSBAR_ITEMS );
+ vik_window_statusbar_update ( vw, buf, VIK_STATUSBAR_ITEMS );
}
static void background_thread_update ()
gtk_widget_hide ( bgwindow );
}
+#define VIK_SETTINGS_BACKGROUND_MAX_THREADS "background_max_threads"
+
/**
* a_background_init:
*
void a_background_init()
{
/* initialize thread pool */
- /* TODO parametrize this via preference and/or command line arg */
gint max_threads = 10; /* limit maximum number of threads running at one time */
+ gint maxt;
+ if ( a_settings_get_integer ( VIK_SETTINGS_BACKGROUND_MAX_THREADS, &maxt ) )
+ max_threads = maxt;
+
thread_pool = g_thread_pool_new ( (GFunc) thread_helper, NULL, max_threads, FALSE, NULL );
GtkCellRenderer *renderer;
/* wait until all running threads stop */
stop_all_threads = TRUE;
g_thread_pool_free ( thread_pool, TRUE, TRUE );
+
+ gtk_list_store_clear ( bgstore );
+ g_object_unref ( bgstore );
+
+ gtk_widget_destroy ( bgwindow );
}
void a_background_add_window (VikWindow *vw)