diff options
author | emanuele-f <[email protected]> | 2016-06-11 23:30:06 +0200 |
---|---|---|
committer | lukefromdc <[email protected]> | 2016-10-17 14:05:35 -0400 |
commit | a17a2a6f28d6c5c3b3726879d12eabafe5ad98a2 (patch) | |
tree | 87a9e4db7ddea468b1daaa1fe574590fecd66b05 /libcaja-private/caja-progress-info.c | |
parent | afb7f9deb2337b6e4775fb9bc02b01d4a3fdb852 (diff) | |
download | caja-a17a2a6f28d6c5c3b3726879d12eabafe5ad98a2.tar.bz2 caja-a17a2a6f28d6c5c3b3726879d12eabafe5ad98a2.tar.xz |
operations can now specify to start immediately
Diffstat (limited to 'libcaja-private/caja-progress-info.c')
-rw-r--r-- | libcaja-private/caja-progress-info.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c index 729409d2..26faf6ae 100644 --- a/libcaja-private/caja-progress-info.c +++ b/libcaja-private/caja-progress-info.c @@ -75,6 +75,7 @@ struct _CajaProgressInfo gboolean finished; gboolean paused; + gboolean atstart; gboolean waiting; GCond waiting_c; @@ -650,11 +651,11 @@ widget_state_notify_paused_callback (ProgressWidgetData *data) } void -caja_progress_info_wait_unpaused (CajaProgressInfo *info) +caja_progress_info_get_ready (CajaProgressInfo *info) { if (info->waiting) { G_LOCK (progress_info); - if (info->waiting) { + if (info->waiting && !(info->atstart && !info->widget)) { // Notify main thread we have stopped and are waiting GSource * source = g_idle_source_new (); g_source_set_callback (source, (GSourceFunc)widget_state_notify_paused_callback, info->widget, NULL); @@ -871,10 +872,10 @@ handle_new_progress_info (CajaProgressInfo *info) n_progress_ops++; - // TODO use different policies + // TODO use user defined policies container = get_widgets_container(); if (container != NULL) { - if (get_running_operations (container) > 0) + if (!info->atstart && get_running_operations (container) > 0) widget_state_transit_to (info->widget, STATE_QUEUED); else widget_state_transit_to (info->widget, STATE_RUNNING); @@ -920,12 +921,13 @@ caja_progress_info_init (CajaProgressInfo *info) } CajaProgressInfo * -caja_progress_info_new (void) +caja_progress_info_new (gboolean dostart) { CajaProgressInfo *info; info = g_object_new (CAJA_TYPE_PROGRESS_INFO, NULL); info->waiting = TRUE; + info->atstart = dostart; return info; } |