2006-12-01 [wwp] 2.6.0cvs72
authorTristan Chabredier <wwp@claws-mail.org>
Fri, 1 Dec 2006 10:01:04 +0000 (10:01 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Fri, 1 Dec 2006 10:01:04 +0000 (10:01 +0000)
* src/common/defs.h
* src/prefs_common.c
* src/prefs_common.h
* src/message_search.c
* src/summary_search.c
* src/gtk/combobox.c
* src/gtk/combobox.h
add history combos to all message and summary search fields.

ChangeLog
PATCHSETS
configure.ac
src/common/defs.h
src/gtk/combobox.c
src/gtk/combobox.h
src/message_search.c
src/prefs_common.c
src/prefs_common.h
src/summary_search.c

index 5f0cfbc..adc2e20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-12-01 [wwp]       2.6.0cvs72
+
+       * src/common/defs.h
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/message_search.c
+       * src/summary_search.c
+       * src/gtk/combobox.c
+       * src/gtk/combobox.h
+               add history combos to all message and summary search fields.
+
 2006-12-01 [wwp]       2.6.0cvs71
 
        * src/summaryview.c
index 2bfde19..24e1e17 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.38 -r 1.1.2.39 src/wizard.c;  ) > 2.6.0cvs69.patchset
 ( cvs diff -u -r 1.96.2.159 -r 1.96.2.160 src/textview.c;  ) > 2.6.0cvs70.patchset
 ( cvs diff -u -r 1.395.2.269 -r 1.395.2.270 src/summaryview.c;  ) > 2.6.0cvs71.patchset
+( cvs diff -u -r 1.9.2.30 -r 1.9.2.31 src/common/defs.h;  cvs diff -u -r 1.204.2.109 -r 1.204.2.110 src/prefs_common.c;  cvs diff -u -r 1.103.2.67 -r 1.103.2.68 src/prefs_common.h;  cvs diff -u -r 1.3.12.18 -r 1.3.12.19 src/message_search.c;  cvs diff -u -r 1.15.2.36 -r 1.15.2.37 src/summary_search.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/gtk/combobox.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/gtk/combobox.h;  ) > 2.6.0cvs72.patchset
index 80a4aa8..2136bc0 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=71
+EXTRA_VERSION=72
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 229aac5..5cfc379 100644 (file)
 #define MENU_RC                        "menurc"
 #define RENDERER_RC            "rendererrc"
 #define QUICKSEARCH_HISTORY    "quicksearch_history"
+#define SUMMARY_SEARCH_FROM_HISTORY    "summarysearch_from_history"
+#define SUMMARY_SEARCH_TO_HISTORY      "summarysearch_to_history"
+#define SUMMARY_SEARCH_SUBJECT_HISTORY "summarysearch_subject_history"
+#define SUMMARY_SEARCH_BODY_HISTORY    "summary_searchbody_history"
+#define SUMMARY_SEARCH_ADV_CONDITION_HISTORY   "summarysearch_adv_history"
+#define MESSAGE_SEARCH_HISTORY "messagesearch_history"
 #define TEMPLATE_DIR           "templates"
 #define TMP_DIR                        "tmp"
 #define UIDL_DIR               "uidl"
index 863ff61..517040e 100644 (file)
@@ -24,6 +24,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
+#include <utils.h>
 
 typedef struct _combobox_sel_by_data_ctx {
        GtkComboBox *combobox;
@@ -79,3 +80,27 @@ gint combobox_get_active_data(GtkComboBox *combobox)
 
        return data;
 }
+
+void combobox_unset_popdown_strings(GtkComboBox *combobox)
+{
+       GtkTreeModel *model;
+       gint count, i;
+
+       g_return_if_fail(combobox != NULL);
+
+       model = gtk_combo_box_get_model(combobox);
+       count = gtk_tree_model_iter_n_children(model, NULL);
+       for (i = 0; i < count; i++)
+               gtk_combo_box_remove_text(combobox, 0);
+}
+
+void combobox_set_popdown_strings(GtkComboBox *combobox,
+                                GList       *list)
+{
+       GList *cur;
+
+       g_return_if_fail(combobox != NULL);
+
+       for (cur = list; cur != NULL; cur = g_list_next(cur))
+               gtk_combo_box_append_text(combobox, (const gchar*) cur->data);
+}
index 13a7aa5..c3a9c18 100644 (file)
@@ -38,4 +38,8 @@ void combobox_select_by_data  (GtkComboBox            *combobox,
 
 gint combobox_get_active_data  (GtkComboBox            *combobox);
 
+void combobox_unset_popdown_strings(GtkComboBox                *combobox);
+void combobox_set_popdown_strings(GtkComboBox          *combobox,
+                                GList       *list);
+
 #endif /* __COMBOBOX_H__ */
index e7fe58a..18f44c4 100644 (file)
 #include "compose.h"
 #include "utils.h"
 #include "gtkutils.h"
+#include "combobox.h"
 #include "manage_window.h"
 #include "alertpanel.h"
 #include "manual.h"
+#include "prefs_common.h"
 
 static struct MessageSearchWindow {
        GtkWidget *window;
@@ -77,7 +79,7 @@ static void message_search_next_clicked       (GtkButton      *button,
                                         gpointer        data);
 static void message_search_stop_clicked        (GtkButton      *button,
                                         gpointer        data);
-static void body_activated             (void);
+static void body_changed               (void);
 static gboolean key_pressed            (GtkWidget      *widget,
                                         GdkEventKey    *event,
                                         gpointer        data);
@@ -181,11 +183,15 @@ static void message_search_create(void)
        gtk_widget_show (body_label);
        gtk_box_pack_start (GTK_BOX (hbox1), body_label, FALSE, FALSE, 0);
 
-       body_entry = gtk_entry_new ();
+       body_entry = gtk_combo_box_entry_new_text ();
+       gtk_combo_box_set_active(GTK_COMBO_BOX(body_entry), -1);
+       if (prefs_common.message_search_history)
+               combobox_set_popdown_strings(GTK_COMBO_BOX(body_entry),
+                               prefs_common.message_search_history);
        gtk_widget_show (body_entry);
        gtk_box_pack_start (GTK_BOX (hbox1), body_entry, TRUE, TRUE, 0);
-       g_signal_connect(G_OBJECT(body_entry), "activate",
-                        G_CALLBACK(body_activated), NULL);
+       g_signal_connect(G_OBJECT(body_entry), "changed",
+                        G_CALLBACK(body_changed), NULL);
 
        checkbtn_hbox = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (checkbtn_hbox);
@@ -262,9 +268,16 @@ static void message_search_execute(gboolean backward)
        gboolean all_searched = FALSE;
        const gchar *body_str;
 
-       body_str = gtk_entry_get_text(GTK_ENTRY(search_window.body_entry));
+       body_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
        if (*body_str == '\0') return;
 
+       /* add to history */
+       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.body_entry));
+       prefs_common.message_search_history = add_history(
+                       prefs_common.message_search_history, body_str);
+       combobox_set_popdown_strings(GTK_COMBO_BOX(search_window.body_entry),
+                       prefs_common.message_search_history);
+
        case_sens = gtk_toggle_button_get_active
                (GTK_TOGGLE_BUTTON(search_window.case_checkbtn));
 
@@ -334,6 +347,11 @@ static void message_search_execute(gboolean backward)
        message_hide_stop_button();
 }
 
+static void body_changed(void)
+{
+       gtk_widget_grab_focus(search_window.body_entry);
+}
+
 static void message_search_prev_clicked(GtkButton *button, gpointer data)
 {
        message_search_execute(TRUE);
@@ -344,11 +362,6 @@ static void message_search_next_clicked(GtkButton *button, gpointer data)
        message_search_execute(FALSE);
 }
 
-static void body_activated(void)
-{
-       gtk_button_clicked(GTK_BUTTON(search_window.next_btn));
-}
-
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
                            gpointer data)
 {
index c304b5a..95eedfa 100644 (file)
@@ -886,6 +886,18 @@ void prefs_common_read_config(void)
                prefs_common_read_history(COMMAND_HISTORY);
        prefs_common.summary_quicksearch_history =
                prefs_common_read_history(QUICKSEARCH_HISTORY);
+       prefs_common.summary_search_from_history =
+               prefs_common_read_history(SUMMARY_SEARCH_FROM_HISTORY);
+       prefs_common.summary_search_to_history =
+               prefs_common_read_history(SUMMARY_SEARCH_TO_HISTORY);
+       prefs_common.summary_search_subject_history =
+               prefs_common_read_history(SUMMARY_SEARCH_SUBJECT_HISTORY);
+       prefs_common.summary_search_body_history =
+               prefs_common_read_history(SUMMARY_SEARCH_BODY_HISTORY);
+       prefs_common.summary_search_adv_condition_history =
+               prefs_common_read_history(SUMMARY_SEARCH_ADV_CONDITION_HISTORY);
+       prefs_common.message_search_history =
+               prefs_common_read_history(MESSAGE_SEARCH_HISTORY);
 
        colorlabel_update_colortable_from_prefs();
 }
@@ -927,6 +939,18 @@ void prefs_common_write_config(void)
                prefs_common.mime_open_cmd_history);
        prefs_common_save_history(QUICKSEARCH_HISTORY, 
                prefs_common.summary_quicksearch_history);
+       prefs_common_save_history(SUMMARY_SEARCH_FROM_HISTORY, 
+               prefs_common.summary_search_from_history);
+       prefs_common_save_history(SUMMARY_SEARCH_TO_HISTORY, 
+               prefs_common.summary_search_to_history);
+       prefs_common_save_history(SUMMARY_SEARCH_SUBJECT_HISTORY, 
+               prefs_common.summary_search_subject_history);
+       prefs_common_save_history(SUMMARY_SEARCH_BODY_HISTORY, 
+               prefs_common.summary_search_body_history);
+       prefs_common_save_history(SUMMARY_SEARCH_ADV_CONDITION_HISTORY, 
+               prefs_common.summary_search_adv_condition_history);
+       prefs_common_save_history(MESSAGE_SEARCH_HISTORY, 
+               prefs_common.message_search_history);
 }
 
 /* make a copy of string 'in' into buffer 'out'. un-escape \ sequences.
index de23969..03b06cc 100644 (file)
@@ -359,6 +359,12 @@ struct _PrefsCommon
        gulong color_new;
        
        GList *summary_quicksearch_history;
+       GList *summary_search_from_history;
+       GList *summary_search_to_history;
+       GList *summary_search_subject_history;
+       GList *summary_search_body_history;
+       GList *summary_search_adv_condition_history;
+       GList *message_search_history;
 
        gint filteringwin_width;
        gint filteringwin_height;
index 3b0544c..c95c3ce 100644 (file)
@@ -50,6 +50,7 @@
 #include "menu.h"
 #include "utils.h"
 #include "gtkutils.h"
+#include "combobox.h"
 #include "prefs_gtk.h"
 #include "manage_window.h"
 #include "alertpanel.h"
@@ -57,6 +58,7 @@
 #include "matcher_parser.h"
 #include "prefs_matcher.h"
 #include "manual.h"
+#include "prefs_common.h"
 
 static struct SummarySearchWindow {
        GtkWidget *window;
@@ -107,11 +109,11 @@ static void summary_search_stop_clicked   (GtkButton      *button,
 static void adv_condition_btn_clicked  (GtkButton      *button,
                                         gpointer        data);
 
-static void from_activated             (void);
-static void to_activated               (void);
-static void subject_activated          (void);
-static void body_activated             (void);
-static void adv_condition_activated    (void);
+static void from_changed                       (void);
+static void to_changed                         (void);
+static void subject_changed                    (void);
+static void body_changed                       (void);
+static void adv_condition_changed      (void);
 
 static gboolean key_pressed            (GtkWidget      *widget,
                                         GdkEventKey    *event,
@@ -236,40 +238,60 @@ static void summary_search_create(void)
        gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
        gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
 
-       from_entry = gtk_entry_new ();
+       from_entry = gtk_combo_box_entry_new_text ();
+       gtk_combo_box_set_active(GTK_COMBO_BOX(from_entry), -1);
+       if (prefs_common.summary_search_from_history)
+               combobox_set_popdown_strings(GTK_COMBO_BOX(from_entry),
+                               prefs_common.summary_search_from_history);
        gtk_widget_show (from_entry);
        gtk_table_attach (GTK_TABLE (table1), from_entry, 1, 3, 0, 1,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
-       g_signal_connect(G_OBJECT(from_entry), "activate",
-                        G_CALLBACK(from_activated), NULL);
-
-       to_entry = gtk_entry_new ();
+       g_signal_connect(G_OBJECT(from_entry), "changed",
+                        G_CALLBACK(from_changed), NULL);
+
+       to_entry = gtk_combo_box_entry_new_text ();
+       gtk_combo_box_set_active(GTK_COMBO_BOX(to_entry), -1);
+       if (prefs_common.summary_search_to_history)
+               combobox_set_popdown_strings(GTK_COMBO_BOX(to_entry),
+                               prefs_common.summary_search_to_history);
        gtk_widget_show (to_entry);
        gtk_table_attach (GTK_TABLE (table1), to_entry, 1, 3, 1, 2,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
-       g_signal_connect(G_OBJECT(to_entry), "activate",
-                        G_CALLBACK(to_activated), NULL);
-
-       subject_entry = gtk_entry_new ();
+       g_signal_connect(G_OBJECT(from_entry), "changed",
+                        G_CALLBACK(from_changed), NULL);
+
+       subject_entry = gtk_combo_box_entry_new_text ();
+       gtk_combo_box_set_active(GTK_COMBO_BOX(subject_entry), -1);
+       if (prefs_common.summary_search_subject_history)
+               combobox_set_popdown_strings(GTK_COMBO_BOX(subject_entry),
+                               prefs_common.summary_search_subject_history);
        gtk_widget_show (subject_entry);
        gtk_table_attach (GTK_TABLE (table1), subject_entry, 1, 3, 2, 3,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
-       g_signal_connect(G_OBJECT(subject_entry), "activate",
-                        G_CALLBACK(subject_activated), NULL);
-
-       body_entry = gtk_entry_new ();
+       g_signal_connect(G_OBJECT(from_entry), "changed",
+                        G_CALLBACK(from_changed), NULL);
+
+       body_entry = gtk_combo_box_entry_new_text ();
+       gtk_combo_box_set_active(GTK_COMBO_BOX(body_entry), -1);
+       if (prefs_common.summary_search_body_history)
+               combobox_set_popdown_strings(GTK_COMBO_BOX(body_entry),
+                               prefs_common.summary_search_body_history);
        gtk_widget_show (body_entry);
        gtk_table_attach (GTK_TABLE (table1), body_entry, 1, 3, 3, 4,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
-       g_signal_connect(G_OBJECT(body_entry), "activate",
-                        G_CALLBACK(body_activated), NULL);
-
-       adv_condition_entry = gtk_entry_new ();
+       g_signal_connect(G_OBJECT(from_entry), "changed",
+                        G_CALLBACK(from_changed), NULL);
+
+       adv_condition_entry = gtk_combo_box_entry_new_text ();
+       gtk_combo_box_set_active(GTK_COMBO_BOX(adv_condition_entry), -1);
+       if (prefs_common.summary_search_adv_condition_history)
+               combobox_set_popdown_strings(GTK_COMBO_BOX(adv_condition_entry),
+                               prefs_common.summary_search_adv_condition_history);
        gtk_widget_show (adv_condition_entry);
        gtk_table_attach (GTK_TABLE (table1), adv_condition_entry, 1, 2, 4, 5,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
-       g_signal_connect(G_OBJECT(adv_condition_entry), "activate",
-                        G_CALLBACK(adv_condition_activated), NULL);
+       g_signal_connect(G_OBJECT(from_entry), "changed",
+                        G_CALLBACK(from_changed), NULL);
 
        adv_condition_btn = gtk_button_new_with_label(" ... ");
        gtk_widget_show (adv_condition_btn);
@@ -448,8 +470,16 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                        matcherlist_free(search_window.matcher_list);
                        search_window.matcher_list = NULL;
                }
-               adv_condition = gtk_entry_get_text(GTK_ENTRY(search_window.adv_condition_entry));
+               adv_condition = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
                if (adv_condition[0] != '\0') {
+
+                       /* add to history */
+                       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.adv_condition_entry));
+                       prefs_common.summary_search_adv_condition_history = add_history(
+                                       prefs_common.summary_search_adv_condition_history, adv_condition);
+                       combobox_set_popdown_strings(GTK_COMBO_BOX(search_window.adv_condition_entry),
+                                       prefs_common.summary_search_adv_condition_history);
+
                        search_window.matcher_list = matcher_parser_get_cond((gchar*)adv_condition, &is_fast);
                        if (!is_fast)
                                interval = 100;
@@ -473,10 +503,10 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                        str_find_func = str_case_find;
                }
 
-               from_str    = gtk_entry_get_text(GTK_ENTRY(search_window.from_entry));
-               to_str      = gtk_entry_get_text(GTK_ENTRY(search_window.to_entry));
-               subject_str = gtk_entry_get_text(GTK_ENTRY(search_window.subject_entry));
-               body_str    = gtk_entry_get_text(GTK_ENTRY(search_window.body_entry));
+               from_str    = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.from_entry));
+               to_str      = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.to_entry));
+               subject_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.subject_entry));
+               body_str    = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
 
                if (    (from_str[0] == '\0') &&
                                (to_str[0] == '\0') &&
@@ -487,6 +517,32 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                        summary_unlock(summaryview);
                        return;
                }
+
+               /* add to history */
+               if (from_str[0] != '\0')
+                       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.from_entry));
+                       prefs_common.summary_search_from_history = add_history(
+                                       prefs_common.summary_search_from_history, from_str);
+                       combobox_set_popdown_strings(GTK_COMBO_BOX(search_window.from_entry),
+                                       prefs_common.summary_search_from_history);
+               if (to_str[0] != '\0')
+                       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.to_entry));
+                       prefs_common.summary_search_to_history = add_history(
+                                       prefs_common.summary_search_to_history, to_str);
+                       combobox_set_popdown_strings(GTK_COMBO_BOX(search_window.to_entry),
+                                       prefs_common.summary_search_to_history);
+               if (subject_str[0] != '\0')
+                       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.subject_entry));
+                       prefs_common.summary_search_subject_history = add_history(
+                                       prefs_common.summary_search_subject_history, subject_str);
+                       combobox_set_popdown_strings(GTK_COMBO_BOX(search_window.subject_entry),
+                                       prefs_common.summary_search_subject_history);
+               if (body_str[0] != '\0')
+                       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.body_entry));
+                       prefs_common.summary_search_body_history = add_history(
+                                       prefs_common.summary_search_body_history, body_str);
+                       combobox_set_popdown_strings(GTK_COMBO_BOX(search_window.body_entry),
+                                       prefs_common.summary_search_body_history);
        }
 
        search_window.is_searching = TRUE;
@@ -670,17 +726,12 @@ static void summary_search_clear(GtkButton *button, gpointer data)
 {
        if (gtk_toggle_button_get_active
                (GTK_TOGGLE_BUTTON(search_window.adv_search_checkbtn))) {
-               gtk_editable_delete_text(GTK_EDITABLE(search_window.adv_condition_entry),
-                                        0, -1);
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(search_window.adv_condition_entry)->child), "");
        } else {
-               gtk_editable_delete_text(GTK_EDITABLE(search_window.from_entry),
-                                        0, -1);
-               gtk_editable_delete_text(GTK_EDITABLE(search_window.to_entry),
-                                        0, -1);
-               gtk_editable_delete_text(GTK_EDITABLE(search_window.subject_entry),
-                                        0, -1);
-               gtk_editable_delete_text(GTK_EDITABLE(search_window.body_entry),
-                                        0, -1);
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(search_window.from_entry)->child), "");
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(search_window.to_entry)->child), "");
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(search_window.subject_entry)->child), "");
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(search_window.body_entry)->child), "");
        }
        /* stop searching */
        if (search_window.is_searching) {
@@ -717,8 +768,7 @@ static void adv_condition_btn_done(MatcherList * matchers)
        str = matcherlist_to_string(matchers);
 
        if (str != NULL) {
-               gtk_entry_set_text(
-                       GTK_ENTRY(search_window.adv_condition_entry), str);
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(search_window.adv_condition_entry)->child), str);
                g_free(str);
        }
 }
@@ -735,10 +785,9 @@ static void adv_condition_btn_clicked(GtkButton *button, gpointer data)
 
        g_return_if_fail( search_window.window != NULL );
 
-       /* re-use it the current quicksearch value if it's a condition expression,
+       /* re-use the current search value if it's a condition expression,
           otherwise ignore it silently */
-       cond_str = gtk_entry_get_text(
-                       GTK_ENTRY(search_window.adv_condition_entry));
+       cond_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
        if (*cond_str != '\0') {
                matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
        }
@@ -750,29 +799,29 @@ static void adv_condition_btn_clicked(GtkButton *button, gpointer data)
        }
 };
 
-static void from_activated(void)
+static void from_changed(void)
 {
-       gtk_widget_grab_focus(search_window.to_entry);
+       gtk_widget_grab_focus(search_window.from_entry);
 }
 
-static void to_activated(void)
+static void to_changed(void)
 {
-       gtk_widget_grab_focus(search_window.subject_entry);
+       gtk_widget_grab_focus(search_window.to_entry);
 }
 
-static void subject_activated(void)
+static void subject_changed(void)
 {
-       gtk_button_clicked(GTK_BUTTON(search_window.next_btn));
+       gtk_widget_grab_focus(search_window.subject_entry);
 }
 
-static void body_activated(void)
+static void body_changed(void)
 {
-       gtk_button_clicked(GTK_BUTTON(search_window.next_btn));
+       gtk_widget_grab_focus(search_window.body_entry);
 }
 
-static void adv_condition_activated(void)
+static void adv_condition_changed(void)
 {
-       gtk_button_clicked(GTK_BUTTON(search_window.next_btn));
+       gtk_widget_grab_focus(search_window.adv_condition_entry);
 }
 
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,