aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-01 18:05:20 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-06 18:08:12 +0800
commita32e3cde4a0f551169367baeadfc76587eae2b29 (patch)
treeca4e6b590759cc8c9b4e4568c217774b718b40f9 /libempathy-gtk
parentd7c3afd92a4851669316aeb352235643002004e7 (diff)
downloadgsoc2013-empathy-a32e3cde4a0f551169367baeadfc76587eae2b29.tar
gsoc2013-empathy-a32e3cde4a0f551169367baeadfc76587eae2b29.tar.gz
gsoc2013-empathy-a32e3cde4a0f551169367baeadfc76587eae2b29.tar.bz2
gsoc2013-empathy-a32e3cde4a0f551169367baeadfc76587eae2b29.tar.lz
gsoc2013-empathy-a32e3cde4a0f551169367baeadfc76587eae2b29.tar.xz
gsoc2013-empathy-a32e3cde4a0f551169367baeadfc76587eae2b29.tar.zst
gsoc2013-empathy-a32e3cde4a0f551169367baeadfc76587eae2b29.zip
Add a confirmation dialogue to the unlink process
This makes it harder to accidentally remove a linked Individual now that the “Unlink” button is easier to find, and also makes it more obvious that Empathy hasn't just crashed when unlinking. Helps: bgo#628377
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-linking-dialog.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-linking-dialog.c b/libempathy-gtk/empathy-linking-dialog.c
index 1ab58abb1..d1df295b3 100644
--- a/libempathy-gtk/empathy-linking-dialog.c
+++ b/libempathy-gtk/empathy-linking-dialog.c
@@ -117,7 +117,7 @@ empathy_linking_dialog_init (EmpathyLinkingDialog *self)
/* Unlink button */
button = gtk_button_new_with_mnemonic (
- C_("Unlink individual (button)", "_Unlink"));
+ C_("Unlink individual (button)", "_Unlink…"));
gtk_dialog_add_action_widget (dialog, button, RESPONSE_UNLINK);
gtk_widget_show (button);
@@ -170,13 +170,34 @@ linking_response_cb (EmpathyLinkingDialog *self,
{
EmpathyIndividualManager *manager;
FolksIndividual *individual;
+ GtkWidget *dialog;
- manager = empathy_individual_manager_dup_singleton ();
individual =
empathy_individual_linker_get_start_individual (priv->linker);
- empathy_individual_manager_unlink_individual (manager, individual);
+ /* Show a confirmation dialogue first */
+ dialog = gtk_message_dialog_new (GTK_WINDOW (self), GTK_DIALOG_MODAL,
+ GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, _("Unlink meta-contact '%s'?"),
+ folks_individual_get_alias (individual));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("Are you sure you want to unlink this meta-contact? This will "
+ "completely split the meta-contact into the contacts it "
+ "contains."));
+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ C_("Unlink individual (button)", "_Unlink"), GTK_RESPONSE_OK,
+ NULL);
+
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK)
+ {
+ gtk_widget_destroy (dialog);
+ return;
+ }
+
+ gtk_widget_destroy (dialog);
+ manager = empathy_individual_manager_dup_singleton ();
+ empathy_individual_manager_unlink_individual (manager, individual);
g_object_unref (manager);
}