aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-chooser.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/empathy-account-chooser.c')
-rw-r--r--libempathy-gtk/empathy-account-chooser.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c
index f077827fb..8fdb18e1e 100644
--- a/libempathy-gtk/empathy-account-chooser.c
+++ b/libempathy-gtk/empathy-account-chooser.c
@@ -284,6 +284,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