aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-ft-manager.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-05-19 18:16:39 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:53:22 +0800
commitf2020ab546f98b45080923b07129b2ab38d087bd (patch)
tree35a1211250b490da34a347147a11fd1960a407e0 /src/empathy-ft-manager.c
parentee4dc84a5d3a25576e9960b52dc8fa0e1e6a4703 (diff)
downloadgsoc2013-empathy-f2020ab546f98b45080923b07129b2ab38d087bd.tar
gsoc2013-empathy-f2020ab546f98b45080923b07129b2ab38d087bd.tar.gz
gsoc2013-empathy-f2020ab546f98b45080923b07129b2ab38d087bd.tar.bz2
gsoc2013-empathy-f2020ab546f98b45080923b07129b2ab38d087bd.tar.lz
gsoc2013-empathy-f2020ab546f98b45080923b07129b2ab38d087bd.tar.xz
gsoc2013-empathy-f2020ab546f98b45080923b07129b2ab38d087bd.tar.zst
gsoc2013-empathy-f2020ab546f98b45080923b07129b2ab38d087bd.zip
Clear the remaining time when transfer ends
Also, use empathy_builder_unref_and_keep_widget() on the EmpathyFTManager toplevel.
Diffstat (limited to 'src/empathy-ft-manager.c')
-rw-r--r--src/empathy-ft-manager.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/empathy-ft-manager.c b/src/empathy-ft-manager.c
index 155506486..603e0ca58 100644
--- a/src/empathy-ft-manager.c
+++ b/src/empathy-ft-manager.c
@@ -423,6 +423,25 @@ ft_manager_update_handler_time (EmpathyFTManager *manager,
}
static void
+ft_manager_clear_handler_time (EmpathyFTManager *manager,
+ GtkTreeRowReference *row_ref)
+{
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ EmpathyFTManagerPriv *priv = GET_PRIV (manager);
+
+ /* Set new value in the store */
+ path = gtk_tree_row_reference_get_path (row_ref);
+ gtk_tree_model_get_iter (priv->model, &iter, path);
+ gtk_list_store_set (GTK_LIST_STORE (priv->model),
+ &iter,
+ COL_REMAINING, NULL,
+ -1);
+
+ gtk_tree_path_free (path);
+}
+
+static void
ft_handler_transfer_error_cb (EmpathyFTHandler *handler,
GError *error,
EmpathyFTManager *manager)
@@ -438,6 +457,7 @@ ft_handler_transfer_error_cb (EmpathyFTHandler *handler,
message = ft_manager_format_error_message (handler, error);
ft_manager_update_handler_message (manager, row_ref, message);
+ ft_manager_clear_handler_time (manager, row_ref);
ft_manager_update_buttons (manager);
g_free (message);
@@ -479,6 +499,7 @@ do_real_transfer_done (EmpathyFTManager *manager,
message = g_strdup_printf ("%s\n%s", first_line, second_line);
ft_manager_update_handler_message (manager, row_ref, message);
+ ft_manager_clear_handler_time (manager, row_ref);
/* update buttons */
ft_manager_update_buttons (manager);
@@ -953,7 +974,7 @@ ft_manager_build_ui (EmpathyFTManager *manager)
"ft_manager_dialog", "configure-event", ft_manager_configure_event_cb,
NULL);
- g_object_unref (gui);
+ empathy_builder_unref_and_keep_widget (gui, priv->window);
/* Window geometry. */
empathy_geometry_load ("ft-manager", &x, &y, &w, &h);