comparison src/gtkrequest.c @ 7172:895cd1d03efb

[gaim-migrate @ 7740] I added buddy comment support for AIM and ICQ I also fixed a tini memleak in gaim_request_something when using a multiline dialog. I also tried to organize ChangeLog some. I put stuff that I thought normal people would care about the most at the top, and tried to group stuff aimed at plugin authors together, and nearer to the bottom. Feel free to do a better job than me. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 06 Oct 2003 03:21:33 +0000
parents cef309da8793
children 5d0db846c42d
comparison
equal deleted inserted replaced
7171:511b4edb467c 7172:895cd1d03efb
69 69
70 static void 70 static void
71 input_response_cb(GtkDialog *dialog, gint id, GaimGtkRequestData *data) 71 input_response_cb(GtkDialog *dialog, gint id, GaimGtkRequestData *data)
72 { 72 {
73 const char *value; 73 const char *value;
74 char *multiline_value;
74 75
75 if (data->u.input.multiline) { 76 if (data->u.input.multiline) {
76 GtkTextIter start_iter, end_iter; 77 GtkTextIter start_iter, end_iter;
77 GtkTextBuffer *buffer = 78 GtkTextBuffer *buffer =
78 gtk_text_view_get_buffer(GTK_TEXT_VIEW(data->u.input.entry)); 79 gtk_text_view_get_buffer(GTK_TEXT_VIEW(data->u.input.entry));
79 80
80 gtk_text_buffer_get_start_iter(buffer, &start_iter); 81 gtk_text_buffer_get_start_iter(buffer, &start_iter);
81 gtk_text_buffer_get_end_iter(buffer, &end_iter); 82 gtk_text_buffer_get_end_iter(buffer, &end_iter);
82 83
83 value = gtk_text_buffer_get_text(buffer, &start_iter, &end_iter, 84 multiline_value = gtk_text_buffer_get_text(buffer, &start_iter, &end_iter,
84 FALSE); 85 FALSE);
86 value = multiline_value;
85 } 87 }
86 else 88 else
87 value = gtk_entry_get_text(GTK_ENTRY(data->u.input.entry)); 89 value = gtk_entry_get_text(GTK_ENTRY(data->u.input.entry));
88 90
89 if (id < data->cb_count && data->cbs[id] != NULL) 91 if (id < data->cb_count && data->cbs[id] != NULL)
90 ((GaimRequestInputCb)data->cbs[id])(data->user_data, value); 92 ((GaimRequestInputCb)data->cbs[id])(data->user_data, value);
91 else if (data->cbs[1] != NULL) 93 else if (data->cbs[1] != NULL)
92 ((GaimRequestInputCb)data->cbs[1])(data->user_data, value); 94 ((GaimRequestInputCb)data->cbs[1])(data->user_data, value);
95
96 if (data->u.input.multiline)
97 g_free(multiline_value);
93 98
94 gaim_request_close(GAIM_REQUEST_INPUT, data); 99 gaim_request_close(GAIM_REQUEST_INPUT, data);
95 } 100 }
96 101
97 static void 102 static void