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-06-09 19:34:56 +0800 |
commit | 0f14ab8594d2867778bb96059ecad339cd16162d (patch) | |
tree | c92df71402268bec0eb8b37bb6ab85c075d3cc74 /libempathy-gtk | |
parent | f5288b26f8c6fc114ae50b99513ec37b7a1aa7fe (diff) | |
download | gsoc2013-empathy-0f14ab8594d2867778bb96059ecad339cd16162d.tar gsoc2013-empathy-0f14ab8594d2867778bb96059ecad339cd16162d.tar.gz gsoc2013-empathy-0f14ab8594d2867778bb96059ecad339cd16162d.tar.bz2 gsoc2013-empathy-0f14ab8594d2867778bb96059ecad339cd16162d.tar.lz gsoc2013-empathy-0f14ab8594d2867778bb96059ecad339cd16162d.tar.xz gsoc2013-empathy-0f14ab8594d2867778bb96059ecad339cd16162d.tar.zst gsoc2013-empathy-0f14ab8594d2867778bb96059ecad339cd16162d.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 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, |