sync sticky pref with HEAD
authorColin Leroy <colin@colino.net>
Thu, 8 Jul 2004 09:48:55 +0000 (09:48 +0000)
committerColin Leroy <colin@colino.net>
Thu, 8 Jul 2004 09:48:55 +0000 (09:48 +0000)
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/gtk/quicksearch.c
src/gtk/quicksearch.h
src/prefs_common.c
src/prefs_common.h
src/summaryview.c

index dd330d3..e9414be 100644 (file)
@@ -1,3 +1,12 @@
+2004-07-08 [colin]     0.9.11cvs17.11
+
+       * src/summaryview.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/gtk/quicksearch.c
+       * src/gtk/quicksearch.h
+               Sync sticky pref with HEAD
+
 2004-07-08 [colin]     0.9.11cvs17.10
 
        * src/folder.c [1.213.2.6]
index 6523eac..9d95308 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -1 +1,7 @@
 ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/gtk/quicksearch.c; ) > 0.9.11cvs17.9.patchset
+( cvs diff -u -r 1.3.4.1
+1.1.4.1
+1.213.2.5 -r 1.3.4.1 1.1.4.1 1.213.2.6 src/folder.c; cvs diff -u -r 1.2.4.1
+1.1.4.1
+1.87.2.5 -r 1.2.4.1 1.1.4.1 1.87.2.6 src/folder.h; cvs diff -u -r 1.149.2.6 -r 1.149.2.7 src/inc.c; cvs diff -u -r 1.94.2.7 -r 1.94.2.8 src/messageview.c; cvs diff -u -r 1.47.2.5 -r 1.47.2.6 src/procheader.c; cvs diff -u -r 1.150.2.3 -r 1.150.2.4 src/procmsg.c; cvs diff -u -r 1.60.2.4 -r 1.60.2.5 src/procmsg.h; ) > 0.9.11cvs17.10.patchset
+( cvs diff -u -r 1.395.2.15 -r 1.395.2.16 src/summaryview.c; cvs diff -u -r 1.204.2.11 -r 1.204.2.12 src/prefs_common.c; cvs diff -u -r 1.103.2.5 -r 1.103.2.6 src/prefs_common.h; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/gtk/quicksearch.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/gtk/quicksearch.h; ) > 0.9.11cvs17.11.patchset
index 40fce27..195d801 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=17.10
+EXTRA_VERSION=17.11
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index ccafb26..0a47a23 100644 (file)
@@ -47,8 +47,11 @@ struct _QuickSearch
 
        QuickSearchExecuteCallback       callback;
        gpointer                         callback_data;
+       gboolean                         running;
 };
 
+static void quicksearch_set_running(QuickSearch *quicksearch, gboolean run);
+
 static void prepare_matcher(QuickSearch *quicksearch)
 {
        const gchar *search_string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(quicksearch->search_string_entry)->entry));
@@ -103,6 +106,14 @@ static void update_extended_button (QuickSearch *quicksearch)
 static gboolean searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
                                  QuickSearch *quicksearch)
 {
+       if (event != NULL && event->keyval == GDK_Escape) {
+               quicksearch_set(quicksearch, 
+                       prefs_common.summary_quicksearch_type, "");
+               gtk_widget_grab_focus(GTK_WIDGET(GTK_COMBO(
+                       quicksearch->search_string_entry)->entry));
+               return TRUE;
+       }
+       
        if (event != NULL && event->keyval == GDK_Return) {
                const gchar *search_string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(quicksearch->search_string_entry)->entry));
 
@@ -116,9 +127,13 @@ static gboolean searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
 
                prepare_matcher(quicksearch);
 
+               quicksearch_set_running(quicksearch, TRUE);
                if (quicksearch->callback != NULL)
                        quicksearch->callback(quicksearch, quicksearch->callback_data);
+               quicksearch_set_running(quicksearch, FALSE);
                g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event");
+               gtk_widget_grab_focus(GTK_WIDGET(GTK_COMBO(
+                       quicksearch->search_string_entry)->entry));
                return TRUE;
        }
 
@@ -288,12 +303,15 @@ QuickSearch *quicksearch_new()
 
        gtk_box_set_spacing(GTK_BOX(search_hbbox), 5);
                
-       clear_search = gtk_button_new_with_label(_("Clear"));
-       gtk_box_pack_start(GTK_BOX(search_hbbox), clear_search, 
-                          TRUE, TRUE, 0);
-       gtk_widget_set_size_request(clear_search, 120, -1);
-       
-       gtk_widget_show(clear_search);
+       if (prefs_common.summary_quicksearch_sticky) {
+               clear_search = gtk_button_new_with_label(_("Clear"));
+               gtk_box_pack_start(GTK_BOX(search_hbbox), clear_search,
+                                  FALSE, FALSE, 0);
+               gtk_widget_set_usize(clear_search, 120, -1);
+               g_signal_connect(G_OBJECT(clear_search), "clicked",
+                                  GTK_SIGNAL_FUNC(clear_search_cb), quicksearch);
+               gtk_widget_show(clear_search);
+       }
 
        search_description = gtk_button_new_with_label(_("Extended Symbols"));
        gtk_box_pack_start(GTK_BOX(search_hbbox), search_description,
@@ -302,14 +320,13 @@ QuickSearch *quicksearch_new()
                
        g_signal_connect(G_OBJECT(search_description), "clicked",
                         G_CALLBACK(search_description_cb), NULL);
-       g_signal_connect(G_OBJECT(clear_search), "clicked",
-                        G_CALLBACK(clear_search_cb), quicksearch);
+
        gtk_box_pack_start(GTK_BOX(hbox_search), search_hbbox, FALSE, FALSE, 2);                                
        gtk_widget_show(search_hbbox);
        
-       gtk_signal_connect(GTK_OBJECT(GTK_COMBO(search_string_entry)->entry), 
+       g_signal_connect(G_OBJECT(GTK_COMBO(search_string_entry)->entry), 
                           "key_press_event",
-                          GTK_SIGNAL_FUNC(searchbar_pressed),
+                          G_CALLBACK(searchbar_pressed),
                           quicksearch);
 
        /*
@@ -331,7 +348,8 @@ QuickSearch *quicksearch_new()
        quicksearch->search_description = search_description;
        quicksearch->matcher_list = NULL;
        quicksearch->active = FALSE;
-
+       quicksearch->running = FALSE;
+       
        update_extended_button(quicksearch);
        
        return quicksearch;
@@ -366,8 +384,10 @@ void quicksearch_set(QuickSearch *quicksearch, QuickSearchType type,
 
        prepare_matcher(quicksearch);
 
+       quicksearch_set_running(quicksearch, TRUE);
        if (quicksearch->callback != NULL)
                quicksearch->callback(quicksearch, quicksearch->callback_data); 
+       quicksearch_set_running(quicksearch, FALSE);
 }
 
 gboolean quicksearch_is_active(QuickSearch *quicksearch)
@@ -415,3 +435,13 @@ gboolean quicksearch_match(QuickSearch *quicksearch, MsgInfo *msginfo)
 
        return FALSE;
 }
+
+static void quicksearch_set_running(QuickSearch *quicksearch, gboolean run)
+{
+       quicksearch->running = run;
+}
+
+gboolean quicksearch_is_running(QuickSearch *quicksearch) 
+{
+       return quicksearch->running;
+}
index 81ba739..b5ed8ea 100644 (file)
@@ -43,5 +43,5 @@ void quicksearch_set_execute_callback(QuickSearch *quicksearch,
                                      QuickSearchExecuteCallback callback,
                                      gpointer data);
 gboolean quicksearch_match(QuickSearch *quicksearch, MsgInfo *msginfo);
-
+gboolean quicksearch_is_running(QuickSearch *quicksearch);
 #endif /* QUICKSEARCH_H */
index 51a90f9..a6f2c39 100644 (file)
@@ -759,6 +759,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"summary_quicksearch_type", "0", &prefs_common.summary_quicksearch_type, P_INT,
         NULL, NULL, NULL},
+       {"summary_quicksearch_sticky", "1", &prefs_common.summary_quicksearch_sticky, P_INT,
+        NULL, NULL, NULL},
 
        {"io_timeout_secs", "60", &prefs_common.io_timeout_secs,
         P_INT, &other.spinbtn_iotimeout,
index 54ad20b..7b31bfe 100644 (file)
@@ -300,6 +300,7 @@ struct _PrefsCommon
        gboolean work_offline;
        
        gint summary_quicksearch_type;
+       gint summary_quicksearch_sticky;
        gulong color_new;
        
        GList *summary_quicksearch_history;
index b05bcc2..f86e581 100644 (file)
@@ -798,6 +798,11 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
        inc_lock();
        summary_lock(summaryview);
 
+       if (!prefs_common.summary_quicksearch_sticky
+        && !quicksearch_is_running(summaryview->quicksearch)) {
+               quicksearch_set(summaryview->quicksearch, prefs_common.summary_quicksearch_type, "");
+       }
+
        /* STATUSBAR_POP(summaryview->mainwin); */
 
        is_refresh = (item == summaryview->folder_item) ? TRUE : FALSE;