diff options
author | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2013-07-08 18:06:48 +0800 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2013-07-08 18:43:39 +0800 |
commit | bda80eccdf3e79c195bfa7982a9955c401e31c48 (patch) | |
tree | 62697df286449b9928dcfc3557935528bcb8e2be | |
parent | 6c1e9287426b155c8047d518e1e6d8955f9d6fc4 (diff) | |
download | gsoc2013-empathy-bda80eccdf3e79c195bfa7982a9955c401e31c48.tar.gz gsoc2013-empathy-bda80eccdf3e79c195bfa7982a9955c401e31c48.tar.zst gsoc2013-empathy-bda80eccdf3e79c195bfa7982a9955c401e31c48.zip |
EmpathyContactSearchDialog: factor out append_message_page()
https://bugzilla.gnome.org/show_bug.cgi?id=703775
-rw-r--r-- | libempathy-gtk/empathy-contact-search-dialog.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/libempathy-gtk/empathy-contact-search-dialog.c b/libempathy-gtk/empathy-contact-search-dialog.c index 2696f5abb..90c61dfb1 100644 --- a/libempathy-gtk/empathy-contact-search-dialog.c +++ b/libempathy-gtk/empathy-contact-search-dialog.c @@ -69,7 +69,6 @@ struct _EmpathyContactSearchDialogPrivate GtkWidget *spinner; GtkWidget *add_button; GtkWidget *find_button; - GtkWidget *no_contact_found; GtkWidget *search_entry; /* GtkWidget *server_entry; */ GtkWidget *message; @@ -507,6 +506,24 @@ on_profile_button_clicked_cb (EmpathyCellRendererActivatable *cell, } static void +append_message_page (EmpathyContactSearchDialog *self, + const gchar *message) +{ + EmpathyContactSearchDialogPrivate *priv = GET_PRIVATE (self); + GtkWidget *label; + gchar *tmp; + + label = gtk_label_new (NULL); + tmp = g_strdup_printf ("<b><span size='xx-large'>%s</span></b>", message); + gtk_label_set_markup (GTK_LABEL (label), tmp); + g_free (tmp); + + gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); + + gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), label, NULL); +} + +static void empathy_contact_search_dialog_init (EmpathyContactSearchDialog *self) { EmpathyContactSearchDialogPrivate *priv = GET_PRIVATE (self); @@ -515,7 +532,6 @@ empathy_contact_search_dialog_init (EmpathyContactSearchDialog *self) GtkTreeViewColumn *col; GtkTreeSelection *selection; GtkSizeGroup *size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); - gchar *tmp; /* Title */ gtk_window_set_title (GTK_WINDOW (self), _("Search contacts")); @@ -622,19 +638,10 @@ empathy_contact_search_dialog_init (EmpathyContactSearchDialog *self) gtk_container_add (GTK_CONTAINER (scrolled_window), priv->tree_view); - priv->no_contact_found = gtk_label_new (NULL); - tmp = g_strdup_printf ("<b><span size='xx-large'>%s</span></b>", - _("No contacts found")); - gtk_label_set_markup (GTK_LABEL (priv->no_contact_found), tmp); - g_free (tmp); - - gtk_label_set_ellipsize (GTK_LABEL (priv->no_contact_found), - PANGO_ELLIPSIZE_END); - gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), scrolled_window, NULL); - gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), - priv->no_contact_found, NULL); + + append_message_page (self, _("No contacts found")); gtk_box_pack_start (GTK_BOX (vbox), priv->notebook, TRUE, TRUE, 3); |