[PATCH] Add 'Ignore ...' buttons to error msg window

David Sterba dave at jikos.cz
Tue Jun 10 15:11:10 UTC 2003


Hi,

I'm sending a patch which adds the 'Ignore', 'Ignore all', 'Ignore similar'
buttons to error message window.


Description
-----------
The error message window shows some more buttons:
'Ignore all' - ignore all following errors
'Ignore similar' - ignore "this" specific error;
    "this" is based on error message displayed and
    is by now (can be easily enhanced to another)
    - 'cannot remove directory'
    - 'cannot chown file'
    - 'cannot cmmod file'
    - 'cannot stat file'
    This button is not shown for other errors.

'Ignore' - this is just renamed 'Skip' button, which now seems to
    be more logical with conjunction with names of other buttons

If error concerns only one file, the buttons 'Ignore all/similar' are
not shown.


Code changes
------------
In order to make no substantial changes to code handling the return
codes form file_error, all error ignoring was put into file_error,
do_file_error and real_file_error.

So these functions now take the context and a flag indicating specific
error to ignore.

Ignored flags are stored in context.


Things to discuss & possible enhancements
-----------------------------------------
Names of buttons - I hope the meaning and difference between
    'all' and 'similar' is clear. Maybe someone will find better.
Order of buttons - Maybe, 'similar' should go before 'all'.
Position of buttons - The query dialog puts all buttons into
    one line and with all these buttons, the window gets very wide
    (nearly full 80 columns). Breaking button line into more lines
    can be nice, but is not necessary now.

More buttons - More special decisions about places of show/not show errors.
    'Only this directory' - don't show error only in this dir
    'This dir. and subdirs' - --"-- and subdirs too

More specific errors to ignore -
    - file operations: delete, open, create
    - various symlink errors
    - etc
    Adding a new error to ignore is easy:
    1. add a constant FILE_x into fileopctx.h
    2. search through file.c and give this constant as a parameter to
       right file_error calls


David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ignore.diff
Type: text/x-diff
Size: 19189 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20030610/e1660825/attachment.diff>
-------------- next part --------------
2003-06-10  David Sterba  <dave at jikos.cz>

	Add 'Ignore ...' buttons to error message dialogs
	* fileopctx.h: New item containing ignore flags into context.
	New macros to test/set flags.
	* fileopctx.c (file_op_context_new): Init the item.

	* file.h: Add params to file_error, files_error.
	* file.c: Add params to do_file_error, real_do_file_error.
	Adjust all callers of file_error, files_error, do_file_error.
	(do_file_error): Update background processing
	(real_do_file_error): Add params and update all callers, namely
	while background processing.
	Add options to query dialog and handle result (set ignored flags).
	(file_error, files_error): Test for ignored flags and don't display
	message.

	* tree.c: Adjust caller of file_error.



More information about the mc-devel mailing list