mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 04:22:34 +03:00
Merge branch '132_search_skip_hidden'
This commit is contained in:
commit
97a7b214ac
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
|
||||||
|
2009-02-21 Mikhail Pobolovets <styx.mp@gmail.com>
|
||||||
|
* src/find.c: 'Skip .hidden files and dirs' renamed to 'Skip hidden'
|
||||||
|
Check box position has been changed. (#132)
|
||||||
|
* po/ru.po: translation update for 'Skip hidden'.
|
||||||
|
|
||||||
|
2009-02-20 Mikhail Pobolovets <styx.mp@gmail.com>
|
||||||
|
* src/find.c: 'Skip .hidden files and dirs' has been introduced.
|
||||||
|
An option to toggle on|off searching for|in hidden directories
|
||||||
|
and files. (#132)
|
||||||
|
|
||||||
2009-02-19 Andrew Borodin <aborodin@vmail.ru>
|
2009-02-19 Andrew Borodin <aborodin@vmail.ru>
|
||||||
* src/screen.c: reimplemented displaying size of total marked files.
|
* src/screen.c: reimplemented displaying size of total marked files.
|
||||||
If mini-status is on, total size is displayed on mini_info_separator.
|
If mini-status is on, total size is displayed on mini_info_separator.
|
||||||
|
43
po/ru.po
43
po/ru.po
@ -15,8 +15,8 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: ru\n"
|
"Project-Id-Version: ru\n"
|
||||||
"Report-Msgid-Bugs-To: mc-devel@gnome.org\n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2009-01-06 13:46+0200\n"
|
"POT-Creation-Date: 2009-02-21 16:44+0200\n"
|
||||||
"PO-Revision-Date: 2005-09-09 14:37+0300\n"
|
"PO-Revision-Date: 2005-09-09 14:37+0300\n"
|
||||||
"Last-Translator: Anton S. Chumak <nightfast@yahoo.co.uk>\n"
|
"Last-Translator: Anton S. Chumak <nightfast@yahoo.co.uk>\n"
|
||||||
"Language-Team: Russian ru@li.org\n"
|
"Language-Team: Russian ru@li.org\n"
|
||||||
@ -66,9 +66,6 @@ msgstr "
|
|||||||
msgid "Macro recursion is too deep"
|
msgid "Macro recursion is too deep"
|
||||||
msgstr "óÌÉÛËÏÍ ÇÌÕÂÏËÁÑ ÒÅËÕÒÓÉÑ ÍÁËÒÏÓÏ×"
|
msgstr "óÌÉÛËÏÍ ÇÌÕÂÏËÁÑ ÒÅËÕÒÓÉÑ ÍÁËÒÏÓÏ×"
|
||||||
|
|
||||||
msgid " Enter file name: "
|
|
||||||
msgstr " ÷×ÅÄÉÔÅ ÉÍÑ ÆÁÊÌÁ: "
|
|
||||||
|
|
||||||
msgid "Warning"
|
msgid "Warning"
|
||||||
msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ"
|
msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ"
|
||||||
|
|
||||||
@ -114,6 +111,9 @@ msgstr "
|
|||||||
msgid " Save As "
|
msgid " Save As "
|
||||||
msgstr " óÏÈÒÁÎÉÔØ ËÁË "
|
msgstr " óÏÈÒÁÎÉÔØ ËÁË "
|
||||||
|
|
||||||
|
msgid " Enter file name: "
|
||||||
|
msgstr " ÷×ÅÄÉÔÅ ÉÍÑ ÆÁÊÌÁ: "
|
||||||
|
|
||||||
msgid " A file already exists with this name. "
|
msgid " A file already exists with this name. "
|
||||||
msgstr " æÁÊÌ Ó ÔÁËÉÍ ÉÍÅÎÅÍ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ. "
|
msgstr " æÁÊÌ Ó ÔÁËÉÍ ÉÍÅÎÅÍ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ. "
|
||||||
|
|
||||||
@ -794,6 +794,9 @@ msgstr "
|
|||||||
msgid "Sort order"
|
msgid "Sort order"
|
||||||
msgstr "ðÏÒÑÄÏË ÓÏÒÔÉÒÏ×ËÉ"
|
msgstr "ðÏÒÑÄÏË ÓÏÒÔÉÒÏ×ËÉ"
|
||||||
|
|
||||||
|
msgid "Executable first"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid " confirm di&Rectory hotlist delete "
|
msgid " confirm di&Rectory hotlist delete "
|
||||||
msgstr "âÙÓÔÒÙÊ ÄÏÓÔÕÐ Ë ËÁÔÁ&ÌÏÇÁÍ C-\\"
|
msgstr "âÙÓÔÒÙÊ ÄÏÓÔÕÐ Ë ËÁÔÁ&ÌÏÇÁÍ C-\\"
|
||||||
@ -1766,6 +1769,9 @@ msgstr "&
|
|||||||
msgid "&Find recursively"
|
msgid "&Find recursively"
|
||||||
msgstr "îÁÊÔÉ ÒÅ&ËÕÒÓÉ×ÎÏ"
|
msgstr "îÁÊÔÉ ÒÅ&ËÕÒÓÉ×ÎÏ"
|
||||||
|
|
||||||
|
msgid "Ski&p hidden"
|
||||||
|
msgstr "ðÒÏÐÕÓËÁÔØ ÓËÒ&ÙÔÙÅ"
|
||||||
|
|
||||||
msgid "Start at:"
|
msgid "Start at:"
|
||||||
msgstr "ïÔ ËÁÔÁÌÏÇÁ:"
|
msgstr "ïÔ ËÁÔÁÌÏÇÁ:"
|
||||||
|
|
||||||
@ -2003,6 +2009,9 @@ msgstr "&
|
|||||||
msgid "&Horizontal"
|
msgid "&Horizontal"
|
||||||
msgstr "&çÏÒÉÚÏÎÔÁÌØÎÏÅ"
|
msgstr "&çÏÒÉÚÏÎÔÁÌØÎÏÅ"
|
||||||
|
|
||||||
|
msgid "show free sp&Ace"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "&Xterm window title"
|
msgid "&Xterm window title"
|
||||||
msgstr "&úÁÇÏÌÏ×ÏË xterm"
|
msgstr "&úÁÇÏÌÏ×ÏË xterm"
|
||||||
|
|
||||||
@ -2487,6 +2496,9 @@ msgstr "
|
|||||||
msgid "&Verbose operation"
|
msgid "&Verbose operation"
|
||||||
msgstr "äÅÔÁÌÉ ÏÐÅÒÁÃÉ&Ê"
|
msgstr "äÅÔÁÌÉ ÏÐÅÒÁÃÉ&Ê"
|
||||||
|
|
||||||
|
msgid "Mkdir autoname"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "&Fast dir reload"
|
msgid "&Fast dir reload"
|
||||||
msgstr "&âÙÓÔÒÁÑ ÚÁÇÒÕÚËÁ ËÁÔÁÌÏÇÁ"
|
msgstr "&âÙÓÔÒÁÑ ÚÁÇÒÕÚËÁ ËÁÔÁÌÏÇÁ"
|
||||||
|
|
||||||
@ -2629,6 +2641,9 @@ msgstr "
|
|||||||
msgid "Group"
|
msgid "Group"
|
||||||
msgstr "çÒÕÐÐÁ"
|
msgstr "çÒÕÐÐÁ"
|
||||||
|
|
||||||
|
msgid "<readlink failed>"
|
||||||
|
msgstr "<ÓÂÏÊ ÞÔÅÎÉÑ ÓÓÙÌËÉ>"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s byte"
|
msgid "%s byte"
|
||||||
msgid_plural "%s bytes"
|
msgid_plural "%s bytes"
|
||||||
@ -2643,9 +2658,6 @@ msgstr[0] "%s
|
|||||||
msgstr[1] "%s × %d ÆÁÊÌÁÈ"
|
msgstr[1] "%s × %d ÆÁÊÌÁÈ"
|
||||||
msgstr[2] "%s × %d ÆÁÊÌÁÈ"
|
msgstr[2] "%s × %d ÆÁÊÌÁÈ"
|
||||||
|
|
||||||
msgid "<readlink failed>"
|
|
||||||
msgstr "<ÓÂÏÊ ÞÔÅÎÉÑ ÓÓÙÌËÉ>"
|
|
||||||
|
|
||||||
msgid "Unknown tag on display format: "
|
msgid "Unknown tag on display format: "
|
||||||
msgstr "îÅÉÚ×ÅÓÔÎÙÊ ÔÅÇ × ÆÏÒÍÁÔÅ ÏÔÏÂÒÁÖÅÎÉÑ: "
|
msgstr "îÅÉÚ×ÅÓÔÎÙÊ ÔÅÇ × ÆÏÒÍÁÔÅ ÏÔÏÂÒÁÖÅÎÉÑ: "
|
||||||
|
|
||||||
@ -2716,12 +2728,6 @@ msgstr "
|
|||||||
msgid "Using system-installed S-Lang library"
|
msgid "Using system-installed S-Lang library"
|
||||||
msgstr "ó ÕÓÔÁÎÏ×ÌÅÎÎÏÊ × ÓÉÓÔÅÍÅ ÂÉÂÌÉÏÔÅËÏÊ S-Lang"
|
msgstr "ó ÕÓÔÁÎÏ×ÌÅÎÎÏÊ × ÓÉÓÔÅÍÅ ÂÉÂÌÉÏÔÅËÏÊ S-Lang"
|
||||||
|
|
||||||
msgid "Using included S-Lang library"
|
|
||||||
msgstr "ó ×ËÌÀÞÅÎÎÏÊ ÂÉÂÌÉÏÔÅËÏÊ S-Lang"
|
|
||||||
|
|
||||||
msgid "with termcap database"
|
|
||||||
msgstr "Ó ÂÁÚÏÊ ÄÁÎÎÙÈ termcap"
|
|
||||||
|
|
||||||
msgid "with terminfo database"
|
msgid "with terminfo database"
|
||||||
msgstr "Ó ÂÁÚÏÊ ÄÁÎÎÙÈ terminfo"
|
msgstr "Ó ÂÁÚÏÊ ÄÁÎÎÙÈ terminfo"
|
||||||
|
|
||||||
@ -2855,9 +2861,6 @@ msgstr "%b %e %H:%M"
|
|||||||
msgid "%b %e %Y"
|
msgid "%b %e %Y"
|
||||||
msgstr "%b %e %Y"
|
msgstr "%b %e %Y"
|
||||||
|
|
||||||
msgid "(invalid)"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s is not a directory\n"
|
msgid "%s is not a directory\n"
|
||||||
msgstr "%s ÎÅ Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ\n"
|
msgstr "%s ÎÅ Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ\n"
|
||||||
@ -3614,6 +3617,12 @@ msgstr "
|
|||||||
msgid "Changes to file lost"
|
msgid "Changes to file lost"
|
||||||
msgstr "éÚÍÅÎÅÎÉÑ ÄÌÑ ÆÁÊÌÁ ÐÏÔÅÒÑÎÙ"
|
msgstr "éÚÍÅÎÅÎÉÑ ÄÌÑ ÆÁÊÌÁ ÐÏÔÅÒÑÎÙ"
|
||||||
|
|
||||||
|
#~ msgid "Using included S-Lang library"
|
||||||
|
#~ msgstr "ó ×ËÌÀÞÅÎÎÏÊ ÂÉÂÌÉÏÔÅËÏÊ S-Lang"
|
||||||
|
|
||||||
|
#~ msgid "with termcap database"
|
||||||
|
#~ msgstr "Ó ÂÁÚÏÊ ÄÁÎÎÙÈ termcap"
|
||||||
|
|
||||||
#~ msgid "&Home"
|
#~ msgid "&Home"
|
||||||
#~ msgstr "&ðÅÒÓÏÎÁÌØÎÙÊ"
|
#~ msgstr "&ðÅÒÓÏÎÁÌØÎÙÊ"
|
||||||
|
|
||||||
|
79
src/find.c
79
src/find.c
@ -47,7 +47,7 @@
|
|||||||
#include "key.h"
|
#include "key.h"
|
||||||
|
|
||||||
/* Size of the find parameters window */
|
/* Size of the find parameters window */
|
||||||
#define FIND_Y 15
|
#define FIND_Y 16
|
||||||
static int FIND_X = 50;
|
static int FIND_X = 50;
|
||||||
|
|
||||||
/* Size of the find window */
|
/* Size of the find window */
|
||||||
@ -142,6 +142,7 @@ static regex_t *r; /* Pointer to compiled content_pattern */
|
|||||||
|
|
||||||
static int case_sensitive = 1;
|
static int case_sensitive = 1;
|
||||||
static gboolean find_regex_flag = TRUE;
|
static gboolean find_regex_flag = TRUE;
|
||||||
|
static gboolean skip_hidden_flag = FALSE;
|
||||||
static int find_recursively = 1;
|
static int find_recursively = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -196,8 +197,11 @@ find_parameters (char **start_dir, char **pattern, char **content)
|
|||||||
char *temp_dir;
|
char *temp_dir;
|
||||||
static const char *case_label = N_("case &Sensitive");
|
static const char *case_label = N_("case &Sensitive");
|
||||||
static const char *recurs_label = N_("&Find recursively");
|
static const char *recurs_label = N_("&Find recursively");
|
||||||
|
static const char *skip_hidden_label = N_("Ski&p hidden");
|
||||||
|
static const char *regexp_label = N_("&Regular expression");
|
||||||
|
|
||||||
WCheck *recursively_cbox;
|
WCheck *recursively_cbox;
|
||||||
|
WCheck *skip_hidden_cbox;
|
||||||
|
|
||||||
static char *in_contents = NULL;
|
static char *in_contents = NULL;
|
||||||
static char *in_start_dir = NULL;
|
static char *in_start_dir = NULL;
|
||||||
@ -258,32 +262,27 @@ find_parameters (char **start_dir, char **pattern, char **content)
|
|||||||
DLG_CENTER | DLG_REVERSE);
|
DLG_CENTER | DLG_REVERSE);
|
||||||
|
|
||||||
add_widget (find_dlg,
|
add_widget (find_dlg,
|
||||||
button_new (12, b2, B_CANCEL, NORMAL_BUTTON, buts[2], 0));
|
button_new (FIND_Y - 3, b2, B_CANCEL, NORMAL_BUTTON, buts[2], 0));
|
||||||
add_widget (find_dlg,
|
add_widget (find_dlg,
|
||||||
button_new (12, b1, B_TREE, NORMAL_BUTTON, buts[1], 0));
|
button_new (FIND_Y - 3, b1, B_TREE, NORMAL_BUTTON, buts[1], 0));
|
||||||
add_widget (find_dlg,
|
add_widget (find_dlg,
|
||||||
button_new (12, b0, B_ENTER, DEFPUSH_BUTTON, buts[0], 0));
|
button_new (FIND_Y - 3, b0, B_ENTER, DEFPUSH_BUTTON, buts[0], 0));
|
||||||
|
|
||||||
|
recursively_cbox = check_new (6, istart, find_recursively, recurs_label);
|
||||||
|
skip_hidden_cbox = check_new (7, istart, skip_hidden_flag, skip_hidden_label);
|
||||||
|
find_regex_cbox = check_new (11, istart, find_regex_flag, regexp_label);
|
||||||
|
case_sense = check_new (10, istart, case_sensitive, case_label);
|
||||||
|
|
||||||
|
in_with = input_new (9, istart, INPUT_COLOR, ilen, in_contents, "content", INPUT_COMPLETE_DEFAULT);
|
||||||
|
in_name = input_new (5, istart, INPUT_COLOR, ilen, in_start_name, "name", INPUT_COMPLETE_DEFAULT);
|
||||||
|
in_start = input_new (3, istart, INPUT_COLOR, ilen, in_start_dir, "start", INPUT_COMPLETE_DEFAULT);
|
||||||
|
|
||||||
recursively_cbox =
|
|
||||||
check_new (6, istart, find_recursively, recurs_label);
|
|
||||||
|
|
||||||
find_regex_cbox = check_new (10, istart, find_regex_flag, _("&Regular expression"));
|
|
||||||
add_widget (find_dlg, find_regex_cbox);
|
add_widget (find_dlg, find_regex_cbox);
|
||||||
|
|
||||||
case_sense = check_new (9, istart, case_sensitive, case_label);
|
|
||||||
add_widget (find_dlg, case_sense);
|
add_widget (find_dlg, case_sense);
|
||||||
|
|
||||||
in_with =
|
|
||||||
input_new (8, istart, INPUT_COLOR, ilen, in_contents, "content", INPUT_COMPLETE_DEFAULT);
|
|
||||||
add_widget (find_dlg, in_with);
|
add_widget (find_dlg, in_with);
|
||||||
|
add_widget (find_dlg, skip_hidden_cbox);
|
||||||
add_widget (find_dlg, recursively_cbox);
|
add_widget (find_dlg, recursively_cbox);
|
||||||
in_name =
|
|
||||||
input_new (5, istart, INPUT_COLOR, ilen, in_start_name, "name", INPUT_COMPLETE_DEFAULT);
|
|
||||||
add_widget (find_dlg, in_name);
|
add_widget (find_dlg, in_name);
|
||||||
|
|
||||||
in_start =
|
|
||||||
input_new (3, istart, INPUT_COLOR, ilen, in_start_dir, "start", INPUT_COMPLETE_DEFAULT);
|
|
||||||
add_widget (find_dlg, in_start);
|
add_widget (find_dlg, in_start);
|
||||||
|
|
||||||
add_widget (find_dlg, label_new (8, 3, labs[2]));
|
add_widget (find_dlg, label_new (8, 3, labs[2]));
|
||||||
@ -303,7 +302,8 @@ find_parameters (char **start_dir, char **pattern, char **content)
|
|||||||
temp_dir = g_strdup (in_start->buffer);
|
temp_dir = g_strdup (in_start->buffer);
|
||||||
case_sensitive = case_sense->state & C_BOOL;
|
case_sensitive = case_sense->state & C_BOOL;
|
||||||
find_regex_flag = find_regex_cbox->state & C_BOOL;
|
find_regex_flag = find_regex_cbox->state & C_BOOL;
|
||||||
find_recursively = recursively_cbox->state & C_BOOL;
|
find_recursively = recursively_cbox->state & C_BOOL;
|
||||||
|
skip_hidden_flag = skip_hidden_cbox->state & C_BOOL;
|
||||||
destroy_dlg (find_dlg);
|
destroy_dlg (find_dlg);
|
||||||
g_free (in_start_dir);
|
g_free (in_start_dir);
|
||||||
if (strcmp (temp_dir, ".") == 0) {
|
if (strcmp (temp_dir, ".") == 0) {
|
||||||
@ -331,7 +331,8 @@ find_parameters (char **start_dir, char **pattern, char **content)
|
|||||||
|
|
||||||
case_sensitive = case_sense->state & C_BOOL;
|
case_sensitive = case_sense->state & C_BOOL;
|
||||||
find_regex_flag = find_regex_cbox->state & C_BOOL;
|
find_regex_flag = find_regex_cbox->state & C_BOOL;
|
||||||
find_recursively = recursively_cbox->state & C_BOOL;
|
find_recursively = recursively_cbox->state & C_BOOL;
|
||||||
|
skip_hidden_flag = skip_hidden_cbox->state & C_BOOL;
|
||||||
return_value = 1;
|
return_value = 1;
|
||||||
*start_dir = g_strdup (in_start->buffer);
|
*start_dir = g_strdup (in_start->buffer);
|
||||||
*pattern = g_strdup (in_name->buffer);
|
*pattern = g_strdup (in_name->buffer);
|
||||||
@ -690,25 +691,27 @@ do_search (struct Dlg_head *h)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subdirs_left && find_recursively && directory) { /* Can directory be NULL ? */
|
if (!(skip_hidden_flag && dp->d_name[0] == '.')) {
|
||||||
char *tmp_name = concat_dir_and_file (directory, dp->d_name);
|
if (subdirs_left && find_recursively && directory) { /* Can directory be NULL ? */
|
||||||
if (!mc_lstat (tmp_name, &tmp_stat)
|
char *tmp_name = concat_dir_and_file (directory, dp->d_name);
|
||||||
&& S_ISDIR (tmp_stat.st_mode)) {
|
if (!mc_lstat (tmp_name, &tmp_stat)
|
||||||
push_directory (tmp_name);
|
&& S_ISDIR (tmp_stat.st_mode)) {
|
||||||
subdirs_left--;
|
push_directory (tmp_name);
|
||||||
}
|
subdirs_left--;
|
||||||
g_free (tmp_name);
|
}
|
||||||
|
g_free (tmp_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (regexp_match (find_pattern, dp->d_name, match_file)){
|
||||||
|
if (content_pattern) {
|
||||||
|
if (search_content (h, directory, dp->d_name)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
find_add_match (h, directory, dp->d_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (regexp_match (find_pattern, dp->d_name, match_file)){
|
|
||||||
if (content_pattern) {
|
|
||||||
if (search_content (h, directory, dp->d_name)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
find_add_match (h, directory, dp->d_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
dp = mc_readdir (dirp);
|
dp = mc_readdir (dirp);
|
||||||
|
|
||||||
/* Displays the nice dot */
|
/* Displays the nice dot */
|
||||||
|
Loading…
Reference in New Issue
Block a user