[empathy] Factor out show_gnome_contacts_error_dialog()
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Factor out show_gnome_contacts_error_dialog()
- Date: Wed, 8 Feb 2012 13:30:58 +0000 (UTC)
commit 8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue Feb 7 15:45:36 2012 +0100
Factor out show_gnome_contacts_error_dialog()
https://bugzilla.gnome.org/show_bug.cgi?id=669578
libempathy-gtk/empathy-individual-menu.c | 33 +++++++++++++++++------------
1 files changed, 19 insertions(+), 14 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index b891854..b877b55 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -1292,6 +1292,24 @@ empathy_individual_favourite_menu_item_new (FolksIndividual *individual)
}
static void
+show_gnome_contacts_error_dialog (void)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ _("gnome-contacts not installed"));
+
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("Please install gnome-contacts to access contacts details."));
+
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), dialog);
+
+ gtk_widget_show (dialog);
+}
+
+static void
individual_info_menu_item_activate_cb (FolksIndividual *individual)
{
GDesktopAppInfo *desktop_info;
@@ -1308,22 +1326,9 @@ individual_info_menu_item_activate_cb (FolksIndividual *individual)
desktop_info = g_desktop_app_info_new ("gnome-contacts.desktop");
if (desktop_info == NULL)
{
- GtkWidget *dialog;
-
DEBUG ("gnome-contacts not installed");
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("gnome-contacts not installed"));
-
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- _("Please install gnome-contacts to access contacts details."));
-
- g_signal_connect_swapped (dialog, "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
-
- gtk_widget_show (dialog);
+ show_gnome_contacts_error_dialog ();
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]