source-dialog: bind title when diting

This commit is contained in:
Georges Basile Stavracas Neto
2015-05-25 12:31:06 -04:00
committed by Erick Pérez Castellanos
parent 8097b22b60
commit a4ffdf0314
+14
View File
@@ -35,6 +35,7 @@ typedef struct
/* flags */
gint mode : 1;
ESource *source;
GBinding *title_bind;
/* manager */
GcalManager *manager;
@@ -227,12 +228,25 @@ gcal_source_dialog_set_mode (GcalSourceDialog *dialog,
if (!edit_mode)
{
/* Free any bindings left behind */
if (priv->title_bind != NULL)
{
g_binding_unbind (priv->title_bind);
priv->title_bind = NULL;
}
gtk_window_resize (GTK_WINDOW (dialog), 550, 500);
gtk_header_bar_set_title (GTK_HEADER_BAR (priv->headerbar), _("Add Calendar"));
gtk_header_bar_set_subtitle (GTK_HEADER_BAR (priv->headerbar), "");
}
else
{
/* bind title when nothing is binded */
if (priv->title_bind == NULL)
{
priv->title_bind = g_object_bind_property (priv->name_entry, "text", priv->headerbar, "title",
G_BINDING_DEFAULT);
}
gtk_window_resize (GTK_WINDOW (dialog), 550, 250);
}
}