# HG changeset patch # User Mark Doliner # Date 1082770991 0 # Node ID 262f81346c0ab974fb1bada424e4d1f2ff091928 # Parent 163199223fb963523c9d5ed55592490226588617 [gaim-migrate @ 9550] Disable the insert image button on the create away message dialog. I also made the toolbar grab which format options it should support when it is attached to the imhtml. So you can set if the imhtml should support smileys, images, background colors, etc and THEN attach the toolbar and the buttons will still be correctly grayed out. committer: Tailor Script diff -r 163199223fb9 -r 262f81346c0a src/dialogs.c --- a/src/dialogs.c Sat Apr 24 01:33:04 2004 +0000 +++ b/src/dialogs.c Sat Apr 24 01:43:11 2004 +0000 @@ -805,6 +805,7 @@ ca->text = gtk_imhtml_new(NULL, NULL); gtk_imhtml_set_editable(GTK_IMHTML(ca->text), TRUE); + gtk_imhtml_set_format_functions(GTK_IMHTML(ca->text), GTK_IMHTML_ALL ^ GTK_IMHTML_IMAGE); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(ca->text), GTK_WRAP_WORD_CHAR); gtk_imhtml_smiley_shortcuts(GTK_IMHTML(ca->text), diff -r 163199223fb9 -r 262f81346c0a src/gtkimhtml.c --- a/src/gtkimhtml.c Sat Apr 24 01:33:04 2004 +0000 +++ b/src/gtkimhtml.c Sat Apr 24 01:43:11 2004 +0000 @@ -3096,6 +3096,10 @@ g_object_unref(object); } +GtkIMHtmlButtons gtk_imhtml_get_format_functions(GtkIMHtml *imhtml) +{ + return imhtml->format_functions; +} void gtk_imhtml_get_current_format(GtkIMHtml *imhtml, gboolean *bold, gboolean *italic, gboolean *underline) diff -r 163199223fb9 -r 262f81346c0a src/gtkimhtml.h --- a/src/gtkimhtml.h Sat Apr 24 01:33:04 2004 +0000 +++ b/src/gtkimhtml.h Sat Apr 24 01:43:11 2004 +0000 @@ -238,6 +238,7 @@ void gtk_imhtml_set_editable(GtkIMHtml *imhtml, gboolean editable); void gtk_imhtml_set_whole_buffer_formatting_only(GtkIMHtml *imhtml, gboolean wbfo); void gtk_imhtml_set_format_functions(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons); +GtkIMHtmlButtons gtk_imhtml_get_format_functions(GtkIMHtml *imhtml); void gtk_imhtml_get_current_format(GtkIMHtml *imhtml, gboolean *bold, gboolean *italic, gboolean *underline); gboolean gtk_imhtml_get_editable(GtkIMHtml *imhtml); gboolean gtk_imhtml_toggle_bold(GtkIMHtml *imhtml); diff -r 163199223fb9 -r 262f81346c0a src/gtkimhtmltoolbar.c --- a/src/gtkimhtmltoolbar.c Sat Apr 24 01:33:04 2004 +0000 +++ b/src/gtkimhtmltoolbar.c Sat Apr 24 01:43:11 2004 +0000 @@ -1017,6 +1017,7 @@ void gtk_imhtmltoolbar_attach(GtkIMHtmlToolbar *toolbar, GtkWidget *imhtml) { + GtkIMHtmlButtons buttons; gboolean bold, italic, underline; g_return_if_fail(toolbar != NULL); @@ -1031,6 +1032,9 @@ g_signal_connect(G_OBJECT(imhtml), "format_function_update", G_CALLBACK(update_format_cb), toolbar); g_signal_connect_after(G_OBJECT(GTK_IMHTML(imhtml)->text_buffer), "mark-set", G_CALLBACK(mark_set_cb), toolbar); + buttons = gtk_imhtml_get_format_functions(GTK_IMHTML(imhtml)); + update_buttons_cb(imhtml, buttons, toolbar); + bold = italic = underline = FALSE; gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), &bold, &italic, &underline);