mc/src/fileopctx.c

90 lines
2.5 KiB
C
Raw Normal View History

1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
/* File operation contexts for the Midnight Commander
Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
Authors: Federico Mena <federico@nuclecu.unam.mx>
Miguel de Icaza <miguel@nuclecu.unam.mx>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
*/
/** \file fileopctx.c
* \brief Source: file operation contexts
* \date 1998-2007
* \author Federico Mena <federico@nuclecu.unam.mx>
* \author Miguel de Icaza <miguel@nuclecu.unam.mx>
*/
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
#include <config.h>
2005-02-08 12:04:03 +03:00
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
#include <unistd.h>
#include "global.h"
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
#include "fileopctx.h"
#include "../src/search/search.h"
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
/**
* \fn FileOpContext * file_op_context_new (FileOperation op)
* \param op file operation struct
* \return The newly-created context, filled with the default file mask values.
*
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
* Creates a new file operation context with the default values. If you later want
* to have a user interface for this, call file_op_context_create_ui().
*/
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
FileOpContext *
file_op_context_new (FileOperation op)
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
{
FileOpContext *ctx;
ctx = g_new0 (FileOpContext, 1);
ctx->operation = op;
ctx->eta_secs = 0.0;
ctx->progress_bytes = 0.0;
ctx->op_preserve = TRUE;
ctx->do_reget = TRUE;
ctx->stat_func = mc_lstat;
ctx->preserve = TRUE;
ctx->preserve_uidgid = (geteuid () == 0) ? TRUE : FALSE;
ctx->umask_kill = 0777777;
ctx->erase_at_end = TRUE;
return ctx;
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
}
/**
* \fn void file_op_context_destroy (FileOpContext *ctx)
* \param ctx The file operation context to destroy.
*
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
* Destroys the specified file operation context and its associated UI data, if
* it exists.
*/
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
void
file_op_context_destroy (FileOpContext *ctx)
{
g_return_if_fail (ctx != NULL);
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
if (ctx->ui)
file_op_context_destroy_ui (ctx);
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
mc_search_free(ctx->search_handle);
/** \todo FIXME: do we need to free ctx->dest_mask? */
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
g_free (ctx);
1999-01-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * fileopctx.h: New file with declarations for the file operation context structure. * fileopctx.c (file_op_context_new): New function to create a file operation context with the default file mask values. (file_op_context_destroy): New function to destroy a file operation context and its associated UI, if appropriate. * filegui.h: Use complete prototype for fmd_init_i18n(). * filegui.c (FileOpContextUI): New structure that describes the UI and internal data for file operation contexts in the text mode version. (file_op_context_create_ui): Renamed from create_op_win() and made it use a context instead of global variables. (file_op_context_destroy_ui): Likewise, renamed from destroy_op_win(). (fmd_widgets): Removed an #ifdef HAVE_XVIEW bit and moved the initialization of the result pointers to file_mask_dialog(), as we need to use the pointers to the fields inside the file op context now. Made all the functions use a file operation context. (file_mask_dialog): Always call fmd_init_i18n(); it will take care of idempotence by itself. (fmd_init_i18n): Now the code that makes sure this function is only called once is here. * cmd.c (check_for_default): Make it use a file operation context. * tree.c (tree_copy): Likewise. (tree_move): Likewise. (tree_rmdir_cmd): Likewise. * file.c: Removed file_progress_replace_progress and file_progress_replace_filename -- they are only used in filegui.c as part of the UI for the file operation context. (panel_operate_generate_prompt): Made static. (panel_operate_generate_prompt): Always call fmd_init_i18n(); it will take care of idempotence by itself. (panel_operate): Removed the panel_operate_def() function, and made panel_operate() take an extra "ask_user" argument. (query_recursive): Made static. * background.c (background_attention): Made static. (register_task_running): Made static. (do_background): Now takes a file operation context as an argument. It stores the pid of the child there. * Makefile.in: Added fileopctx.[ch].
1999-01-07 04:14:50 +03:00
}