comparison console/gntblist.c @ 15503:704d40050800

Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui. Some of the strings differ from the GTK+ counterpart by an underscore. How big of a problem/annoyance is that going to be? I haven't added the file in po/POTFILES.in. Should I?
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 03 Feb 2007 05:55:41 +0000
parents 28051164843c
children 35fa1d1c4ef2
comparison
equal deleted inserted replaced
15489:29e8e230d1b6 15503:704d40050800
43 #include "gntmenuitem.h" 43 #include "gntmenuitem.h"
44 #include "gntmenuitemcheck.h" 44 #include "gntmenuitemcheck.h"
45 #include "gnttree.h" 45 #include "gnttree.h"
46 #include "gntutils.h" 46 #include "gntutils.h"
47 #include "gntwindow.h" 47 #include "gntwindow.h"
48 #include "gntpounce.h"
48 49
49 #include "gntblist.h" 50 #include "gntblist.h"
50 #include "gntconv.h" 51 #include "gntconv.h"
51 #include "gntstatus.h" 52 #include "gntstatus.h"
52 #include <string.h> 53 #include <string.h>
878 gaim_blist_alias_chat((GaimChat*)node, name); 879 gaim_blist_alias_chat((GaimChat*)node, name);
879 else if (GAIM_BLIST_NODE_IS_GROUP(node) && (name != NULL)) 880 else if (GAIM_BLIST_NODE_IS_GROUP(node) && (name != NULL))
880 gaim_blist_rename_group((GaimGroup*)node, name); 881 gaim_blist_rename_group((GaimGroup*)node, name);
881 else 882 else
882 g_return_if_reached(); 883 g_return_if_reached();
884 }
885
886 static void
887 gg_blist_pounce_node_cb(GaimBlistNode *node, GaimBlistNode *selected)
888 {
889 GaimBuddy *b;
890 if (GAIM_BLIST_NODE_IS_CONTACT(node))
891 b = gaim_contact_get_priority_buddy((GaimContact *)node);
892 else
893 b = (GaimBuddy *)node;
894 gg_pounce_editor_show(b->account, b->name, NULL);
883 } 895 }
884 896
885 static void 897 static void
886 gg_blist_rename_node_cb(GaimBlistNode *node, GaimBlistNode *selected) 898 gg_blist_rename_node_cb(GaimBlistNode *node, GaimBlistNode *selected)
887 { 899 {
1121 if (ggblist->tagged && (GAIM_BLIST_NODE_IS_CONTACT(node) 1133 if (ggblist->tagged && (GAIM_BLIST_NODE_IS_CONTACT(node)
1122 || GAIM_BLIST_NODE_IS_GROUP(node))) { 1134 || GAIM_BLIST_NODE_IS_GROUP(node))) {
1123 add_custom_action(GNT_MENU(context), _("Place tagged"), 1135 add_custom_action(GNT_MENU(context), _("Place tagged"),
1124 GAIM_CALLBACK(gg_blist_place_tagged), node); 1136 GAIM_CALLBACK(gg_blist_place_tagged), node);
1125 } 1137 }
1126 1138
1127 if (GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CONTACT(node)) { 1139 if (GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CONTACT(node)) {
1140 add_custom_action(GNT_MENU(context), _("Add Buddy Pounce"),
1141 GAIM_CALLBACK(gg_blist_pounce_node_cb), node);
1128 add_custom_action(GNT_MENU(context), _("Toggle Tag"), 1142 add_custom_action(GNT_MENU(context), _("Toggle Tag"),
1129 GAIM_CALLBACK(gg_blist_toggle_tag_buddy), node); 1143 GAIM_CALLBACK(gg_blist_toggle_tag_buddy), node);
1130 } 1144 }
1131 } 1145 }
1132 1146
1690 savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old) 1704 savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old)
1691 { 1705 {
1692 GList *list; 1706 GList *list;
1693 GaimStatusPrimitive prim; 1707 GaimStatusPrimitive prim;
1694 const char *message; 1708 const char *message;
1709 gboolean found = FALSE, saved = TRUE;
1695 1710
1696 if (!ggblist) 1711 if (!ggblist)
1697 return; 1712 return;
1698 1713
1699 /* Block the signals we don't want to emit */ 1714 /* Block the signals we don't want to emit */
1706 message = gaim_savedstatus_get_message(now); 1721 message = gaim_savedstatus_get_message(now);
1707 1722
1708 /* Rebuild the status dropdown */ 1723 /* Rebuild the status dropdown */
1709 populate_status_dropdown(); 1724 populate_status_dropdown();
1710 1725
1711 list = g_object_get_data(G_OBJECT(ggblist->status), "list of statuses"); 1726 while (!found) {
1712 for (; list; list = list->next) 1727 list = g_object_get_data(G_OBJECT(ggblist->status), "list of statuses");
1713 { 1728 for (; list; list = list->next)
1714 StatusBoxItem *item = list->data;
1715 if (item->type == STATUS_PRIMITIVE && item->u.prim == prim)
1716 { 1729 {
1717 char *mess = gaim_unescape_html(message); 1730 StatusBoxItem *item = list->data;
1718 gnt_combo_box_set_selected(GNT_COMBO_BOX(ggblist->status), item); 1731 if ((saved && item->type != STATUS_PRIMITIVE && item->u.saved == now) ||
1719 gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), mess); 1732 (!saved && item->type == STATUS_PRIMITIVE && item->u.prim == prim))
1720 gnt_widget_draw(ggblist->status); 1733 {
1721 g_free(mess); 1734 char *mess = gaim_unescape_html(message);
1735 gnt_combo_box_set_selected(GNT_COMBO_BOX(ggblist->status), item);
1736 gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), mess);
1737 gnt_widget_draw(ggblist->status);
1738 g_free(mess);
1739 found = TRUE;
1740 break;
1741 }
1742 }
1743 if (!saved)
1722 break; 1744 break;
1723 } 1745 saved = FALSE;
1724 } 1746 }
1725 1747
1726 g_signal_handlers_unblock_matched(ggblist->status, G_SIGNAL_MATCH_FUNC, 1748 g_signal_handlers_unblock_matched(ggblist->status, G_SIGNAL_MATCH_FUNC,
1727 0, 0, NULL, status_selection_changed, NULL); 1749 0, 0, NULL, status_selection_changed, NULL);
1728 g_signal_handlers_unblock_matched(ggblist->statustext, G_SIGNAL_MATCH_FUNC, 1750 g_signal_handlers_unblock_matched(ggblist->statustext, G_SIGNAL_MATCH_FUNC,