diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-23 17:08:23 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-03 19:57:51 +0800 |
commit | c1adae17180cc2b1a0215fadbbfe22c701379e94 (patch) | |
tree | 0b01ff982f99aabab5261ec1221b21c48965a50f /src | |
parent | fc087adb06df532cc0effaafe5f2d5a6fcb490b6 (diff) | |
download | gsoc2013-empathy-c1adae17180cc2b1a0215fadbbfe22c701379e94.tar gsoc2013-empathy-c1adae17180cc2b1a0215fadbbfe22c701379e94.tar.gz gsoc2013-empathy-c1adae17180cc2b1a0215fadbbfe22c701379e94.tar.bz2 gsoc2013-empathy-c1adae17180cc2b1a0215fadbbfe22c701379e94.tar.lz gsoc2013-empathy-c1adae17180cc2b1a0215fadbbfe22c701379e94.tar.xz gsoc2013-empathy-c1adae17180cc2b1a0215fadbbfe22c701379e94.tar.zst gsoc2013-empathy-c1adae17180cc2b1a0215fadbbfe22c701379e94.zip |
make code displaying the 'no match found' page more generic
https://bugzilla.gnome.org/show_bug.cgi?id=656097
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-roster-window.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c index 0e9768bf0..8f5bcf2fc 100644 --- a/src/empathy-roster-window.c +++ b/src/empathy-roster-window.c @@ -92,7 +92,7 @@ enum { PAGE_CONTACT_LIST = 0, - PAGE_NO_MATCH + PAGE_MESSAGE }; enum @@ -608,6 +608,23 @@ OUT: } static void +display_page_message (EmpathyRosterWindow *self, + const gchar *msg) +{ + gchar *tmp; + + tmp = g_strdup_printf ("<b><span size='xx-large'>%s</span></b>", msg); + + gtk_label_set_markup (GTK_LABEL (self->priv->no_entry_label), tmp); + g_free (tmp); + + gtk_label_set_line_wrap (GTK_LABEL (self->priv->no_entry_label), TRUE); + + gtk_notebook_set_current_page (GTK_NOTEBOOK (self->priv->notebook), + PAGE_MESSAGE); +} + +static void roster_window_row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, EmpathyRosterWindow *self) @@ -620,24 +637,19 @@ roster_window_row_deleted_cb (GtkTreeModel *model, if (empathy_individual_view_is_searching (self->priv->individual_view)) { - gchar *tmp; - - tmp = g_strdup_printf ("<b><span size='xx-large'>%s</span></b>", - _("No match found")); - - gtk_label_set_markup (GTK_LABEL (self->priv->no_entry_label), tmp); - g_free (tmp); - - gtk_label_set_line_wrap (GTK_LABEL (self->priv->no_entry_label), - TRUE); - - gtk_notebook_set_current_page (GTK_NOTEBOOK (self->priv->notebook), - PAGE_NO_MATCH); + display_page_message (self, _("No match found")); } } } static void +display_page_contact_list (EmpathyRosterWindow *self) +{ + gtk_notebook_set_current_page (GTK_NOTEBOOK (self->priv->notebook), + PAGE_CONTACT_LIST); +} + +static void roster_window_row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, @@ -646,8 +658,8 @@ roster_window_row_inserted_cb (GtkTreeModel *model, if (self->priv->empty) { self->priv->empty = FALSE; - gtk_notebook_set_current_page (GTK_NOTEBOOK (self->priv->notebook), - PAGE_CONTACT_LIST); + + display_page_contact_list (self); gtk_widget_grab_focus (GTK_WIDGET (self->priv->individual_view)); /* The store is being filled, it will be done after an idle cb. |