aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-account-chooser.c24
-rw-r--r--libempathy-gtk/empathy-account-chooser.h1
2 files changed, 25 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c
index bfacbd1d9..32b314be1 100644
--- a/libempathy-gtk/empathy-account-chooser.c
+++ b/libempathy-gtk/empathy-account-chooser.c
@@ -438,6 +438,30 @@ empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
return data.set;
}
+void
+empathy_account_chooser_set_all (EmpathyAccountChooser *chooser)
+{
+ EmpathyAccountChooserPriv *priv;
+ GtkComboBox *combobox;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ g_return_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser));
+
+ priv = GET_PRIV (chooser);
+
+ g_return_if_fail (priv->has_all_option);
+
+ combobox = GTK_COMBO_BOX (chooser);
+ model = gtk_combo_box_get_model (combobox);
+
+ if (gtk_tree_model_get_iter_first (model, &iter)) {
+ /* 'All accounts' is the first row */
+ gtk_combo_box_set_active_iter (combobox, &iter);
+ priv->account_manually_set = TRUE;
+ }
+}
+
/**
* empathy_account_chooser_get_has_all_option:
* @chooser: an #EmpathyAccountChooser
diff --git a/libempathy-gtk/empathy-account-chooser.h b/libempathy-gtk/empathy-account-chooser.h
index 64c9b57b8..7ed920e9f 100644
--- a/libempathy-gtk/empathy-account-chooser.h
+++ b/libempathy-gtk/empathy-account-chooser.h
@@ -81,6 +81,7 @@ TpAccount * empathy_account_chooser_get_account (EmpathyAccountChooser
TpConnection * empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser);
gboolean empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
TpAccount *account);
+void empathy_account_chooser_set_all (EmpathyAccountChooser *chooser);
TpAccountManager * empathy_account_chooser_get_account_manager (EmpathyAccountChooser *self);
gboolean empathy_account_chooser_get_has_all_option (EmpathyAccountChooser *chooser);
void empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *chooser,