Mercurial > pidgin
changeset 3781:c2394f352015
[gaim-migrate @ 3921]
Whoops.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 22 Oct 2002 00:32:47 +0000 |
parents | b8d0eeb9e748 |
children | a3aca202aa04 |
files | src/dialogs.c |
diffstat | 1 files changed, 23 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dialogs.c Tue Oct 22 00:23:06 2002 +0000 +++ b/src/dialogs.c Tue Oct 22 00:32:47 2002 +0000 @@ -2841,7 +2841,7 @@ showtext = gtk_entry_get_text(GTK_ENTRY(b->text)); g_snprintf(open_tag, 2048, "<A HREF=\"%s\">%s", urltext, showtext); -/* FIXME surround(b, open_tag, "</A>");*/ + surround(b->entry, open_tag, "</A>"); g_free(open_tag); destroy_dialog(NULL, b->window); @@ -2924,7 +2924,7 @@ gtk_window_set_focus(GTK_WINDOW(c->link_dialog), b->url); b->window = c->link_dialog; b->toggle = linky; -/* FIXME b->entry_view = c->entry_view;*/ + b->entry = c->entry; gtk_widget_realize(c->link_dialog); } @@ -2986,7 +2986,7 @@ c->hasfg = 1; g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green, text_color.blue); - surround(c, open_tag, "</FONT>"); + surround(c->entry, open_tag, "</FONT>"); debug_printf("#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue); g_free(open_tag); cancel_fgcolor(NULL, c); @@ -3013,7 +3013,7 @@ c->hasbg = 1; g_snprintf(open_tag, 25, "<BODY BGCOLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green, text_color.blue); - surround(c, open_tag, "</BODY>"); + surround(c->entry, open_tag, "</BODY>"); debug_printf("#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue); g_free(open_tag); cancel_bgcolor(NULL, c); @@ -3559,9 +3559,26 @@ void insert_smiley_text(GtkWidget *widget, struct conversation *c) { - gtk_text_buffer_insert_at_cursor(c->entry_buffer, - current_smiley, -1); + char *smiley_text; + + smiley_text = strdup(current_smiley); + + /* surround(c->entry, smiley_text, ""); */ + + if (GTK_OLD_EDITABLE(c->entry)->has_selection) { + int finish = GTK_OLD_EDITABLE(c->entry)->selection_end_pos; + gtk_editable_insert_text(GTK_EDITABLE(c->entry), + smiley_text, strlen(smiley_text), &finish); + } else { + int pos = GTK_OLD_EDITABLE(c->entry)->current_pos; + gtk_editable_insert_text(GTK_EDITABLE(c->entry), smiley_text, strlen(smiley_text), &pos); + } + + g_free(smiley_text); + close_smiley_dialog(NULL, c); + + return; } static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char **xpm, GtkWidget *win,