diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-02 22:50:51 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-03 19:57:51 +0800 |
commit | df8e44cd8c2f09928d31d21540b1de47a1f757f0 (patch) | |
tree | f67d2fd78aff4d30d891c3cd1d8e06032d8e4d0d | |
parent | 808aab1091606abf34fbb67b62026bd442c4c872 (diff) | |
download | gsoc2013-empathy-df8e44cd8c2f09928d31d21540b1de47a1f757f0.tar gsoc2013-empathy-df8e44cd8c2f09928d31d21540b1de47a1f757f0.tar.gz gsoc2013-empathy-df8e44cd8c2f09928d31d21540b1de47a1f757f0.tar.bz2 gsoc2013-empathy-df8e44cd8c2f09928d31d21540b1de47a1f757f0.tar.lz gsoc2013-empathy-df8e44cd8c2f09928d31d21540b1de47a1f757f0.tar.xz gsoc2013-empathy-df8e44cd8c2f09928d31d21540b1de47a1f757f0.tar.zst gsoc2013-empathy-df8e44cd8c2f09928d31d21540b1de47a1f757f0.zip |
display a specific message if no account is configured
https://bugzilla.gnome.org/show_bug.cgi?id=656097
-rw-r--r-- | src/empathy-roster-window.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c index a1e120919..709df601d 100644 --- a/src/empathy-roster-window.c +++ b/src/empathy-roster-window.c @@ -638,6 +638,13 @@ display_page_message (EmpathyRosterWindow *self, } static void +display_page_no_account (EmpathyRosterWindow *self) +{ + display_page_message (self, + _("You need to setup an account to see contacts here."), TRUE); +} + +static void roster_window_row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, EmpathyRosterWindow *self) @@ -2114,6 +2121,22 @@ add_account (EmpathyRosterWindow *self, } static void +set_notebook_page (EmpathyRosterWindow *self) +{ + GList *accounts; + + accounts = tp_account_manager_get_valid_accounts ( + self->priv->account_manager); + + if (g_list_length (accounts) == 0) + display_page_no_account (self); + else + display_page_contact_list (self); + + g_list_free (accounts); +} + +static void roster_window_account_validity_changed_cb (TpAccountManager *manager, TpAccount *account, gboolean valid, @@ -2123,6 +2146,8 @@ roster_window_account_validity_changed_cb (TpAccountManager *manager, add_account (self, account); else roster_window_account_removed_cb (manager, account, self); + + set_notebook_page (self); } static void @@ -2195,6 +2220,8 @@ account_manager_prepared_cb (GObject *source_object, gtk_action_set_sensitive (self->priv->view_history, g_list_length (accounts) > 0); + set_notebook_page (self); + g_list_free (accounts); } |