+static void update_branding (ModestMsgEditWindow *self,
+ const gchar *new_account)
+{
+ ModestMsgEditWindowPrivate *priv;
+ ModestAccountMgr *mgr;
+ const GdkPixbuf *new_icon = NULL;
+ gchar *new_label = NULL;
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
+
+ mgr = modest_runtime_get_account_mgr ();
+
+ modest_account_mgr_get_branding_from_recipient (mgr, new_account, &new_label, &new_icon, MODEST_ICON_SIZE_SMALL);
+ if (new_icon) {
+ gtk_image_set_from_pixbuf (GTK_IMAGE (priv->brand_icon), (GdkPixbuf *) new_icon);
+ gtk_widget_show (priv->brand_icon);
+ } else {
+ gtk_widget_hide (priv->brand_icon);
+ }
+ if (new_label) {
+ gtk_label_set_text (GTK_LABEL (priv->brand_label), new_label);
+ gtk_widget_show (priv->brand_label);
+ g_free (new_label);
+ } else {
+ gtk_widget_hide (priv->brand_label);
+ }
+}
+