| 443 g_clear_object(&statusbox->buddy_icon_img); |
443 g_clear_object(&statusbox->buddy_icon_img); |
| 444 |
444 |
| 445 g_clear_object(&statusbox->buddy_icon); |
445 g_clear_object(&statusbox->buddy_icon); |
| 446 g_clear_object(&statusbox->buddy_icon_hover); |
446 g_clear_object(&statusbox->buddy_icon_hover); |
| 447 |
447 |
| 448 g_clear_pointer(&statusbox->buddy_icon_sel, gtk_widget_destroy); |
448 g_clear_object(&statusbox->buddy_icon_sel); |
| 449 |
449 |
| 450 g_clear_pointer(&statusbox->icon_box_menu, gtk_widget_destroy); |
450 g_clear_pointer(&statusbox->icon_box_menu, gtk_widget_destroy); |
| 451 |
451 |
| 452 statusbox->icon = NULL; |
452 statusbox->icon = NULL; |
| 453 } |
453 } |
| 1408 } |
1408 } |
| 1409 |
1409 |
| 1410 static void |
1410 static void |
| 1411 choose_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box) |
1411 choose_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box) |
| 1412 { |
1412 { |
| 1413 if (box->buddy_icon_sel) { |
1413 if (box->buddy_icon_sel == NULL) { |
| 1414 gtk_window_present(GTK_WINDOW(box->buddy_icon_sel)); |
|
| 1415 } else { |
|
| 1416 box->buddy_icon_sel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtk_widget_get_toplevel(w)), icon_choose_cb, box); |
1414 box->buddy_icon_sel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtk_widget_get_toplevel(w)), icon_choose_cb, box); |
| 1417 gtk_widget_show_all(box->buddy_icon_sel); |
1415 } |
| 1418 } |
1416 gtk_native_dialog_show(GTK_NATIVE_DIALOG(box->buddy_icon_sel)); |
| 1419 } |
1417 } |
| 1420 |
1418 |
| 1421 static void |
1419 static void |
| 1422 icon_choose_cb(const char *filename, gpointer data) |
1420 icon_choose_cb(const char *filename, gpointer data) |
| 1423 { |
1421 { |
| 1428 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", filename); |
1426 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", filename); |
| 1429 else |
1427 else |
| 1430 buddy_icon_set_cb(filename, box); |
1428 buddy_icon_set_cb(filename, box); |
| 1431 } |
1429 } |
| 1432 |
1430 |
| 1433 box->buddy_icon_sel = NULL; |
1431 g_clear_object(&box->buddy_icon_sel); |
| 1434 } |
1432 } |
| 1435 |
1433 |
| 1436 static void |
1434 static void |
| 1437 update_buddyicon_cb(const char *name, PurplePrefType type, |
1435 update_buddyicon_cb(const char *name, PurplePrefType type, |
| 1438 gconstpointer value, gpointer data) |
1436 gconstpointer value, gpointer data) |