diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-03-16 00:40:01 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-06-09 18:37:54 +0800 |
commit | 322ce4bfc48edf2331379809ab53b17254bcd8f2 (patch) | |
tree | 2e61614665f6ecf51a10bd2968e144b57271b2b5 /libempathy-gtk | |
parent | 18f8901e810a6843f549b06680d9411d12901e5d (diff) | |
download | gsoc2013-empathy-322ce4bfc48edf2331379809ab53b17254bcd8f2.tar gsoc2013-empathy-322ce4bfc48edf2331379809ab53b17254bcd8f2.tar.gz gsoc2013-empathy-322ce4bfc48edf2331379809ab53b17254bcd8f2.tar.bz2 gsoc2013-empathy-322ce4bfc48edf2331379809ab53b17254bcd8f2.tar.lz gsoc2013-empathy-322ce4bfc48edf2331379809ab53b17254bcd8f2.tar.xz gsoc2013-empathy-322ce4bfc48edf2331379809ab53b17254bcd8f2.tar.zst gsoc2013-empathy-322ce4bfc48edf2331379809ab53b17254bcd8f2.zip |
Add a empathy_account_chooser_has_all_selected
So we can know if 'All' is selected in the accounts chooser.
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 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); |