Complete the fix for bug #2132
[claws.git] / src / gtk / quicksearch.c
index e6bd7af5458ea2c2d22ac453d1db7e55502e382c..92bb496008fddb2b0bf22368f3a53979147ae94b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2012 Colin Leroy <colin@colino.net> 
+ * Copyright (C) 1999-2013 Colin Leroy <colin@colino.net> 
  * and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
@@ -208,14 +208,23 @@ static void quicksearch_set_popdown_strings(QuickSearch *quicksearch)
 {
        GtkWidget *search_string_entry = quicksearch->search_string_entry;
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        combobox_unset_popdown_strings(GTK_COMBO_BOX(search_string_entry));
-
        if (prefs_common.summary_quicksearch_type == ADVANCED_SEARCH_EXTENDED)
                combobox_set_popdown_strings(GTK_COMBO_BOX(search_string_entry),
                        quicksearch->extended_search_strings);  
        else
                combobox_set_popdown_strings(GTK_COMBO_BOX(search_string_entry),
                        quicksearch->normal_search_strings);
+#else
+       combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry));        
+       if (prefs_common.summary_quicksearch_type == ADVANCED_SEARCH_EXTENDED)
+               combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry),
+                       quicksearch->extended_search_strings);  
+       else
+               combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry),
+                       quicksearch->normal_search_strings);
+#endif
 }
 
 static void update_extended_buttons (QuickSearch *quicksearch)
@@ -433,6 +442,8 @@ static gchar *search_descr_strings[] = {
        "a",     N_("all messages"),
        "ag #",  N_("messages whose age is greater than # days"),
        "al #",  N_("messages whose age is less than # days"),
+       "agh #",  N_("messages whose age is greater than # hours"),
+       "alh #",  N_("messages whose age is less than # hours"),
        "b S",   N_("messages which contain S in the message body"),
        "B S",   N_("messages which contain S in the whole message"),
        "c S",   N_("messages carbon-copied to S"),
@@ -483,6 +494,7 @@ static gchar *search_descr_strings[] = {
 static DescriptionWindow search_descr = {
        NULL,
        NULL,
+       FALSE,
        2,
        N_("Extended Search"),
        N_("Extended Search allows the user to define criteria that messages must "
@@ -714,7 +726,11 @@ QuickSearch *quicksearch_new()
 
        gtk_widget_show(search_type);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        search_string_entry = gtk_combo_box_entry_new_text ();
+#else
+       search_string_entry = gtk_combo_box_text_new_with_entry ();
+#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(search_string_entry), -1);
 
        vbox = gtk_vbox_new(TRUE, 0);
@@ -789,7 +805,7 @@ QuickSearch *quicksearch_new()
        quicksearch->extended_search_strings = NULL;
 
        quicksearch_set_button(GTK_BUTTON(quicksearch->search_description), GTK_STOCK_INFO, _("_Information"));
-       quicksearch_set_button(GTK_BUTTON(quicksearch->search_condition_expression), GTK_STOCK_EDIT, _("_Edit"));
+       quicksearch_set_button(GTK_BUTTON(quicksearch->search_condition_expression), GTK_STOCK_EDIT, _("E_dit"));
        quicksearch_set_button(GTK_BUTTON(quicksearch->clear_search), GTK_STOCK_CLEAR, _("C_lear"));
        
        update_extended_buttons(quicksearch);
@@ -804,7 +820,7 @@ void quicksearch_relayout(QuickSearch *quicksearch)
        case WIDE_LAYOUT:
        case WIDE_MSGLIST_LAYOUT:
                quicksearch_set_button(GTK_BUTTON(quicksearch->search_description), GTK_STOCK_INFO, _("_Information"));
-               quicksearch_set_button(GTK_BUTTON(quicksearch->search_condition_expression), GTK_STOCK_EDIT, _("_Edit"));
+               quicksearch_set_button(GTK_BUTTON(quicksearch->search_condition_expression), GTK_STOCK_EDIT, _("E_dit"));
                quicksearch_set_button(GTK_BUTTON(quicksearch->clear_search), GTK_STOCK_CLEAR, _("C_lear"));
                break;
        case SMALL_LAYOUT:
@@ -942,7 +958,9 @@ static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
 #endif
        } else {
                gtk_widget_set_sensitive(quicksearch->clear_search, FALSE);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                if (colors_initialised) {
+#endif
                        gtk_widget_modify_base(
                                gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
                                GTK_STATE_NORMAL, NULL);