diff options
-rw-r--r-- | libempathy-gtk/empathy-account-chooser.c | 24 | ||||
-rw-r--r-- | libempathy-gtk/empathy-account-chooser.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c index 2df4a153a..e814eda89 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -312,6 +312,30 @@ empathy_account_chooser_new (void) return chooser; } +gboolean +empathy_account_chooser_has_all_selected (EmpathyAccountChooser *chooser) +{ + EmpathyAccountChooserPriv *priv; + GtkTreeModel *model; + GtkTreeIter iter; + RowType type; + + g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), FALSE); + + priv = GET_PRIV (chooser); + + g_return_val_if_fail (priv->has_all_option == TRUE, FALSE); + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); + if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (chooser), &iter)) { + return FALSE; + } + + gtk_tree_model_get (model, &iter, COL_ACCOUNT_ROW_TYPE, &type, -1); + + return type == ROW_ALL; +} + /** * empathy_account_chooser_dup_account: * @chooser: an #EmpathyAccountChooser diff --git a/libempathy-gtk/empathy-account-chooser.h b/libempathy-gtk/empathy-account-chooser.h index 62854b959..6ff28d0d3 100644 --- a/libempathy-gtk/empathy-account-chooser.h +++ b/libempathy-gtk/empathy-account-chooser.h @@ -84,6 +84,7 @@ gboolean empathy_account_chooser_set_account (EmpathyAccountChooser gboolean empathy_account_chooser_get_has_all_option (EmpathyAccountChooser *chooser); void empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *chooser, gboolean has_all_option); +gboolean empathy_account_chooser_has_all_selected (EmpathyAccountChooser *chooser); void empathy_account_chooser_set_filter (EmpathyAccountChooser *chooser, EmpathyAccountChooserFilterFunc filter, gpointer user_data); |