Просмотр исходного кода

* file.h: Rename know_not_what_am_i_doing to safe_delete.
* file.c (real_query_recursive): Don't ask to enter "yes" - it's
ugly and requires changing input method in some locales.

Pavel Roskin 22 лет назад
Родитель
Сommit
71ee494335
5 измененных файлов с 21 добавлено и 33 удалено
  1. 4 0
      src/ChangeLog
  2. 14 30
      src/file.c
  3. 1 1
      src/file.h
  4. 1 1
      src/option.c
  5. 1 1
      src/setup.c

+ 4 - 0
src/ChangeLog

@@ -1,5 +1,9 @@
 2002-10-21  Pavel Roskin  <proski@gnu.org>
 
+	* file.h: Rename know_not_what_am_i_doing to safe_delete.
+	* file.c (real_query_recursive): Don't ask to enter "yes" - it's
+	ugly and requires changing input method in some locales.
+
 	* file.c (real_query_recursive): Default to empty string, not to
 	"no" when asking to enter "yes".  Add note for translators.
 

+ 14 - 30
src/file.c

@@ -104,8 +104,8 @@ int verbose = 1;
  */
 int file_op_compute_totals = 1;
 
-/* If on, it gets a little scrict with dangerous operations */
-int know_not_what_am_i_doing = 0;
+/* If on, default for "No" in delete operations */
+int safe_delete = 0;
 
 /* This is a hard link cache */
 struct link {
@@ -1825,7 +1825,7 @@ panel_operate (void *source_panel, FileOperation operation,
 
     /* Show confirmation dialog */
     if (operation == OP_DELETE && confirm_delete) {
-	if (know_not_what_am_i_doing)
+	if (safe_delete)
 	    query_set_sel (1);
 
 	i = query_dialog (_(op_names[operation]), cmd_buf,
@@ -2204,47 +2204,31 @@ files_error (char *format, char *file1, char *file2)
 static int
 real_query_recursive (FileOpContext *ctx, enum OperationMode mode, char *s)
 {
-    char *confirm;
     gchar *text;
 
-    if (ctx->recursive_result < RECURSIVE_ALWAYS){
+    if (ctx->recursive_result < RECURSIVE_ALWAYS) {
 	char *msg =
-	    mode == Foreground ? _("\n   Directory not empty.   \n   Delete it recursively? ")
-	                       : _("\n   Background process: Directory not empty \n   Delete it recursively? ");
+	    mode ==
+	    Foreground ?
+	    _("\n   Directory not empty.   \n"
+	      "   Delete it recursively? ")
+	    : _("\n   Background process: Directory not empty \n"
+		"   Delete it recursively? ");
 	text = g_strconcat (_(" Delete: "), name_trunc (s, 30), " ", NULL);
 
-        if (know_not_what_am_i_doing)
+	if (safe_delete)
 	    query_set_sel (1);
-        ctx->recursive_result = query_dialog (text, msg, D_ERROR, 5,
+	ctx->recursive_result = query_dialog (text, msg, D_ERROR, 5,
 					      _("&Yes"), _("&No"),
 					      _("a&ll"), _("non&E"),
 					      _("&Abort"));
-	
+
 	if (ctx->recursive_result != RECURSIVE_ABORT)
 	    do_refresh ();
 	g_free (text);
-	if (know_not_what_am_i_doing){
-	    if (ctx->recursive_result == RECURSIVE_YES ||
-		ctx->recursive_result == RECURSIVE_ALWAYS){
-		text = g_strconcat (
-		    _(" Type 'yes' if you REALLY want to delete "),
-		    ctx->recursive_result == RECURSIVE_YES
-		    ? name_trunc (s, 19) : _("all the directories "), " ", NULL);
-		confirm = input_dialog (
-		    mode == Foreground ? _(" Recursive Delete ")
-		    : _(" Background process: Recursive Delete "),
-		    text, NULL);
-		do_refresh ();
-		/* TRANSLATORS: user types this text to confirm deletion */
-		if (!confirm || strcmp (confirm, _("yes")))
-		    ctx->recursive_result = RECURSIVE_NEVER;
-		g_free (confirm);
-		g_free (text);
-	    }
-	}
     }
 
-    switch (ctx->recursive_result){
+    switch (ctx->recursive_result) {
     case RECURSIVE_YES:
     case RECURSIVE_ALWAYS:
 	return FILE_CONT;

+ 1 - 1
src/file.h

@@ -4,7 +4,7 @@
 #include "fileopctx.h"
 #include "background.h"
 
-extern int know_not_what_am_i_doing;
+extern int safe_delete;
 
 struct link;
 

+ 1 - 1
src/option.c

@@ -61,7 +61,7 @@ static struct {
     char   *tk;
 } check_options [] = {
    /* other options */
-   {N_("safe de&Lete"),       &know_not_what_am_i_doing, TOGGLE_VARIABLE,0, "safe-del" },
+   {N_("safe de&Lete"),       &safe_delete,       TOGGLE_VARIABLE,       0, "safe-del" },
    {N_("cd follows lin&Ks"),  &cd_symlinks,       TOGGLE_VARIABLE,       0, "cd-follow" },
    {N_("l&Ynx-like motion"),  &navigate_with_arrows,TOGGLE_VARIABLE,     0, "lynx" },
    {N_("rotatin&G dash"),     &nice_rotating_dash,TOGGLE_VARIABLE,       0, "rotating" },

+ 1 - 1
src/setup.c

@@ -161,7 +161,7 @@ static const struct {
     { "confirm_overwrite", &confirm_overwrite },
     { "confirm_execute", &confirm_execute },
     { "confirm_exit", &confirm_exit },
-    { "safe_delete", &know_not_what_am_i_doing },
+    { "safe_delete", &safe_delete },
     { "mouse_repeat_rate", &mou_auto_repeat },
     { "double_click_speed", &double_click_speed },
 #ifndef HAVE_CHARSET