From 83e0eceb85a5362835421555408e90013664b00a Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 21 Oct 2007 13:22:40 +0000 Subject: Don't allow to change account if we are editing information of 2007-10-21 Xavier Claessens * libempathy-gtk/empathy-contact-dialogs.h: * libempathy-gtk/empathy-contact-dialogs.c: * libempathy-gtk/empathy-main-window.c: * libempathy-gtk/empathy-contact-list-view.c: Don't allow to change account if we are editing information of self-contact. svn path=/trunk/; revision=385 --- ChangeLog | 7 +++++++ libempathy-gtk/empathy-contact-dialogs.c | 12 ++++++------ libempathy-gtk/empathy-contact-dialogs.h | 2 +- libempathy-gtk/empathy-contact-list-view.c | 2 +- libempathy-gtk/empathy-main-window.c | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09a897d97..3a11f14a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-21 Xavier Claessens + + * libempathy-gtk/empathy-contact-dialogs.h: + * libempathy-gtk/empathy-contact-dialogs.c: + * libempathy-gtk/empathy-main-window.c: + * libempathy-gtk/empathy-contact-list-view.c: + 2007-10-21 Xavier Claessens * libempathy-gtk/empathy-account-chooser.c: diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 96895cc2f..6026374ea 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -151,7 +151,7 @@ void empathy_contact_information_dialog_show (EmpathyContact *contact, GtkWindow *parent, gboolean edit, - gboolean edit_groups) + gboolean is_user) { GtkWidget *dialog; GtkWidget *button; @@ -186,12 +186,12 @@ empathy_contact_information_dialog_show (EmpathyContact *contact, /* Contact info widget */ 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) { + if (is_user) { + flags |= EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT; + flags |= EMPATHY_CONTACT_WIDGET_EDIT_AVATAR; + } + if (!is_user && edit) { flags |= EMPATHY_CONTACT_WIDGET_EDIT_GROUPS; } contact_widget = empathy_contact_widget_new (contact, flags); diff --git a/libempathy-gtk/empathy-contact-dialogs.h b/libempathy-gtk/empathy-contact-dialogs.h index 65ded4e7e..7cd7f4bc5 100644 --- a/libempathy-gtk/empathy-contact-dialogs.h +++ b/libempathy-gtk/empathy-contact-dialogs.h @@ -34,7 +34,7 @@ void empathy_subscription_dialog_show (EmpathyContact *contact, void empathy_contact_information_dialog_show (EmpathyContact *contact, GtkWindow *parent, gboolean edit, - gboolean edit_groups); + gboolean is_user); void empathy_new_contact_dialog_show (GtkWindow *parent); G_END_DECLS diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index a30298e3a..0389a19b8 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -1404,7 +1404,7 @@ contact_list_view_action_cb (GtkAction *action, empathy_contact_information_dialog_show (contact, parent, FALSE, FALSE); } else if (contact && strcmp (name, "Edit") == 0) { - empathy_contact_information_dialog_show (contact, parent, TRUE, TRUE); + empathy_contact_information_dialog_show (contact, parent, TRUE, FALSE); } else if (contact && strcmp (name, "Remove") == 0) { /* FIXME: Ask for confirmation */ diff --git a/libempathy-gtk/empathy-main-window.c b/libempathy-gtk/empathy-main-window.c index 26e54226f..8655c0c99 100644 --- a/libempathy-gtk/empathy-main-window.c +++ b/libempathy-gtk/empathy-main-window.c @@ -668,7 +668,7 @@ main_window_edit_personal_information_cb (GtkWidget *widget, contact = empathy_contact_factory_get_user (factory, account); empathy_contact_information_dialog_show (contact, GTK_WINDOW (window->window), - TRUE, FALSE); + TRUE, TRUE); g_slist_foreach (accounts, (GFunc) g_object_unref, NULL); g_slist_free (accounts); g_object_unref (factory); -- cgit v1.2.3