+++ /dev/null
-diff -NurdB gedit-2.6.1-orig/gedit/dialogs/gedit-preferences-dialog.c gedit-2.6.1/gedit/dialogs/gedit-preferences-dialog.c
---- gedit-2.6.1-orig/gedit/dialogs/gedit-preferences-dialog.c 2004-07-07 15:30:17 -0500
-+++ gedit-2.6.1/gedit/dialogs/gedit-preferences-dialog.c 2004-07-07 15:30:33 -0500
-@@ -867,69 +867,6 @@
- }
-
- static void
--styles_cb (GtkWidget *treeview,
-- GeditPreferencesDialog *dlg)
--{
-- GtkSourceTagStyle *style;
--
-- style = get_selected_style (dlg);
-- g_return_if_fail (style != NULL);
--
-- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->bold_togglebutton),
-- style->bold);
-- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->italic_togglebutton),
-- style->italic);
-- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->underline_togglebutton),
-- style->underline);
-- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->strikethrough_togglebutton),
-- style->strikethrough);
--
-- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->foreground_checkbutton),
-- style->mask & GTK_SOURCE_TAG_STYLE_USE_FOREGROUND);
--
-- if ((style->mask & GTK_SOURCE_TAG_STYLE_USE_FOREGROUND) == GTK_SOURCE_TAG_STYLE_USE_FOREGROUND)
-- {
-- gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->foreground_colorbutton),
-- &style->foreground);
-- }
-- else
-- {
-- GdkColor text_color;
--
-- text_color = gedit_prefs_manager_get_text_color ();
-- gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->foreground_colorbutton),
-- &text_color);
-- }
--
-- gtk_widget_set_sensitive (dlg->foreground_colorbutton,
-- style->mask & GTK_SOURCE_TAG_STYLE_USE_FOREGROUND);
--
-- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->background_checkbutton),
-- style->mask & GTK_SOURCE_TAG_STYLE_USE_BACKGROUND);
--
-- if ((style->mask & GTK_SOURCE_TAG_STYLE_USE_BACKGROUND) == GTK_SOURCE_TAG_STYLE_USE_BACKGROUND)
-- {
-- gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->background_colorbutton_2),
-- &style->background);
-- }
-- else
-- {
-- GdkColor background_color;
--
-- background_color = gedit_prefs_manager_get_background_color ();
-- gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->background_colorbutton_2),
-- &background_color);
-- }
--
-- gtk_widget_set_sensitive (dlg->background_colorbutton_2,
-- style->mask & GTK_SOURCE_TAG_STYLE_USE_BACKGROUND);
--
-- gtk_widget_set_sensitive (dlg->reset_button, !style->is_default);
--
-- gtk_source_tag_style_free (style);
--}
--
--static void
- style_button_toggled (GtkToggleButton *button,
- GeditPreferencesDialog *dlg)
- {
-@@ -1037,6 +974,105 @@
- }
-
- static void
-+styles_cb (GtkWidget *treeview,
-+ GeditPreferencesDialog *dlg)
-+{
-+ GtkSourceTagStyle *style;
-+
-+ style = get_selected_style (dlg);
-+ g_return_if_fail (style != NULL);
-+
-+ /* we must block callbacks while setting the new values */
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->bold_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->italic_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->underline_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->strikethrough_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->foreground_checkbutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->background_checkbutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->foreground_colorbutton),
-+ G_CALLBACK (style_color_set), dlg);
-+ g_signal_handlers_block_by_func (G_OBJECT (dlg->background_colorbutton_2),
-+ G_CALLBACK (style_color_set), dlg);
-+
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->bold_togglebutton),
-+ style->bold);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->italic_togglebutton),
-+ style->italic);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->underline_togglebutton),
-+ style->underline);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->strikethrough_togglebutton),
-+ style->strikethrough);
-+
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->foreground_checkbutton),
-+ style->mask & GTK_SOURCE_TAG_STYLE_USE_FOREGROUND);
-+
-+ if ((style->mask & GTK_SOURCE_TAG_STYLE_USE_FOREGROUND) == GTK_SOURCE_TAG_STYLE_USE_FOREGROUND)
-+ {
-+ gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->foreground_colorbutton),
-+ &style->foreground);
-+ }
-+ else
-+ {
-+ GdkColor text_color;
-+
-+ text_color = gedit_prefs_manager_get_text_color ();
-+ gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->foreground_colorbutton),
-+ &text_color);
-+ }
-+
-+ gtk_widget_set_sensitive (dlg->foreground_colorbutton,
-+ style->mask & GTK_SOURCE_TAG_STYLE_USE_FOREGROUND);
-+
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->background_checkbutton),
-+ style->mask & GTK_SOURCE_TAG_STYLE_USE_BACKGROUND);
-+
-+ if ((style->mask & GTK_SOURCE_TAG_STYLE_USE_BACKGROUND) == GTK_SOURCE_TAG_STYLE_USE_BACKGROUND)
-+ {
-+ gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->background_colorbutton_2),
-+ &style->background);
-+ }
-+ else
-+ {
-+ GdkColor background_color;
-+
-+ background_color = gedit_prefs_manager_get_background_color ();
-+ gtk_color_button_set_color (GTK_COLOR_BUTTON (dlg->background_colorbutton_2),
-+ &background_color);
-+ }
-+
-+ gtk_widget_set_sensitive (dlg->background_colorbutton_2,
-+ style->mask & GTK_SOURCE_TAG_STYLE_USE_BACKGROUND);
-+
-+ gtk_widget_set_sensitive (dlg->reset_button, !style->is_default);
-+
-+ /* reenable callbacks */
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->bold_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->italic_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->underline_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->strikethrough_togglebutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->foreground_checkbutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->background_checkbutton),
-+ G_CALLBACK (style_button_toggled), dlg);
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->foreground_colorbutton),
-+ G_CALLBACK (style_color_set), dlg);
-+ g_signal_handlers_unblock_by_func (G_OBJECT (dlg->background_colorbutton_2),
-+ G_CALLBACK (style_color_set), dlg);
-+
-+ gtk_source_tag_style_free (style);
-+}
-+
-+static void
- reset_button_clicked (GtkButton *button,
- GeditPreferencesDialog *dlg)
- {