Commit 6a08b24c authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Add paused status to progress infos and use it to avoid poping up the

2008-02-13  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-progress-info.[ch]:
        * libnautilus-private/nautilus-file-operations.c:
	Add paused status to progress infos and use it
	to avoid poping up the progress dialog while dialogs
	are up. (#512406)
	Patch from Cosimo Cecchi


svn path=/trunk/; revision=13741
parent 552127f7
2008-02-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-progress-info.[ch]:
* libnautilus-private/nautilus-file-operations.c:
Add paused status to progress infos and use it
to avoid poping up the progress dialog while dialogs
are up. (#512406)
Patch from Cosimo Cecchi
2008-02-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-dnd.c:
......
......@@ -950,11 +950,12 @@ run_simple_dialog_va (CommonJob *job,
g_ptr_array_add (ptr_array, NULL);
data->button_titles = (const char **)g_ptr_array_free (ptr_array, FALSE);
nautilus_progress_info_pause (job->progress);
g_io_scheduler_job_send_to_mainloop (job->io_job,
do_run_simple_dialog,
data,
NULL);
nautilus_progress_info_resume (job->progress);
res = data->result;
g_free (data->button_titles);
......
......@@ -59,6 +59,7 @@ struct _NautilusProgressInfo
gboolean activity_mode;
gboolean started;
gboolean finished;
gboolean paused;
GSource *idle_source;
gboolean source_is_now;
......@@ -423,6 +424,9 @@ handle_new_progress_info (NautilusProgressInfo *info)
static gboolean
new_op_started_timeout (NautilusProgressInfo *info)
{
if (nautilus_progress_info_get_is_paused (info)) {
return TRUE;
}
if (!nautilus_progress_info_get_is_finished (info)) {
handle_new_progress_info (info);
}
......@@ -567,6 +571,20 @@ nautilus_progress_info_get_is_finished (NautilusProgressInfo *info)
return res;
}
gboolean
nautilus_progress_info_get_is_paused (NautilusProgressInfo *info)
{
gboolean res;
G_LOCK (progress_info);
res = info->paused;
G_UNLOCK (progress_info);
return res;
}
static gboolean
idle_callback (gpointer data)
{
......@@ -666,6 +684,30 @@ queue_idle (NautilusProgressInfo *info, gboolean now)
}
}
void
nautilus_progress_info_pause (NautilusProgressInfo *info)
{
G_LOCK (progress_info);
if (!info->paused) {
info->paused = TRUE;
}
G_UNLOCK (progress_info);
}
void
nautilus_progress_info_resume (NautilusProgressInfo *info)
{
G_LOCK (progress_info);
if (info->paused) {
info->paused = FALSE;
}
G_UNLOCK (progress_info);
}
void
nautilus_progress_info_start (NautilusProgressInfo *info)
{
......
......@@ -61,9 +61,12 @@ GCancellable *nautilus_progress_info_get_cancellable (NautilusProgressInfo *info
void nautilus_progress_info_cancel (NautilusProgressInfo *info);
gboolean nautilus_progress_info_get_is_started (NautilusProgressInfo *info);
gboolean nautilus_progress_info_get_is_finished (NautilusProgressInfo *info);
gboolean nautilus_progress_info_get_is_paused (NautilusProgressInfo *info);
void nautilus_progress_info_start (NautilusProgressInfo *info);
void nautilus_progress_info_finish (NautilusProgressInfo *info);
void nautilus_progress_info_pause (NautilusProgressInfo *info);
void nautilus_progress_info_resume (NautilusProgressInfo *info);
void nautilus_progress_info_set_status (NautilusProgressInfo *info,
const char *status);
void nautilus_progress_info_take_status (NautilusProgressInfo *info,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment