Re: [PATCH] Find file non-recursively

2005-02-03 Thread Andrew Borodin
On Wed, 2 Feb 2005 23:27:20 +0500 Pavel S. Shirshov wrote:
 Hello Andrew,
 
 Wednesday, February 2, 2005, 8:42:11 PM, you wrote:
 
 AVS Hello, Andrew and Pavel!
 
 AVS I think 2+ years is quite for this patch to be commited to current ;-)

Andrew, you remembered my really old patch :-). Thank you!

 
 Commited. Thx

I propose a small fix to Andrew's patch.

-static char *recurs_label = N_(find Recursively);
+static char *recurs_label = N_(find reCursively);

Regards,
Andrew.
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH] Find file non-recursively

2005-02-02 Thread Andrew V. Samoilov
Hello, Andrew and Pavel!

I think 2+ years is quite for this patch to be commited to current ;-)

-- 
Regards,
Andrew V. Samoilov


GET INTERNET ACCESS FROM BCS! http://www.bcs.zp.ua
Join BCS today! For your FREE webmail, visit: http://email.zp.ua/
src/ChangeLog

* find.c: Implement non-recursive 'Find file' feature.
Original patch by Andrew Borodin [EMAIL PROTECTED] .

--- src/find.c  Tue Dec 14 09:29:47 2004
+++ src/find.c  Wed Jan 19 20:47:27 2005
@@ -44,7 +44,7 @@
 #include key.h
 
 /* Size of the find parameters window */
-#define FIND_Y 15
+#define FIND_Y 16
 static int FIND_X = 50;
 
 /* Size of the find window */
@@ -139,6 +139,7 @@ static regex_t *r; /* Pointer to compile
  
 static int case_sensitive = 1;
 static gboolean find_regex_flag = TRUE;
+static int find_recursively = 1;
 
 /*
  * Callback for the parameter dialog.
@@ -191,6 +192,9 @@ find_parameters (char **start_dir, char 
 int return_value;
 char *temp_dir;
 static const char *case_label = N_(case Sensitive);
+static char *recurs_label = N_(find Recursively);
+
+WCheck *recursively_cbox;
 
 static char *in_contents = NULL;
 static char *in_start_dir = NULL;
@@ -233,6 +237,7 @@ find_parameters (char **start_dir, char 
 
i18n_flag = 1;
case_label = _(case_label);
+   recurs_label = _(recurs_label);
 }
 #endif /* ENABLE_NLS */
 
@@ -250,12 +255,16 @@ find_parameters (char **start_dir, char 
DLG_CENTER | DLG_REVERSE);
 
 add_widget (find_dlg,
-   button_new (12, b2, B_CANCEL, NORMAL_BUTTON, buts[2], 0));
+   button_new (13, b2, B_CANCEL, NORMAL_BUTTON, buts[2], 0));
 add_widget (find_dlg,
-   button_new (12, b1, B_TREE, NORMAL_BUTTON, buts[1], 0));
+   button_new (13, b1, B_TREE, NORMAL_BUTTON, buts[1], 0));
 add_widget (find_dlg,
-   button_new (12, b0, B_ENTER, DEFPUSH_BUTTON, buts[0], 0));
+   button_new (13, b0, B_ENTER, DEFPUSH_BUTTON, buts[0], 0));
 
+recursively_cbox =
+   check_new (11, 3, find_recursively, recurs_label);
+ add_widget (find_dlg, recursively_cbox);
+ 
 find_regex_cbox = check_new (10, 3, find_regex_flag, _(Regular 
expression));
 add_widget (find_dlg, find_regex_cbox);
 
@@ -291,6 +300,7 @@ find_parameters (char **start_dir, char 
temp_dir = g_strdup (in_start-buffer);
case_sensitive = case_sense-state  C_BOOL;
find_regex_flag = find_regex_cbox-state  C_BOOL;
+   find_recursively = recursively_cbox-state  C_BOOL;
destroy_dlg (find_dlg);
g_free (in_start_dir);
if (strcmp (temp_dir, .) == 0) {
@@ -318,6 +328,7 @@ find_parameters (char **start_dir, char 
 
case_sensitive = case_sense-state  C_BOOL;
find_regex_flag = find_regex_cbox-state  C_BOOL;
+   find_recursively = recursively_cbox-state  C_BOOL;
return_value = 1;
*start_dir = g_strdup (in_start-buffer);
*pattern = g_strdup (in_name-buffer);
@@ -674,7 +685,7 @@ do_search (struct Dlg_head *h)
return 1;
 }
 
-if (subdirs_left  directory) { /* Can directory be NULL ? */
+if (subdirs_left  find_recursively  directory) { /* Can directory be 
NULL ? */
char *tmp_name = concat_dir_and_file (directory, dp-d_name);
if (!mc_lstat (tmp_name, tmp_stat)
 S_ISDIR (tmp_stat.st_mode)) {
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH] Find file non-recursively

2005-02-02 Thread wwp
Hello Andrew,


On Wed, 2 Feb 2005 17:42:11 +0200 (EET) Andrew V. Samoilov
[EMAIL PROTECTED] wrote:

 Hello, Andrew and Pavel!
 
 I think 2+ years is quite for this patch to be commited to current ;-)

Ah yes!
 

Regards,

-- 
wwp
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re[2]: [PATCH] Find file non-recursively

2005-02-02 Thread Pavel S. Shirshov
Hello Andrew,

Wednesday, February 2, 2005, 8:42:11 PM, you wrote:

AVS Hello, Andrew and Pavel!

AVS I think 2+ years is quite for this patch to be commited to current ;-)


Commited. Thx

-- 
Best regards,
 Pavelmailto:[EMAIL PROTECTED]

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH] Find file non-recursively

2002-12-02 Thread David Sterba
Hi,

   MC finds files in specified directory and in it's all subdirecories.
 I made a small patch that allows to choose how the files find: recursively
 (as usually) or not (new behaviour). The new checkbox find recursively is added in 
File find dialog. The only find.c file is changed.
 
   Some times I need this feature, and I hope it will be useful for others.

I would appreciate to be able to set more find options, not only 
recursive/non-recursive. For example:
- regex filename matching
- minimum/maximum recursion depth
- date/time 
- (xdev) no cross device search

Maybe other (man find :-).
I think, these are used more frequently than others.
Maybe I try to implement them.


bye,
Dave

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



[PATCH] Find file non-recursively

2002-12-01 Thread Andrew Borodin

  Hi!

  MC finds files in specified directory and in it's all subdirecories.
I made a small patch that allows to choose how the files find: recursively
(as usually) or not (new behaviour). The new checkbox find recursively is added in 
File find dialog. The only find.c file is changed.

  Some times I need this feature, and I hope it will be useful for others.

  Regards,
  Andrew Borodin.



mc-find-non-recurs.patch.gz
Description: application/gzip