aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorDavyd Madeley <davyd@madeley.id.au>2009-04-21 09:37:16 +0800
committerDavyd Madeley <davyd@madeley.id.au>2009-04-21 09:37:16 +0800
commit161c7f5800a89344fb65163b1e9c49ea7585cadf (patch)
tree79ab08422604212ab1a3c8626ef0def2c6dab8b3 /libempathy-gtk
parent42663eb08d126935e67609bf696ee0b0052f9fde (diff)
downloadgsoc2013-empathy-161c7f5800a89344fb65163b1e9c49ea7585cadf.tar
gsoc2013-empathy-161c7f5800a89344fb65163b1e9c49ea7585cadf.tar.gz
gsoc2013-empathy-161c7f5800a89344fb65163b1e9c49ea7585cadf.tar.bz2
gsoc2013-empathy-161c7f5800a89344fb65163b1e9c49ea7585cadf.tar.lz
gsoc2013-empathy-161c7f5800a89344fb65163b1e9c49ea7585cadf.tar.xz
gsoc2013-empathy-161c7f5800a89344fb65163b1e9c49ea7585cadf.tar.zst
gsoc2013-empathy-161c7f5800a89344fb65163b1e9c49ea7585cadf.zip
Update the preset list
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index 4a7d85e7d..d5dc1880f 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -432,7 +432,27 @@ presence_chooser_entry_icon_release_cb (EmpathyPresenceChooser *self,
mc_set_custom_state (self);
}
else {
- g_print ("FAVOURITE!\n");
+ PresenceChooserEntryType type;
+ McPresence state;
+ const char *status;
+
+ type = presence_chooser_get_entry_type (self);
+ state = empathy_idle_get_state (priv->idle);
+ status = empathy_idle_get_status (priv->idle);
+
+ if (type == ENTRY_TYPE_CUSTOM) {
+ /* save the entry */
+ DEBUG ("SAVING PRESET (%i, %s)\n", state, status);
+ empathy_status_presets_set_last (state, status);
+ }
+ else if (type == ENTRY_TYPE_SAVED) {
+ /* remove the entry */
+ DEBUG ("REMOVING PRESET (%i, %s)\n", state, status);
+ empathy_status_presets_remove (state, status);
+ }
+
+ /* update the icon */
+ presence_chooser_set_favourite_icon (self);
}
}