diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-10-10 02:07:57 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-10-10 02:07:57 +0800 |
commit | b152949a3102c150af0c99fb84e8fecf2c69191f (patch) | |
tree | 373a7f9d282419ee869db15c8a61ae8b13af53ef /libempathy-gtk/empathy-contact-dialogs.c | |
parent | bfe4734f01b202ae448616e6c711a46c5d0d7f6e (diff) | |
download | gsoc2013-empathy-b152949a3102c150af0c99fb84e8fecf2c69191f.tar gsoc2013-empathy-b152949a3102c150af0c99fb84e8fecf2c69191f.tar.gz gsoc2013-empathy-b152949a3102c150af0c99fb84e8fecf2c69191f.tar.bz2 gsoc2013-empathy-b152949a3102c150af0c99fb84e8fecf2c69191f.tar.lz gsoc2013-empathy-b152949a3102c150af0c99fb84e8fecf2c69191f.tar.xz gsoc2013-empathy-b152949a3102c150af0c99fb84e8fecf2c69191f.tar.zst gsoc2013-empathy-b152949a3102c150af0c99fb84e8fecf2c69191f.zip |
More flexible API for EmpathyContactWidget, we now have flags to set
2007-10-09 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/empathy-main-window.c:
* libempathy-gtk/empathy-contact-dialogs.c:
* libempathy-gtk/empathy-contact-list-view.c:
* libempathy-gtk/empathy-contact-dialogs.h:
* libempathy-gtk/empathy-contact-widget.c:
* libempathy-gtk/empathy-contact-widget.h:
* libempathy-gtk/empathy-chat-window.c:
* megaphone/src/megaphone-applet.c: More flexible API for
EmpathyContactWidget, we now have flags to set editable each fields.
Implement personal information menu item in main window.
svn path=/trunk/; revision=365
Diffstat (limited to 'libempathy-gtk/empathy-contact-dialogs.c')
-rw-r--r-- | libempathy-gtk/empathy-contact-dialogs.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 553f85bcc..d032eab5a 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -110,7 +110,8 @@ empathy_subscription_dialog_show (EmpathyContact *contact, NULL); contact_widget = empathy_contact_widget_new (contact, - CONTACT_WIDGET_TYPE_SUBSCRIPTION); + EMPATHY_CONTACT_WIDGET_EDIT_ALIAS | + EMPATHY_CONTACT_WIDGET_EDIT_GROUPS); gtk_box_pack_end (GTK_BOX (hbox_subscription), contact_widget, TRUE, TRUE, @@ -146,13 +147,14 @@ contact_information_response_cb (GtkDialog *dialog, void empathy_contact_information_dialog_show (EmpathyContact *contact, GtkWindow *parent, - gboolean edit) + gboolean edit, + gboolean edit_groups) { GtkWidget *dialog; GtkWidget *button; GtkWidget *contact_widget; GList *l; - EmpathyContactWidgetType type; + EmpathyContactWidgetFlags flags = 0; g_return_if_fail (EMPATHY_IS_CONTACT (contact)); @@ -164,8 +166,6 @@ empathy_contact_information_dialog_show (EmpathyContact *contact, return; } - type = edit ? CONTACT_WIDGET_TYPE_EDIT : CONTACT_WIDGET_TYPE_SHOW; - /* Create dialog */ dialog = gtk_dialog_new (); gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); @@ -179,9 +179,19 @@ empathy_contact_information_dialog_show (EmpathyContact *contact, button, GTK_RESPONSE_CLOSE); gtk_widget_show (button); - + /* Contact info widget */ - contact_widget = empathy_contact_widget_new (contact, type); + if (edit) { + flags |= EMPATHY_CONTACT_WIDGET_EDIT_ALIAS; + if (empathy_contact_is_user (contact)) { + flags |= EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT | + EMPATHY_CONTACT_WIDGET_EDIT_AVATAR; + } + } + if (edit_groups) { + flags |= EMPATHY_CONTACT_WIDGET_EDIT_GROUPS; + } + contact_widget = empathy_contact_widget_new (contact, flags); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), contact_widget, TRUE, TRUE, 0); @@ -261,7 +271,11 @@ empathy_new_contact_dialog_show (GtkWindow *parent) gtk_widget_show (button); /* Contact info widget */ - contact_widget = empathy_contact_widget_new (NULL, CONTACT_WIDGET_TYPE_ADD); + contact_widget = empathy_contact_widget_new (NULL, + EMPATHY_CONTACT_WIDGET_EDIT_ALIAS | + EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT | + EMPATHY_CONTACT_WIDGET_EDIT_ID | + EMPATHY_CONTACT_WIDGET_EDIT_GROUPS); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), contact_widget, TRUE, TRUE, 0); |