aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-05-13 22:31:13 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:15 +0800
commit757c1ded565f66497fe6e617cbb618ee81004328 (patch)
tree09cc3d6b387cebaecc24bdc7fefeb6cfc92c1cfa /mail
parent0c93d23fe1268a16be798d76962e07907a547cb7 (diff)
downloadgsoc2013-evolution-757c1ded565f66497fe6e617cbb618ee81004328.tar
gsoc2013-evolution-757c1ded565f66497fe6e617cbb618ee81004328.tar.gz
gsoc2013-evolution-757c1ded565f66497fe6e617cbb618ee81004328.tar.bz2
gsoc2013-evolution-757c1ded565f66497fe6e617cbb618ee81004328.tar.lz
gsoc2013-evolution-757c1ded565f66497fe6e617cbb618ee81004328.tar.xz
gsoc2013-evolution-757c1ded565f66497fe6e617cbb618ee81004328.tar.zst
gsoc2013-evolution-757c1ded565f66497fe6e617cbb618ee81004328.zip
Bug #646033 - Update progress in Send/Receive dialog
Diffstat (limited to 'mail')
-rw-r--r--mail/mail-send-recv.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index a39bf77d1a..a6eb037520 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -922,6 +922,12 @@ get_folders (CamelStore *store, GPtrArray *folders, CamelFolderInfo *info)
}
}
+static void
+main_op_cancelled_cb (GCancellable *main_op, GCancellable *refresh_op)
+{
+ g_cancellable_cancel (refresh_op);
+}
+
struct _refresh_folders_msg {
MailMsg base;
@@ -945,6 +951,10 @@ refresh_folders_exec (struct _refresh_folders_msg *m,
CamelFolder *folder;
gint i;
GError *local_error = NULL;
+ gulong handler_id = 0;
+
+ if (cancellable)
+ handler_id = g_signal_connect (m->info->cancellable, "cancelled", G_CALLBACK (main_op_cancelled_cb), cancellable);
get_folders (m->store, m->folders, m->finfo);
@@ -966,7 +976,13 @@ refresh_folders_exec (struct _refresh_folders_msg *m,
if (g_cancellable_is_cancelled (m->info->cancellable))
break;
+
+ if (m->info->state != SEND_CANCELLED)
+ g_signal_emit_by_name (m->info->cancellable, "status", _("Updating..."), 100 * i / m->folders->len);
}
+
+ if (cancellable)
+ g_signal_handler_disconnect (m->info->cancellable, handler_id);
}
static void