aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-main-window.c
diff options
context:
space:
mode:
authorFelix Kaser <f.kaser@gmx.net>2010-08-05 18:55:31 +0800
committerFelix Kaser <f.kaser@gmx.net>2010-08-05 20:42:11 +0800
commit7cd053aff86931fdf85c8016701956d1fb43e646 (patch)
tree66363e38b42a66e3df86d480925059094c8ae1cb /src/empathy-main-window.c
parentb3ee9d59131212736dc713e7f1687cf8536bb979 (diff)
downloadgsoc2013-empathy-7cd053aff86931fdf85c8016701956d1fb43e646.tar
gsoc2013-empathy-7cd053aff86931fdf85c8016701956d1fb43e646.tar.gz
gsoc2013-empathy-7cd053aff86931fdf85c8016701956d1fb43e646.tar.bz2
gsoc2013-empathy-7cd053aff86931fdf85c8016701956d1fb43e646.tar.lz
gsoc2013-empathy-7cd053aff86931fdf85c8016701956d1fb43e646.tar.xz
gsoc2013-empathy-7cd053aff86931fdf85c8016701956d1fb43e646.tar.zst
gsoc2013-empathy-7cd053aff86931fdf85c8016701956d1fb43e646.zip
use different labels if view is empty
either show "no match found" or "your contact list is empty". fixes bug #621642
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r--src/empathy-main-window.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 3fdccff47..4aa5e4c9c 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -91,6 +91,10 @@
/* Name in the geometry file */
#define GEOMETRY_NAME "main-window"
+/* Labels for empty contact list */
+#define CONTACT_LIST_EMPTY _("Your contact list is empty")
+#define NO_MATCH_FOUND _("No match found")
+
G_DEFINE_TYPE (EmpathyMainWindow, empathy_main_window, GTK_TYPE_WINDOW);
#define GET_PRIV(self) ((EmpathyMainWindowPriv *)((EmpathyMainWindow *) self)->priv)
@@ -370,12 +374,15 @@ main_window_row_deleted_cb (GtkTreeModel *model,
if (!gtk_tree_model_get_iter_first (model, &help_iter)) {
priv->empty = TRUE;
- /* TODO: check if we are searching or not */
- gtk_label_set_text (GTK_LABEL (priv->no_entry_label),
- _("Your contact list is empty"));
+ if (empathy_individual_view_is_searching (priv->individual_view))
+ gtk_label_set_text (GTK_LABEL (priv->no_entry_label),
+ NO_MATCH_FOUND);
+ else
+ gtk_label_set_text (GTK_LABEL (priv->no_entry_label),
+ CONTACT_LIST_EMPTY);
+
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook),
- 1);
- g_debug ("contact list empty");
+ 0);
}
}
@@ -390,8 +397,8 @@ main_window_row_inserted_cb (GtkTreeModel *model,
if (priv->empty) {
priv->empty = FALSE;
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook),
- 0);
- g_debug ("contact list is not empty any more");
+ 1);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->individual_view));
}
}
@@ -1530,8 +1537,6 @@ empathy_main_window_init (EmpathyMainWindow *window)
priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
priv->gsettings_contacts = g_settings_new (EMPATHY_PREFS_CONTACTS_SCHEMA);
- priv->empty = TRUE;
-
gtk_window_set_title (GTK_WINDOW (window), _("Contact List"));
gtk_window_set_role (GTK_WINDOW (window), "contact_list");
gtk_window_set_default_size (GTK_WINDOW (window), 225, 325);
@@ -1689,6 +1694,11 @@ empathy_main_window_init (EmpathyMainWindow *window)
g_signal_connect_swapped (window, "map",
G_CALLBACK (gtk_widget_grab_focus), priv->individual_view);
+ /* Set up the Notebook for the TreeView */
+ priv->empty = TRUE;
+ gtk_label_set_text (GTK_LABEL (priv->no_entry_label),
+ CONTACT_LIST_EMPTY);
+
/* Connect to proper signals to check if contact list is empty or not */
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->individual_view));
g_signal_connect (model, "row-inserted",