aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-individual-edit-dialog.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-01 17:42:00 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-06 18:08:12 +0800
commitd7c3afd92a4851669316aeb352235643002004e7 (patch)
tree1da6530f5b16cd072d167c06c11ab44c5ba40650 /libempathy-gtk/empathy-individual-edit-dialog.c
parentee0ed7f28d8a567675d434e6d9b8d13789b72292 (diff)
downloadgsoc2013-empathy-d7c3afd92a4851669316aeb352235643002004e7.tar
gsoc2013-empathy-d7c3afd92a4851669316aeb352235643002004e7.tar.gz
gsoc2013-empathy-d7c3afd92a4851669316aeb352235643002004e7.tar.bz2
gsoc2013-empathy-d7c3afd92a4851669316aeb352235643002004e7.tar.lz
gsoc2013-empathy-d7c3afd92a4851669316aeb352235643002004e7.tar.xz
gsoc2013-empathy-d7c3afd92a4851669316aeb352235643002004e7.tar.zst
gsoc2013-empathy-d7c3afd92a4851669316aeb352235643002004e7.zip
Move the “Unlink” button from the Edit dialogue to the linking dialogue
This is a more logical place for it, making unlinking more discoverable. Helps: bgo#628376
Diffstat (limited to 'libempathy-gtk/empathy-individual-edit-dialog.c')
-rw-r--r--libempathy-gtk/empathy-individual-edit-dialog.c53
1 files changed, 1 insertions, 52 deletions
diff --git a/libempathy-gtk/empathy-individual-edit-dialog.c b/libempathy-gtk/empathy-individual-edit-dialog.c
index 677a53401..3f5f35d45 100644
--- a/libempathy-gtk/empathy-individual-edit-dialog.c
+++ b/libempathy-gtk/empathy-individual-edit-dialog.c
@@ -30,7 +30,6 @@
#include <telepathy-glib/util.h>
#include <folks/folks.h>
-#include <folks/folks-telepathy.h>
#include <libempathy/empathy-individual-manager.h>
#include <libempathy/empathy-utils.h>
@@ -61,25 +60,11 @@ static void individual_edit_dialog_set_individual (
G_DEFINE_TYPE (EmpathyIndividualEditDialog, empathy_individual_edit_dialog,
GTK_TYPE_DIALOG);
-/* Fairly arbitrary response ID for the "Unlink" button */
-#define RESPONSE_UNLINK 5
-
static void
individual_dialogs_response_cb (GtkDialog *dialog,
gint response,
GList **dialogs)
{
- if (response == RESPONSE_UNLINK)
- {
- EmpathyIndividualEditDialogPriv *priv = GET_PRIV (dialog);
- EmpathyIndividualManager *manager =
- empathy_individual_manager_dup_singleton ();
-
- empathy_individual_manager_unlink_individual (manager, priv->individual);
-
- g_object_unref (manager);
- }
-
*dialogs = g_list_remove (*dialogs, dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
}
@@ -122,30 +107,6 @@ empathy_individual_edit_dialog_show (FolksIndividual *individual,
}
static void
-set_unlink_button_sensitivity (EmpathyIndividualEditDialog *self)
-{
- EmpathyIndividualEditDialogPriv *priv = GET_PRIV (self);
- GList *personas, *l;
- guint num_personas = 0;
-
- /* Count how many Telepathy personas we have, to see whether we can
- * unlink */
- if (priv->individual != NULL)
- {
- personas = folks_individual_get_personas (priv->individual);
- for (l = personas; l != NULL; l = l->next)
- {
- if (TPF_IS_PERSONA (l->data))
- num_personas++;
- }
- }
-
- /* Only make the "Unlink" button sensitive if we have enough personas */
- gtk_dialog_set_response_sensitive (GTK_DIALOG (self), RESPONSE_UNLINK,
- (num_personas > 1) ? TRUE : FALSE);
-}
-
-static void
individual_removed_cb (FolksIndividual *individual,
FolksIndividual *replacement_individual,
EmpathyIndividualEditDialog *self)
@@ -195,7 +156,6 @@ individual_edit_dialog_set_individual (
/* Update the UI */
empathy_individual_widget_set_individual (
EMPATHY_INDIVIDUAL_WIDGET (priv->individual_widget), individual);
- set_unlink_button_sensitivity (dialog);
}
}
@@ -275,7 +235,7 @@ static void
empathy_individual_edit_dialog_init (
EmpathyIndividualEditDialog *dialog)
{
- GtkWidget *button, *action_area;
+ GtkWidget *button;
EmpathyIndividualEditDialogPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (
dialog, EMPATHY_TYPE_INDIVIDUAL_EDIT_DIALOG,
EmpathyIndividualEditDialogPriv);
@@ -297,17 +257,6 @@ empathy_individual_edit_dialog_init (
GTK_DIALOG (dialog))), priv->individual_widget, TRUE, TRUE, 0);
gtk_widget_show (priv->individual_widget);
- /* Unlink button */
- button = gtk_button_new_with_mnemonic (
- C_("Unlink individual (button)", "_Unlink"));
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, RESPONSE_UNLINK);
-
- action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
- gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (action_area), button,
- TRUE);
-
- gtk_widget_show (button);
-
/* Close button */
button = gtk_button_new_with_label (GTK_STOCK_CLOSE);
gtk_button_set_use_stock (GTK_BUTTON (button), TRUE);