diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-03 18:22:01 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-03 21:59:33 +0800 |
commit | 70e4e12f20077ce2e686db955ad5730c607e1427 (patch) | |
tree | 109e686d6741d1763673d41a346ab600bfbb9787 /libempathy-gtk | |
parent | 392db8ab3e1ceeebd6c7dfba125786c67be527d0 (diff) | |
download | gsoc2013-empathy-70e4e12f20077ce2e686db955ad5730c607e1427.tar gsoc2013-empathy-70e4e12f20077ce2e686db955ad5730c607e1427.tar.gz gsoc2013-empathy-70e4e12f20077ce2e686db955ad5730c607e1427.tar.bz2 gsoc2013-empathy-70e4e12f20077ce2e686db955ad5730c607e1427.tar.lz gsoc2013-empathy-70e4e12f20077ce2e686db955ad5730c607e1427.tar.xz gsoc2013-empathy-70e4e12f20077ce2e686db955ad5730c607e1427.tar.zst gsoc2013-empathy-70e4e12f20077ce2e686db955ad5730c607e1427.zip |
Add empathy_account_chooser_set_all
Diffstat (limited to 'libempathy-gtk')
-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 afb9841e1..b6c4d51a1 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -416,6 +416,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 c9e69b4f6..f3658ad7d 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, |