aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-status-presets.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-08-10 01:17:12 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-08-10 01:17:12 +0800
commit6b18017f8240d6ce4880a1ed7d9158be8d914c95 (patch)
tree3f98de4a2431e5c4684b2e7351ac0861b83872e2 /libempathy-gtk/empathy-status-presets.c
parent0a392cd8a302c71ce28efa14e6a0b8792b5a393f (diff)
downloadgsoc2013-empathy-6b18017f8240d6ce4880a1ed7d9158be8d914c95.tar
gsoc2013-empathy-6b18017f8240d6ce4880a1ed7d9158be8d914c95.tar.gz
gsoc2013-empathy-6b18017f8240d6ce4880a1ed7d9158be8d914c95.tar.bz2
gsoc2013-empathy-6b18017f8240d6ce4880a1ed7d9158be8d914c95.tar.lz
gsoc2013-empathy-6b18017f8240d6ce4880a1ed7d9158be8d914c95.tar.xz
gsoc2013-empathy-6b18017f8240d6ce4880a1ed7d9158be8d914c95.tar.zst
gsoc2013-empathy-6b18017f8240d6ce4880a1ed7d9158be8d914c95.zip
Remove per-state "Custom message..." item and add one on the bottom of the
2007-08-09 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-presence-chooser.glade: * libempathy-gtk/empathy-presence-chooser.c: * libempathy-gtk/empathy-status-presets.c: * libempathy-gtk/empathy-status-presets.h: * libempathy-gtk/empathy-ui-utils.c: Remove per-state "Custom message..." item and add one on the bottom of the menu. Add a combobox on the custom message dialog to select the state and change the action of the checkbox, now it add/remove the message from saved messages. Make easier to add other states to the list if needed. Fixes bug #460678. svn path=/trunk/; revision=241
Diffstat (limited to 'libempathy-gtk/empathy-status-presets.c')
-rw-r--r--libempathy-gtk/empathy-status-presets.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-status-presets.c b/libempathy-gtk/empathy-status-presets.c
index 80ce4149a..502772228 100644
--- a/libempathy-gtk/empathy-status-presets.c
+++ b/libempathy-gtk/empathy-status-presets.c
@@ -288,16 +288,13 @@ empathy_status_presets_set_last (McPresence state,
StatusPreset *preset;
gint num;
- /* Remove any duplicate. */
+ /* Check if duplicate */
for (l = presets; l; l = l->next) {
preset = l->data;
- if (state == preset->state) {
- if (strcmp (status, preset->status) == 0) {
- status_preset_free (preset);
- presets = g_list_delete_link (presets, l);
- break;
- }
+ if (state == preset->state &&
+ !empathy_strdiff (status, preset->status)) {
+ return;
}
}
@@ -325,6 +322,26 @@ empathy_status_presets_set_last (McPresence state,
}
void
+empathy_status_presets_remove (McPresence state,
+ const gchar *status)
+{
+ StatusPreset *preset;
+ GList *l;
+
+ for (l = presets; l; l = l->next) {
+ preset = l->data;
+
+ if (state == preset->state &&
+ !empathy_strdiff (status, preset->status)) {
+ status_preset_free (preset);
+ presets = g_list_delete_link (presets, l);
+ status_presets_file_save ();
+ break;
+ }
+ }
+}
+
+void
empathy_status_presets_reset (void)
{
g_list_foreach (presets, (GFunc) status_preset_free, NULL);