Re: Suppress directory not empty message

2013-09-09 Thread Mike Smithson

On Mon, 09 Sep 2013 05:00:03 -0700, mc-requ...@gnome.org wrote:



Message: 1
Date: Wed, 4 Sep 2013 17:32:33 +0200
From: Marco li...@homerow.info
To: mc@gnome.org
Subject: Re: Suppress directory not empty message
Message-ID: 20130904153233.GC27101@homerow
Content-Type: text/plain; charset=utf-8

On 2013?08?05 Marco wrote:


When deleting a directory tree mc displays the following message:

  Delete directory directory?

  [Yes] [No]

I hit ?Yes?, then another message pops up:

  Directory not empty.
  Delete it recursively?

  [Yes] [No] [All] [None] [Abort]

I hit ?All? since I want to delete the entire tree. This is very
cumbersome. Is is possible to suppress both messages entirely or at
least suppress the second message?

Is it possible to suppress the deletion window displaying the
deleted files list with the [Skip] [Abort] buttons as well? Since
the deletion/copy/move processes often take several minutes, mc
becomes totally unusable until those operations are finished. The
only way to continue working is to open up a second mc instance.

I couldn't find anything relevant in the manual.


So apparently there is no way of suppressing those messages?

Marco


I can think of 2 options:

1. Write a special dialog where the user can choose which dialogs
get shown, and which don't. I believe there is more to this than
meets the eye. Easier said than done, as they say. Which dialogs
should be optional, and what should they default to if they don't
get shown?

2. Hack your source and comment out the offending dialog calls.
I have done this myself with the Edit extension file dialog
where it always asks [Local] [User] [System Wide].
The only one I ever edit is [User], so I made it skip the dialog
and go for that one automatically. Hey, that's what having
the source code means to me:)

I, for one, very much appreciate the second 'Directory not empty'
dialog, because my usual habits are to go through work directories
once in a while on garbage cleanup duty. Accidentally removing a
sprawling subtree seems to me far worse than having to hit ENTER
one more time.

As an addendum, after a quick peek at the source, in
filemanager/file.c, you could just add a line 672:

ctx-recursive_result = RECURSIVE_ALWAYS;

cd ../..; make; make install

It will never pester you again. And from the look of things,
someone has already done this before, otherwise line 673
wouldn't even ask. So there is likely others who make this
one of their favorite first hacks when they get new code.
As a matter of fact,

if (ctx-recursive_result  RECURSIVE_ALWAYS) {
... show dialog ...
}

goes back to at least 4.6 in 2005. I don't have any mc source
code left from before that date.

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Suppress directory not empty message

2013-09-09 Thread Marco
On 2013–09–09 Mike Smithson wrote:

 1. Write a special dialog where the user can choose which dialogs
 get shown, and which don't. I believe there is more to this than
 meets the eye. Easier said than done, as they say. Which dialogs
 should be optional, and what should they default to if they don't
 get shown?

That would be an option, indeed.

 2. Hack your source and comment out the offending dialog calls.
 I have done this myself with the Edit extension file dialog
 where it always asks [Local] [User] [System Wide].
 The only one I ever edit is [User], so I made it skip the dialog
 and go for that one automatically. Hey, that's what having
 the source code means to me:)
 
 I, for one, very much appreciate the second 'Directory not empty'
 dialog, because my usual habits are to go through work directories
 once in a while on garbage cleanup duty.

I never said this message should be removed from mc.

When I hit delete I actually want to delete the file 99% of the
times and the last dialogue doesn't save me in the 1% cases. Muscle
memory always wins. Being trained to confirm it three times doesn't
make it more secure, in my opinion.

 Accidentally removing a sprawling subtree seems to me far worse
 than having to hit ENTER one more time.

With regular backups in place accidental deletion of directory
trees isn't that big of a deal.

Another option would be to make use of the trash can (like the
trash-cli utility does), instead of deleting the files. As a second
option, of course. I still want to be able to delete files. That
wouldn't require multiple dialogue boxes and saves the data even
without a regular backup.

 As an addendum, after a quick peek at the source, in
 filemanager/file.c, you could just add a line 672:
 
 ctx-recursive_result = RECURSIVE_ALWAYS;

That did the trick! It would be nice to have it configurable,
though. A GUI dialogue box is not even required, an option in the
configuration file would be totally sufficient.

Thanks for your response, changing the source is not a perfect
solution but a decent workaround.

Marco


signature.asc
Description: Digital signature
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc