diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-07 22:45:36 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-08 21:30:43 +0800 |
commit | 8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791 (patch) | |
tree | 08e4d88fe84c7e5dc889c672b0499d1e6045cc2f | |
parent | eb3bf07c3c1544f03c7c37cbe3fe8ef24ae5143b (diff) | |
download | gsoc2013-empathy-8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791.tar gsoc2013-empathy-8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791.tar.gz gsoc2013-empathy-8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791.tar.bz2 gsoc2013-empathy-8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791.tar.lz gsoc2013-empathy-8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791.tar.xz gsoc2013-empathy-8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791.tar.zst gsoc2013-empathy-8f3dc843ed74c9b7dac57d3a6ce62b9f148eb791.zip |
Factor out show_gnome_contacts_error_dialog()
https://bugzilla.gnome.org/show_bug.cgi?id=669578
-rw-r--r-- | 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 b891854da..b877b5548 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; } |