information = g_object_get_data (G_OBJECT (widget), "EmpathyContactWidget");
if (!information)
- {
return NULL;
- }
return information->contact;
}
chooser = EMPATHY_ACCOUNT_CHOOSER (information->widget_account);
if (chooser)
- {
empathy_account_chooser_set_filter (chooser, filter, user_data);
- }
}
static void
contact_widget_remove_contact (information);
if (contact)
- {
information->contact = g_object_ref (contact);
- }
/* Update information for widgets */
contact_widget_contact_update (information);
splitted = g_strsplit (avatar->format, "/", 2);
if (splitted[0] != NULL && splitted[1] != NULL)
- {
ext = g_strdup (splitted[1]);
- }
g_strfreev (splitted);
}
/* Update id widget */
if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_ID)
- {
gtk_entry_set_text (GTK_ENTRY (information->widget_id), id ? id : "");
- }
else
- {
gtk_label_set_label (GTK_LABEL (information->widget_id), id ? id : "");
- }
/* Update other widgets */
if (information->contact)
account = empathy_account_chooser_get_account (
EMPATHY_ACCOUNT_CHOOSER (information->widget_account));
if (!account)
- return;
+ return;
if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_ID)
{
id = gtk_entry_get_text (GTK_ENTRY (information->widget_id));
if (G_STR_EMPTY (id))
- return;
+ return;
contact = empathy_contact_factory_get_from_id (information->factory,
account, id);
}
else
{
- contact = empathy_contact_factory_get_user (information->factory,
- account);
- }
+ contact = empathy_contact_factory_get_user (information->factory,
+ account);
+ }
if (contact)
{
contact_widget_name_notify_cb (EmpathyContactWidget *information)
{
if (GTK_IS_ENTRY (information->widget_alias))
- {
gtk_entry_set_text (GTK_ENTRY (information->widget_alias),
empathy_contact_get_name (information->contact));
- }
else
- {
gtk_label_set_label (GTK_LABEL (information->widget_alias),
empathy_contact_get_name (information->contact));
- }
}
static void
{
EmpathyAvatar *avatar = NULL;
- if (information->contact) {
- avatar = empathy_contact_get_avatar (information->contact);
- }
- if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_AVATAR) {
- g_signal_handlers_block_by_func (information->widget_avatar,
- contact_widget_avatar_changed_cb,
- information);
- empathy_avatar_chooser_set (
- EMPATHY_AVATAR_CHOOSER (information->widget_avatar), avatar);
- g_signal_handlers_unblock_by_func (information->widget_avatar,
- contact_widget_avatar_changed_cb, information);
- }
- else
+ if (information->contact)
+ avatar = empathy_contact_get_avatar (information->contact);
+
+ if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_AVATAR)
{
+ g_signal_handlers_block_by_func (information->widget_avatar,
+ contact_widget_avatar_changed_cb,
+ information);
+ empathy_avatar_chooser_set (
+ EMPATHY_AVATAR_CHOOSER (information->widget_avatar), avatar);
+ g_signal_handlers_unblock_by_func (information->widget_avatar,
+ contact_widget_avatar_changed_cb, information);
+ }
+ else
empathy_avatar_image_set (
EMPATHY_AVATAR_IMAGE (information->widget_avatar), avatar);
- }
}
static void
gtk_widget_show (information->vbox_groups);
}
else
- {
gtk_widget_hide (information->vbox_groups);
- }
}
static void
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
if (information->renderer)
- {
g_object_unref (information->renderer);
- }
information->renderer = g_object_ref (renderer);
}
FindName data;
if (G_STR_EMPTY (name))
- return FALSE;
+ return FALSE;
data.information = information;
data.name = name;
-1);
if (!name)
- return FALSE;
+ return FALSE;
if (data->name && strcmp (data->name, name) == 0)
{
if (group)
{
- if (enabled)
- {
- empathy_contact_list_remove_from_group (
- EMPATHY_CONTACT_LIST (information->manager), information->contact,
- group);
- }
- else
- {
- empathy_contact_list_add_to_group (
- EMPATHY_CONTACT_LIST (information->manager), information->contact,
- group);
+ if (enabled)
+ {
+ empathy_contact_list_remove_from_group (
+ EMPATHY_CONTACT_LIST (information->manager), information->contact,
+ group);
+ }
+ else
+ {
+ empathy_contact_list_add_to_group (
+ EMPATHY_CONTACT_LIST (information->manager), information->contact,
+ group);
+ }
+ g_free (group);
}
-
- g_free (group);
- }
}
static void
group = gtk_entry_get_text (GTK_ENTRY (information->entry_group));
if (contact_widget_model_find_name (information, group, &iter))
- {
gtk_widget_set_sensitive (GTK_WIDGET (information->button_group), FALSE);
- }
else
- {
gtk_widget_set_sensitive (GTK_WIDGET (information->button_group),
!G_STR_EMPTY (group));
- }
}
static void