console/gntblist.c

changeset 14109
1af2b9d5ef3f
parent 14104
31fd1353462d
child 14121
3d8804b82150
equal deleted inserted replaced
14108:8f4414c9827b 14109:1af2b9d5ef3f
59 static void add_buddy(GaimBuddy *buddy, GGBlist *ggblist); 59 static void add_buddy(GaimBuddy *buddy, GGBlist *ggblist);
60 static void add_group(GaimGroup *group, GGBlist *ggblist); 60 static void add_group(GaimGroup *group, GGBlist *ggblist);
61 static void add_chat(GaimChat *chat, GGBlist *ggblist); 61 static void add_chat(GaimChat *chat, GGBlist *ggblist);
62 static void add_node(GaimBlistNode *node, GGBlist *ggblist); 62 static void add_node(GaimBlistNode *node, GGBlist *ggblist);
63 static void draw_tooltip(GGBlist *ggblist); 63 static void draw_tooltip(GGBlist *ggblist);
64 static void remove_typing_cb(gpointer null); 64 static gboolean remove_typing_cb(gpointer null);
65 static void remove_peripherals(GGBlist *ggblist); 65 static void remove_peripherals(GGBlist *ggblist);
66 static const char * get_display_name(GaimBlistNode *node); 66 static const char * get_display_name(GaimBlistNode *node);
67 67
68 static void 68 static void
69 new_node(GaimBlistNode *node) 69 new_node(GaimBlistNode *node)
871 gg_blist_show(); 871 gg_blist_show();
872 872
873 return; 873 return;
874 } 874 }
875 875
876 static void 876 static gboolean
877 remove_typing_cb(gpointer null) 877 remove_typing_cb(gpointer null)
878 { 878 {
879 GaimSavedStatus *current; 879 GaimSavedStatus *current;
880 const char *message, *newmessage; 880 const char *message, *newmessage;
881 GaimStatusPrimitive prim, newprim; 881 GaimStatusPrimitive prim, newprim;
885 message = gaim_savedstatus_get_message(current); 885 message = gaim_savedstatus_get_message(current);
886 prim = gaim_savedstatus_get_type(current); 886 prim = gaim_savedstatus_get_type(current);
887 887
888 newmessage = gnt_entry_get_text(GNT_ENTRY(ggblist->statustext)); 888 newmessage = gnt_entry_get_text(GNT_ENTRY(ggblist->statustext));
889 item = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(ggblist->status)); 889 item = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(ggblist->status));
890 g_return_if_fail(item->type == STATUS_PRIMITIVE); 890 g_return_val_if_fail(item->type == STATUS_PRIMITIVE, FALSE);
891 newprim = item->u.prim; 891 newprim = item->u.prim;
892 892
893 if (newprim != prim || ((message && !newmessage) || 893 if (newprim != prim || ((message && !newmessage) ||
894 (!message && newmessage) || 894 (!message && newmessage) ||
895 (message && newmessage && g_utf8_collate(message, newmessage) != 0))) 895 (message && newmessage && g_utf8_collate(message, newmessage) != 0)))
906 } 906 }
907 907
908 gnt_box_give_focus_to_child(GNT_BOX(ggblist->window), ggblist->tree); 908 gnt_box_give_focus_to_child(GNT_BOX(ggblist->window), ggblist->tree);
909 g_source_remove(ggblist->typing); 909 g_source_remove(ggblist->typing);
910 ggblist->typing = 0; 910 ggblist->typing = 0;
911 return FALSE;
911 } 912 }
912 913
913 static void 914 static void
914 status_selection_changed(GntComboBox *box, StatusBoxItem *old, StatusBoxItem *now, gpointer null) 915 status_selection_changed(GntComboBox *box, StatusBoxItem *old, StatusBoxItem *now, gpointer null)
915 { 916 {
930 } 931 }
931 932
932 static gboolean 933 static gboolean
933 status_text_changed(GntEntry *entry, const char *text, gpointer null) 934 status_text_changed(GntEntry *entry, const char *text, gpointer null)
934 { 935 {
935 if (text[0] == 27 && ggblist->typing == 0) 936 if ((text[0] == 27 || (text[0] == '\t' && text[1] == '\0')) && ggblist->typing == 0)
936 return FALSE; 937 return FALSE;
937 938
938 g_source_remove(ggblist->typing); 939 g_source_remove(ggblist->typing);
939 ggblist->typing = 0; 940 ggblist->typing = 0;
940 941

mercurial