Mercurial > pidgin
comparison src/gtksavedstatuses.c @ 12237:3294e27cb54a
[gaim-migrate @ 14539]
Patch from sadrul to fix working with gtk < 2.6. Also a leak fix and a fix
for where we were double-markup-escaping things.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sun, 27 Nov 2005 18:03:51 +0000 |
parents | 0a549a454d8e |
children | 40f6334bb424 |
comparison
equal
deleted
inserted
replaced
12236:2cfd36ba0f45 | 12237:3294e27cb54a |
---|---|
285 static void | 285 static void |
286 status_window_delete_foreach(GtkTreeModel *model, GtkTreePath *path, | 286 status_window_delete_foreach(GtkTreeModel *model, GtkTreePath *path, |
287 GtkTreeIter *iter, gpointer user_data) | 287 GtkTreeIter *iter, gpointer user_data) |
288 { | 288 { |
289 char *title; | 289 char *title; |
290 char *title_escaped, *buf; | 290 char *buf; |
291 | 291 |
292 gtk_tree_model_get(model, iter, STATUS_WINDOW_COLUMN_TITLE, &title, -1); | 292 gtk_tree_model_get(model, iter, STATUS_WINDOW_COLUMN_TITLE, &title, -1); |
293 | 293 |
294 title_escaped = g_markup_escape_text(title, -1); | 294 buf = g_strdup_printf(_("Are you sure you want to delete %s?"), title); |
295 buf = g_strdup_printf(_("Are you sure you want to delete %s?"), title_escaped); | |
296 free(title_escaped); | |
297 gaim_request_action(NULL, NULL, buf, NULL, 0, title, 2, | 295 gaim_request_action(NULL, NULL, buf, NULL, 0, title, 2, |
298 _("Delete"), status_window_delete_confirm_cb, | 296 _("Delete"), status_window_delete_confirm_cb, |
299 _("Cancel"), g_free); | 297 _("Cancel"), g_free); |
298 g_free(title); | |
300 g_free(buf); | 299 g_free(buf); |
301 } | 300 } |
302 | 301 |
303 static void | 302 static void |
304 status_window_delete_cb(GtkButton *button, gpointer user_data) | 303 status_window_delete_cb(GtkButton *button, gpointer user_data) |
1454 * Utilities * | 1453 * Utilities * |
1455 **************************************************************************/ | 1454 **************************************************************************/ |
1456 | 1455 |
1457 void status_menu_cb(GtkComboBox *widget, void(*callback)(GaimSavedStatus*)) | 1456 void status_menu_cb(GtkComboBox *widget, void(*callback)(GaimSavedStatus*)) |
1458 { | 1457 { |
1459 callback(gaim_savedstatus_find(gtk_combo_box_get_active_text(widget))); | 1458 GtkTreeIter iter; |
1459 gchar *title = NULL; | |
1460 | |
1461 if (!gtk_combo_box_get_active_iter(widget, &iter)) | |
1462 return; | |
1463 | |
1464 gtk_tree_model_get(gtk_combo_box_get_model(widget), &iter, | |
1465 STATUS_WINDOW_COLUMN_TITLE, &title, -1); | |
1466 callback(gaim_savedstatus_find(title)); | |
1467 g_free(title); | |
1460 } | 1468 } |
1461 | 1469 |
1462 GtkWidget *gaim_gtk_status_menu(GaimSavedStatus *current_status, GCallback callback) | 1470 GtkWidget *gaim_gtk_status_menu(GaimSavedStatus *current_status, GCallback callback) |
1463 { | 1471 { |
1464 GtkWidget *combobox; | 1472 GtkWidget *combobox; |