2011-10-07 [colin] 3.7.10cvs21
[claws.git] / src / prefs_folder_item.c
index a9a40884fd12a11e107c8ec957b21174e04ac1bf..82a6e9f66e3e7a0561acbb3d90097b8159d6c0ca 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1332,7 +1332,8 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
        GtkWidget *reply_format_rec_checkbtn;
        GtkWidget *forward_format_rec_checkbtn;
        GtkWidget *hbox;
-
+       GtkWidget *vbox_format;
+       
        page->item = item;
 
        page_vbox = gtk_vbox_new (FALSE, 0);
@@ -1369,9 +1370,12 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
                                FALSE, FALSE);
        address_completion_register_entry(GTK_ENTRY(page->compose_override_from_format),
                        TRUE);
+       
+       vbox_format = gtk_widget_get_parent(
+                       gtk_widget_get_parent(page->compose_body_format));
 
        hbox = gtk_hbox_new (FALSE, 0);
-       gtk_box_pack_end (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_end (GTK_BOX(vbox_format), hbox, FALSE, FALSE, 0);
        quotefmt_add_info_button(window, hbox);
        
        new_msg_format_rec_checkbtn = gtk_check_button_new_with_label(
@@ -1395,8 +1399,11 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
        address_completion_register_entry(GTK_ENTRY(page->reply_override_from_format),
                        TRUE);
 
+       vbox_format = gtk_widget_get_parent(
+                       gtk_widget_get_parent(page->reply_body_format));
+
        hbox = gtk_hbox_new (FALSE, 0);
-       gtk_box_pack_end (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_end (GTK_BOX(vbox_format), hbox, FALSE, FALSE, 0);
        quotefmt_add_info_button(window, hbox);
 
        reply_format_rec_checkbtn = gtk_check_button_new_with_label(
@@ -1420,8 +1427,11 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
        address_completion_register_entry(GTK_ENTRY(page->forward_override_from_format),
                        TRUE);
 
+       vbox_format = gtk_widget_get_parent(
+                       gtk_widget_get_parent(page->forward_body_format));
+
        hbox = gtk_hbox_new (FALSE, 0);
-       gtk_box_pack_end (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_end (GTK_BOX(vbox_format), hbox, FALSE, FALSE, 0);
        quotefmt_add_info_button(window, hbox);
 
        forward_format_rec_checkbtn = gtk_check_button_new_with_label(
@@ -1655,8 +1665,12 @@ static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
 
 static void folder_regexp_test_cb(GtkWidget *widget, gpointer data)
 {
+#if !GTK_CHECK_VERSION(3, 0, 0)
        static GdkColor red;
        static gboolean colors_initialised = FALSE;
+#else
+       static GdkColor red = { (guint32)0, (guint16)0xff, (guint16)0x70, (guint16)0x70 };
+#endif
        static gchar buf[BUFFSIZE];
        FolderItemGeneralPage *page = (FolderItemGeneralPage *)data;
        gchar *test_string, *regexp;
@@ -1682,17 +1696,20 @@ static void folder_regexp_test_cb(GtkWidget *widget, gpointer data)
                return;
        }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        if (!colors_initialised) {
                gdk_color_parse("#ff7070", &red);
                colors_initialised = gdk_colormap_alloc_color(
                        gdk_colormap_get_system(), &red, FALSE, TRUE);
        }
+#endif
 
        preg = summary_compile_simplify_regexp(regexp);
-       if (colors_initialised) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
+       if (colors_initialised)
                gtk_widget_modify_base(page->entry_simplify_subject,
                                GTK_STATE_NORMAL, preg ? NULL : &red);
-       }
+#endif
 
        if (preg != NULL) {
                string_remove_match(buf, BUFFSIZE, test_string, preg);