Package: gnucash
Version: 2.0.5-1
Severity: wishlist

Despite dealing with only a small number of customers, it is still
necessary to search for them in any customer-selection dialogue. In
these cases it would be much faster to browse a complete list, so:

 * If only a few customers are defined, list them all by default.

   A long term solution could be to have the list populated immediately
   but allow the process to be interrupted when search terms are
   entered. This could also have the advantage of rendering the 'Find'
   button moot.

 * Do not *require* search terms to be entered before performing the
   search.

I have a rather cheesy patch to do the latter but the former will, of
course, need more work. Gnucash is currently compiling so I have no idea
whether or not it actually works yet.

Matthew

-- 
I must take issue with the term "a mere child", for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz
--- ./src/gnome-search/search-string.c~	2007-02-19 03:40:09.000000000 +0000
+++ ./src/gnome-search/search-string.c	2007-03-09 00:28:59.711276958 +0000
@@ -173,18 +173,18 @@
   g_return_val_if_fail (fi, FALSE);
   g_return_val_if_fail (IS_GNCSEARCH_STRING (fi), FALSE);
 	
-  if (!fi->value || *(fi->value) == '\0') {
-    GtkWidget *dialog;
-    dialog = gtk_message_dialog_new (NULL,
-				     GTK_DIALOG_MODAL,
-				     GTK_MESSAGE_ERROR,
-				     GTK_BUTTONS_OK,
-				     "%s",
-				     _("You need to enter a string value"));
-    gtk_dialog_run (GTK_DIALOG (dialog));
-    gtk_widget_destroy(dialog);
-    return FALSE;
-  }
+/*   if (!fi->value || *(fi->value) == '\0') { */
+/*     GtkWidget *dialog; */
+/*     dialog = gtk_message_dialog_new (NULL, */
+/* 				     GTK_DIALOG_MODAL, */
+/* 				     GTK_MESSAGE_ERROR, */
+/* 				     GTK_BUTTONS_OK, */
+/* 				     "%s", */
+/* 				     _("You need to enter a string value")); */
+/*     gtk_dialog_run (GTK_DIALOG (dialog)); */
+/*     gtk_widget_destroy(dialog); */
+/*     return FALSE; */
+/*   } */
 
   if (fi->how == SEARCH_STRING_MATCHES_REGEX ||
       fi->how == SEARCH_STRING_NOT_MATCHES_REGEX) {
@@ -195,7 +195,9 @@
     if (fi->ign_case)
       flags |= REG_ICASE;
 
-    regerr = regcomp (&regexpat, fi->value, flags);
+    regerr = regcomp (&regexpat, 
+		      ((fi->value || *(fi->value)) ? fi->value : "."),
+		      flags);
     if (regerr) {
       GtkWidget *dialog;
       gchar *regmsg, *errmsg;
@@ -208,7 +210,8 @@
       regerror (regerr, &regexpat, regmsg, reglen);
 			
       errmsg = g_strdup_printf (_("Error in regular expression '%s':\n%s"),
-				fi->value, regmsg);
+				((fi->value || *(fi->value)) ? fi->value : "."),
+				regmsg);
       g_free (regmsg);
 			
       dialog = gtk_message_dialog_new (NULL,

Reply via email to