Mercurial > pidgin
comparison plugins/spellchk.c @ 11964:5db4ae4c94a1
[gaim-migrate @ 14255]
sf patch #1347710, from Levi Bard
Make text repl detach from existing conversations on unload
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 04 Nov 2005 01:30:52 +0000 |
parents | c8b8d4f8d070 |
children | d225a55927df |
comparison
equal
deleted
inserted
replaced
11963:d8787960e398 | 11964:5db4ae4c94a1 |
---|---|
262 static void | 262 static void |
263 spellchk_free(spellchk *spell) | 263 spellchk_free(spellchk *spell) |
264 { | 264 { |
265 GtkTextBuffer *buffer; | 265 GtkTextBuffer *buffer; |
266 | 266 |
267 g_return_if_fail(spell != NULL); | |
268 | |
267 buffer = gtk_text_view_get_buffer(spell->view); | 269 buffer = gtk_text_view_get_buffer(spell->view); |
268 | 270 |
269 g_signal_handlers_disconnect_matched(spell->view, | 271 g_signal_handlers_disconnect_matched(spell->view, |
270 G_SIGNAL_MATCH_DATA, | 272 G_SIGNAL_MATCH_DATA, |
271 0, 0, NULL, NULL, | 273 0, 0, NULL, NULL, |
577 g_signal_connect_after(G_OBJECT(buffer), | 579 g_signal_connect_after(G_OBJECT(buffer), |
578 "insert-text", | 580 "insert-text", |
579 G_CALLBACK(insert_text_after), spell); | 581 G_CALLBACK(insert_text_after), spell); |
580 | 582 |
581 return; | 583 return; |
584 } | |
585 | |
586 static void | |
587 spellchk_detach(GaimConversation *conv) | |
588 { | |
589 GaimGtkConversation *gtkconv; | |
590 spellchk *spell; | |
591 | |
592 gtkconv = GAIM_GTK_CONVERSATION(conv); | |
593 spell = g_object_steal_data(G_OBJECT(gtkconv->entry), SPELLCHK_OBJECT_KEY); | |
594 spellchk_free(spell); | |
582 } | 595 } |
583 | 596 |
584 static int buf_get_line(char *ibuf, char **buf, int *position, int len) | 597 static int buf_get_line(char *ibuf, char **buf, int *position, int len) |
585 { | 598 { |
586 int pos = *position; | 599 int pos = *position; |
1936 plugin, GAIM_CALLBACK(spellchk_new_attach), NULL); | 1949 plugin, GAIM_CALLBACK(spellchk_new_attach), NULL); |
1937 | 1950 |
1938 return TRUE; | 1951 return TRUE; |
1939 } | 1952 } |
1940 | 1953 |
1954 static gboolean | |
1955 plugin_unload(GaimPlugin *plugin) | |
1956 { | |
1957 GList *convs; | |
1958 | |
1959 /* Detach from existing conversations */ | |
1960 for (convs = gaim_get_conversations(); convs != NULL; convs = convs->next) | |
1961 { | |
1962 spellchk_detach((GaimConversation *)convs->data); | |
1963 } | |
1964 | |
1965 return TRUE; | |
1966 } | |
1967 | |
1941 static GtkWidget * | 1968 static GtkWidget * |
1942 get_config_frame(GaimPlugin *plugin) | 1969 get_config_frame(GaimPlugin *plugin) |
1943 { | 1970 { |
1944 GtkWidget *ret, *vbox, *win; | 1971 GtkWidget *ret, *vbox, *win; |
1945 GtkWidget *hbox, *label; | 1972 GtkWidget *hbox, *label; |
2106 N_("Replaces text in outgoing messages according to user-defined rules."), | 2133 N_("Replaces text in outgoing messages according to user-defined rules."), |
2107 N_("Replaces text in outgoing messages according to user-defined rules."), | 2134 N_("Replaces text in outgoing messages according to user-defined rules."), |
2108 "Eric Warmenhoven <eric@warmenhoven.org>", | 2135 "Eric Warmenhoven <eric@warmenhoven.org>", |
2109 GAIM_WEBSITE, | 2136 GAIM_WEBSITE, |
2110 plugin_load, | 2137 plugin_load, |
2111 NULL, | 2138 plugin_unload, |
2112 NULL, | 2139 NULL, |
2113 &ui_info, | 2140 &ui_info, |
2114 NULL, | 2141 NULL, |
2115 NULL, | 2142 NULL, |
2116 NULL | 2143 NULL |