aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-12-13 02:15:51 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-12-13 20:16:54 +0800
commita2f8a7b9198d90f6a2e8e38c403e29c25b0b560c (patch)
tree2f108ddf81fabe058306a028fb40ae92cfbe1e81 /libempathy-gtk
parent7e4103ab9ceebf9369e9684fbe6564f1f5238adb (diff)
downloadgsoc2013-empathy-a2f8a7b9198d90f6a2e8e38c403e29c25b0b560c.tar
gsoc2013-empathy-a2f8a7b9198d90f6a2e8e38c403e29c25b0b560c.tar.gz
gsoc2013-empathy-a2f8a7b9198d90f6a2e8e38c403e29c25b0b560c.tar.bz2
gsoc2013-empathy-a2f8a7b9198d90f6a2e8e38c403e29c25b0b560c.tar.lz
gsoc2013-empathy-a2f8a7b9198d90f6a2e8e38c403e29c25b0b560c.tar.xz
gsoc2013-empathy-a2f8a7b9198d90f6a2e8e38c403e29c25b0b560c.tar.zst
gsoc2013-empathy-a2f8a7b9198d90f6a2e8e38c403e29c25b0b560c.zip
Bug 636700 — Add an extra warning when deleting a metacontact
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-individual-view.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 39dc3b34b..ee2a3af85 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -2345,12 +2345,45 @@ individual_view_remove_activate_cb (GtkMenuItem *menuitem,
{
gchar *text;
GtkWindow *parent;
+ GList *l, *personas;
+ guint persona_count = 0;
+
+ personas = folks_individual_get_personas (individual);
+
+ /* If we have more than one TpfPersona, display a different message
+ * ensuring the user knows that *all* of the meta-contacts' personas will
+ * be removed. */
+ for (l = personas; l != NULL; l = l->next)
+ {
+ if (!TPF_IS_PERSONA (l->data))
+ continue;
+
+ persona_count++;
+ if (persona_count >= 2)
+ break;
+ }
+
+ if (persona_count < 2)
+ {
+ /* Not a meta-contact */
+ text =
+ g_strdup_printf (
+ _("Do you really want to remove the contact '%s'?"),
+ folks_aliasable_get_alias (FOLKS_ALIASABLE (individual)));
+ }
+ else
+ {
+ /* Meta-contact */
+ text =
+ g_strdup_printf (
+ _("Do you really want to remove the linked contact '%s'? "
+ "Note that this will remove all the contacts which make up "
+ "this linked contact."),
+ folks_aliasable_get_alias (FOLKS_ALIASABLE (individual)));
+ }
parent = empathy_get_toplevel_window (GTK_WIDGET (view));
- text =
- g_strdup_printf (_
- ("Do you really want to remove the contact '%s'?"),
- folks_aliasable_get_alias (FOLKS_ALIASABLE (individual)));
+
if (individual_view_remove_dialog_show (parent, _("Removing contact"),
text))
{