static int gui_input_asksearch ( void   )  [static]

Ask the user to enter a new search string.

Definition at line 182 of file gui_input.c.

00183 {
00184         char *str;
00185         const char *old = NULL;
00186         struct vfsmatch *vm;
00187 
00188         /* Show the previous value if we have one */
00189         if (cursearch != NULL)
00190                 old = vfs_match_value(cursearch);
00191 
00192         /* Allow the user to enter a search string */
00193         str = gui_input_askstring(_("Search for"), old, NULL);
00194         if (str == NULL)
00195                 return (-1);
00196         
00197         vm = vfs_match_new(str);
00198         if (vm == NULL) {
00199                 gui_msgbar_warn(_("Bad pattern."));
00200                 g_free(str);
00201                 return (-1);
00202         }
00203 
00204         /* Replace our search string */
00205         if (cursearch != NULL)
00206                 vfs_match_free(cursearch);
00207         cursearch = vm;
00208 
00209         str = g_strdup_printf(_("Searching for \"%s\"..."),
00210             vfs_match_value(vm));
00211         gui_msgbar_warn(str);
00212         g_free(str);
00213 
00214         return (0);
00215 }

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Defines
Generated on Mon Mar 15 04:45:15 2010 for herrie by  doxygen 1.6.3