add Clear button to the quicksearch bar
authorColin Leroy <colin@colino.net>
Tue, 6 Jul 2004 16:45:16 +0000 (16:45 +0000)
committerColin Leroy <colin@colino.net>
Tue, 6 Jul 2004 16:45:16 +0000 (16:45 +0000)
add a tool to help with cvs

ChangeLog-gtk2.claws
PATCHSETS [new file with mode: 0644]
commitHelper [new file with mode: 0644]
configure.ac
src/gtk/quicksearch.c

index 3f14c30..e2b5a02 100644 (file)
@@ -1,3 +1,11 @@
+2004-07-06 [colin]     0.9.11cvs17.9
+
+       * src/gtk/quicksearch.c [1.1.2.3]
+               Add a Clear button
+       * commitHelper
+       * PATCHSETS
+               Add a script to help with cvs
+
 2004-07-03 [colin]     0.9.11cvs17.8
 
        * src/plugins/imageviewer/viewer.c
diff --git a/PATCHSETS b/PATCHSETS
new file mode 100644 (file)
index 0000000..6523eac
--- /dev/null
+++ b/PATCHSETS
@@ -0,0 +1 @@
+( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/gtk/quicksearch.c; ) > 0.9.11cvs17.9.patchset
diff --git a/commitHelper b/commitHelper
new file mode 100644 (file)
index 0000000..b46bfd8
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+head -15 configure.ac | grep VERSION > /tmp/commitTool.tmp
+source /tmp/commitTool.tmp
+EXTRA_VERSION=`echo $EXTRA_VERSION | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
+nextsversion="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}"
+rm /tmp/commitTool.tmp
+
+IFS='
+'
+filelist=`cvs status $@ 2>/dev/null |grep ^File`
+
+for file in $filelist; do
+       merge=`echo $file | grep Merge`
+       modif=`echo $file | grep Locally`
+
+       if [ "$merge" != "" ]; then
+               echo $merge
+               echo You have to update first
+               exit
+       fi;
+       if [ "$modif" != "" ]; then
+               echo $modif
+       fi;
+done;
+patchset="("
+log=""
+files=`cvs diff -u $@ 2>/dev/null |grep ^Index`
+echo "--8<----------"
+log="`date +%Y-%m-%d` [`whoami`]\t$nextsversion\n\n"
+for line in $files; do
+       file=`echo $line | cut -d' ' -f2`
+       dir=`dirname $file`
+       filename=`basename $file`
+       cvsfile="$dir/CVS/Entries"
+       version=`grep $filename $cvsfile | cut -d'/' -f3`
+       nextversion=`echo $version | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
+       
+       log="$log\t* $file [$nextversion]\n"
+       patchset="$patchset cvs diff -u -r $version -r $nextversion $file;\
+"
+done;
+patchset="$patchset ) > $nextsversion.patchset"
+log="$log\n"
+echo -e -n $log
+echo "--8<----------"
+if [ -f ChangeLog-gtk2.claws ]; then
+       chlog="ChangeLog-gtk2.claws"
+else
+       chlog="ChangeLog.claws"
+fi
+echo -n "Is it ok (write to $chlog) [y/N]?"
+read ans
+if [ "$ans" == "y" ]; then
+       mv $chlog $chlog.old
+       echo -e -n $log > $chlog
+       cat $chlog.old >> $chlog
+       rm $chlog.old
+       echo "$patchset" >> PATCHSETS
+fi
index 1e493f8..5103bfd 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=17.8
+EXTRA_VERSION=17.9
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 8a88bca..ccafb26 100644 (file)
@@ -202,6 +202,15 @@ static void search_description_cb(GtkWidget *widget)
        description_window_create(&search_descr);
 };
 
+static gboolean clear_search_cb(GtkMenuItem *widget, gpointer data)
+{
+       QuickSearch *quicksearch = (QuickSearch *)data;
+       
+       quicksearch_set(quicksearch, prefs_common.summary_quicksearch_type, "");
+       
+       return TRUE;
+};
+
 /*
 static void summary_searchbar_focus_evt(GtkWidget *widget, GdkEventFocus *event,
                                        SummaryView *summaryview)
@@ -227,6 +236,7 @@ QuickSearch *quicksearch_new()
        GtkWidget *search_string_entry;
        GtkWidget *search_hbbox;
        GtkWidget *search_description;
+       GtkWidget *clear_search;
        GtkWidget *menuitem;
 
        quicksearch = g_new0(QuickSearch, 1);
@@ -271,14 +281,32 @@ QuickSearch *quicksearch_new()
                        prefs_common.summary_quicksearch_history);
        gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(search_string_entry)->entry), "");
        gtk_widget_show(search_string_entry);
+
+       search_hbbox = gtk_hbutton_box_new();
+       gtk_button_box_set_layout(GTK_BUTTON_BOX(search_hbbox),         
+                                 GTK_BUTTONBOX_START);
+
+       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);
+
+       search_description = gtk_button_new_with_label(_("Extended Symbols"));
+       gtk_box_pack_start(GTK_BOX(search_hbbox), search_description,
+                          TRUE, TRUE, 0);
+       gtk_widget_show(search_description);
                
-       gtkut_button_set_create(&search_hbbox, &search_description, _("Extended Symbols"),
-                               NULL, NULL, NULL, NULL);
        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), 
                           "key_press_event",
                           GTK_SIGNAL_FUNC(searchbar_pressed),