1998-02-27 07:54:42 +03:00
|
|
|
/* Setup loading/saving.
|
2007-09-26 14:22:25 +04:00
|
|
|
Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
2010-03-13 13:06:36 +03:00
|
|
|
2006, 2007, 2009, 2010 Free Software Foundation, Inc.
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
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.
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
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
|
2005-05-27 07:35:10 +04:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2009-02-05 21:28:18 +03:00
|
|
|
/** \file setup.c
|
|
|
|
* \brief Source: setup loading/saving
|
|
|
|
*/
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#include <config.h>
|
2005-02-08 12:04:03 +03:00
|
|
|
|
2009-02-27 14:54:26 +03:00
|
|
|
#include <stdlib.h>
|
1998-02-27 07:54:42 +03:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
2005-02-08 12:04:03 +03:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2010-01-20 18:11:52 +03:00
|
|
|
#include "lib/global.h"
|
2009-05-09 19:17:57 +04:00
|
|
|
|
2010-01-08 17:47:19 +03:00
|
|
|
#include "lib/tty/tty.h"
|
|
|
|
#include "lib/tty/key.h"
|
2010-01-21 16:06:15 +03:00
|
|
|
#include "lib/mcconfig.h"
|
2010-01-21 13:30:08 +03:00
|
|
|
#include "lib/fileloc.h"
|
2010-11-09 21:50:25 +03:00
|
|
|
#include "lib/timefmt.h"
|
2010-01-21 15:17:26 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
#include "lib/vfs/mc-vfs/vfs.h"
|
|
|
|
|
2010-07-13 15:58:44 +04:00
|
|
|
#ifdef ENABLE_VFS_FTP
|
2010-03-13 13:06:36 +03:00
|
|
|
#include "lib/vfs/mc-vfs/ftpfs.h"
|
2010-07-13 15:58:44 +04:00
|
|
|
#endif
|
2010-07-13 17:01:25 +04:00
|
|
|
#ifdef ENABLE_VFS_FISH
|
2010-03-13 13:06:36 +03:00
|
|
|
#include "lib/vfs/mc-vfs/fish.h"
|
|
|
|
#endif
|
2010-01-21 15:17:26 +03:00
|
|
|
|
2010-11-11 16:58:29 +03:00
|
|
|
#include "lib/util.h"
|
2010-11-12 11:03:57 +03:00
|
|
|
#include "lib/widget.h"
|
2010-11-18 11:31:09 +03:00
|
|
|
#ifdef HAVE_CHARSET
|
|
|
|
#include "lib/charsets.h"
|
|
|
|
#endif
|
2010-11-10 22:45:56 +03:00
|
|
|
|
2009-08-24 00:42:28 +04:00
|
|
|
#include "args.h"
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
#include "dir.h"
|
1998-02-27 07:54:42 +03:00
|
|
|
#include "panel.h"
|
|
|
|
#include "main.h"
|
2010-02-26 12:25:53 +03:00
|
|
|
#include "tree.h" /* xtree_mode */
|
|
|
|
#include "hotlist.h" /* load/save/done hotlist */
|
|
|
|
#include "panelize.h" /* load/save/done panelize */
|
1998-02-27 07:54:42 +03:00
|
|
|
#include "layout.h"
|
|
|
|
#include "cmd.h"
|
2010-02-26 12:25:53 +03:00
|
|
|
#include "file.h" /* safe_delete */
|
|
|
|
#include "keybind.h" /* lookup_action */
|
1998-04-15 07:16:29 +04:00
|
|
|
|
2001-06-06 02:49:15 +04:00
|
|
|
|
2002-08-19 05:43:40 +04:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
2010-03-13 13:06:36 +03:00
|
|
|
#include "src/editor/edit.h"
|
2002-08-19 05:43:40 +04:00
|
|
|
#endif
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
#include "src/viewer/mcviewer.h" /* For the externs */
|
2009-04-17 01:22:52 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
#include "setup.h"
|
2002-08-19 05:43:40 +04:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** global variables ****************************************************************************/
|
2010-02-26 12:25:53 +03:00
|
|
|
char *profile_name; /* .mc/ini */
|
|
|
|
char *global_profile_name; /* mc.lib */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2009-05-20 16:34:33 +04:00
|
|
|
char *setup_color_string;
|
|
|
|
char *term_color_string;
|
|
|
|
char *color_terminal_string;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2009-12-31 21:46:02 +03:00
|
|
|
panel_view_mode_t startup_left_mode;
|
|
|
|
panel_view_mode_t startup_right_mode;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
int setup_copymove_persistent_attr = 1;
|
|
|
|
|
2010-06-12 16:26:27 +04:00
|
|
|
/* Tab size */
|
|
|
|
int option_tab_spacing = DEFAULT_TAB_SPACING;
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Ugly hack to allow panel_save_setup to work as a place holder for */
|
|
|
|
/* default panel values */
|
|
|
|
int saving_setup;
|
2010-03-13 13:06:36 +03:00
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
panels_options_t panels_options = {
|
2010-03-28 11:49:23 +04:00
|
|
|
.kilobyte_si = FALSE,
|
2010-03-09 22:03:51 +03:00
|
|
|
.mix_all_files = FALSE,
|
|
|
|
.show_backups = TRUE,
|
|
|
|
.show_dot_files = TRUE,
|
|
|
|
.fast_reload = FALSE,
|
|
|
|
.fast_reload_msg_shown = FALSE,
|
|
|
|
.mark_moves_down = TRUE,
|
2010-03-28 11:49:23 +04:00
|
|
|
.reverse_files_only = TRUE,
|
|
|
|
.auto_save_setup = FALSE,
|
2010-03-09 22:03:51 +03:00
|
|
|
.navigate_with_arrows = FALSE,
|
|
|
|
.scroll_pages = TRUE,
|
|
|
|
.mouse_move_pages = TRUE,
|
|
|
|
.filetype_mode = TRUE,
|
2010-03-20 20:24:48 +03:00
|
|
|
.permission_mode = FALSE,
|
|
|
|
.qsearch_mode = QSEARCH_PANEL_CASE
|
2010-03-09 22:03:51 +03:00
|
|
|
};
|
|
|
|
|
2010-11-08 22:02:52 +03:00
|
|
|
int easy_patterns = 1;
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** file scope macro definitions ****************************************************************/
|
2010-03-13 13:06:36 +03:00
|
|
|
|
|
|
|
/* In order to use everywhere the same setup for the locale we use defines */
|
|
|
|
#define FMTYEAR _("%b %e %Y")
|
|
|
|
#define FMTTIME _("%b %e %H:%M")
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** file scope type declarations ****************************************************************/
|
2010-03-13 13:06:36 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** file scope variables ************************************************************************/
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
static char *panels_profile_name = NULL; /* .mc/panels.ini */
|
2009-10-29 22:04:44 +03:00
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
/* *INDENT-OFF* */
|
2010-03-09 22:03:51 +03:00
|
|
|
static const struct
|
|
|
|
{
|
2004-08-30 03:27:40 +04:00
|
|
|
const char *key;
|
1998-02-27 07:54:42 +03:00
|
|
|
int list_type;
|
|
|
|
} list_types [] = {
|
1998-05-12 08:26:21 +04:00
|
|
|
{ "full", list_full },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "brief", list_brief },
|
1998-05-12 08:26:21 +04:00
|
|
|
{ "long", list_long },
|
|
|
|
{ "user", list_user },
|
2010-03-09 22:03:51 +03:00
|
|
|
{ NULL, 0 }
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
static const struct
|
|
|
|
{
|
2004-08-30 03:27:40 +04:00
|
|
|
const char *opt_name;
|
2009-12-31 21:46:02 +03:00
|
|
|
panel_view_mode_t opt_type;
|
1998-02-27 07:54:42 +03:00
|
|
|
} panel_types [] = {
|
|
|
|
{ "listing", view_listing },
|
2009-12-31 21:46:02 +03:00
|
|
|
{ "quickview", view_quick },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "info", view_info },
|
|
|
|
{ "tree", view_tree },
|
2009-12-31 21:46:02 +03:00
|
|
|
{ NULL, view_listing }
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
static const struct
|
|
|
|
{
|
2004-08-30 03:27:40 +04:00
|
|
|
const char *opt_name;
|
1998-02-27 07:54:42 +03:00
|
|
|
int *opt_addr;
|
|
|
|
} layout [] = {
|
|
|
|
{ "equal_split", &equal_split },
|
|
|
|
{ "first_panel_size", &first_panel_size },
|
|
|
|
{ "message_visible", &message_visible },
|
|
|
|
{ "keybar_visible", &keybar_visible },
|
2002-12-26 19:10:45 +03:00
|
|
|
{ "xterm_title", &xterm_title },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "output_lines", &output_lines },
|
|
|
|
{ "command_prompt", &command_prompt },
|
2001-06-19 04:43:56 +04:00
|
|
|
{ "menubar_visible", &menubar_visible },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "show_mini_info", &show_mini_info },
|
2009-02-04 04:27:36 +03:00
|
|
|
{ "free_space", &free_space },
|
2010-03-09 22:03:51 +03:00
|
|
|
{ NULL, NULL }
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
static const struct
|
|
|
|
{
|
2004-08-30 03:27:40 +04:00
|
|
|
const char *opt_name;
|
2010-03-09 22:03:51 +03:00
|
|
|
int *opt_addr;
|
2005-09-07 11:55:15 +04:00
|
|
|
} int_options [] = {
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "verbose", &verbose },
|
|
|
|
{ "pause_after_run", &pause_after_run },
|
|
|
|
{ "shell_patterns", &easy_patterns },
|
|
|
|
{ "auto_save_setup", &auto_save_setup },
|
|
|
|
{ "auto_menu", &auto_menu },
|
|
|
|
{ "use_internal_view", &use_internal_view },
|
|
|
|
{ "use_internal_edit", &use_internal_edit },
|
|
|
|
{ "clear_before_exec", &clear_before_exec },
|
|
|
|
{ "confirm_delete", &confirm_delete },
|
|
|
|
{ "confirm_overwrite", &confirm_overwrite },
|
|
|
|
{ "confirm_execute", &confirm_execute },
|
2010-02-03 17:59:33 +03:00
|
|
|
{ "confirm_history_cleanup", &confirm_history_cleanup },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "confirm_exit", &confirm_exit },
|
2006-01-29 23:26:05 +03:00
|
|
|
{ "confirm_directory_hotlist_delete", &confirm_directory_hotlist_delete },
|
2002-10-22 01:03:22 +04:00
|
|
|
{ "safe_delete", &safe_delete },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "mouse_repeat_rate", &mou_auto_repeat },
|
|
|
|
{ "double_click_speed", &double_click_speed },
|
2001-06-06 02:49:15 +04:00
|
|
|
#ifndef HAVE_CHARSET
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "eight_bit_clean", &eight_bit_clean },
|
|
|
|
{ "full_eight_bits", &full_eight_bits },
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* !HAVE_CHARSET */
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "use_8th_bit_as_meta", &use_8th_bit_as_meta },
|
|
|
|
{ "confirm_view_dir", &confirm_view_dir },
|
2009-08-11 18:43:10 +04:00
|
|
|
{ "mouse_move_pages_viewer", &mcview_mouse_move_pages },
|
2009-04-03 19:29:20 +04:00
|
|
|
{ "mouse_close_dialog", &mouse_close_dialog},
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "fast_refresh", &fast_refresh },
|
|
|
|
{ "drop_menus", &drop_menus },
|
2009-08-11 18:43:10 +04:00
|
|
|
{ "wrap_mode", &mcview_global_wrap_mode},
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "old_esc_mode", &old_esc_mode },
|
2010-03-28 17:11:27 +04:00
|
|
|
{ "old_esc_mode_timeout", &old_esc_mode_timeout },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "cd_symlinks", &cd_symlinks },
|
|
|
|
{ "show_all_if_ambiguous", &show_all_if_ambiguous },
|
2009-08-11 18:43:10 +04:00
|
|
|
{ "max_dirt_limit", &mcview_max_dirt_limit },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "torben_fj_mode", &torben_fj_mode },
|
|
|
|
{ "use_file_to_guess_type", &use_file_to_check_type },
|
|
|
|
{ "alternate_plus_minus", &alternate_plus_minus },
|
|
|
|
{ "only_leading_plus_minus", &only_leading_plus_minus },
|
|
|
|
{ "show_output_starts_shell", &output_starts_shell },
|
|
|
|
{ "xtree_mode", &xtree_mode },
|
|
|
|
{ "num_history_items_recorded", &num_history_items_recorded },
|
1998-12-05 02:39:41 +03:00
|
|
|
{ "file_op_compute_totals", &file_op_compute_totals },
|
2010-03-09 22:03:51 +03:00
|
|
|
{ "classic_progressbar", &classic_progressbar},
|
2009-12-29 14:39:13 +03:00
|
|
|
#ifdef ENABLE_VFS
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "vfs_timeout", &vfs_timeout },
|
2010-07-13 15:58:44 +04:00
|
|
|
#ifdef ENABLE_VFS_FTP
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "ftpfs_directory_timeout", &ftpfs_directory_timeout },
|
2010-07-13 15:58:44 +04:00
|
|
|
{ "use_netrc", &ftpfs_use_netrc },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "ftpfs_retry_seconds", &ftpfs_retry_seconds },
|
|
|
|
{ "ftpfs_always_use_proxy", &ftpfs_always_use_proxy },
|
|
|
|
{ "ftpfs_use_passive_connections", &ftpfs_use_passive_connections },
|
2009-11-02 16:27:36 +03:00
|
|
|
{ "ftpfs_use_passive_connections_over_proxy", &ftpfs_use_passive_connections_over_proxy },
|
1998-10-11 23:19:03 +04:00
|
|
|
{ "ftpfs_use_unix_list_options", &ftpfs_use_unix_list_options },
|
1999-01-31 23:28:13 +03:00
|
|
|
{ "ftpfs_first_cd_then_ls", &ftpfs_first_cd_then_ls },
|
2010-07-13 15:58:44 +04:00
|
|
|
#endif /* ENABLE_VFS_FTP */
|
2010-07-13 17:01:25 +04:00
|
|
|
#ifdef ENABLE_VFS_FISH
|
2006-02-23 18:32:18 +03:00
|
|
|
{ "fish_directory_timeout", &fish_directory_timeout },
|
2010-07-13 17:01:25 +04:00
|
|
|
#endif /* ENABLE_VFS_FISH */
|
2009-12-29 14:39:13 +03:00
|
|
|
#endif /* ENABLE_VFS */
|
2010-06-12 16:26:27 +04:00
|
|
|
/* option_tab_spacing is used in internal viewer */
|
|
|
|
{ "editor_tab_spacing", &option_tab_spacing },
|
1998-02-27 07:54:42 +03:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
|
|
|
{ "editor_word_wrap_line_length", &option_word_wrap_line_length },
|
|
|
|
{ "editor_fill_tabs_with_spaces", &option_fill_tabs_with_spaces },
|
|
|
|
{ "editor_return_does_auto_indent", &option_return_does_auto_indent },
|
|
|
|
{ "editor_backspace_through_tabs", &option_backspace_through_tabs },
|
|
|
|
{ "editor_fake_half_tabs", &option_fake_half_tabs },
|
|
|
|
{ "editor_option_save_mode", &option_save_mode },
|
2002-11-30 03:37:14 +03:00
|
|
|
{ "editor_option_save_position", &option_save_position },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "editor_option_auto_para_formatting", &option_auto_para_formatting },
|
|
|
|
{ "editor_option_typewriter_wrap", &option_typewriter_wrap },
|
|
|
|
{ "editor_edit_confirm_save", &edit_confirm_save },
|
1998-04-24 19:18:08 +04:00
|
|
|
{ "editor_syntax_highlighting", &option_syntax_highlighting },
|
2009-03-27 23:48:31 +03:00
|
|
|
{ "editor_persistent_selections", &option_persistent_selections },
|
2009-08-17 19:52:43 +04:00
|
|
|
{ "editor_cursor_beyond_eol", &option_cursor_beyond_eol },
|
2009-01-20 00:09:54 +03:00
|
|
|
{ "editor_visible_tabs", &visible_tabs },
|
|
|
|
{ "editor_visible_spaces", &visible_tws },
|
2009-05-12 01:15:55 +04:00
|
|
|
{ "editor_line_state", &option_line_state },
|
2009-05-28 11:40:54 +04:00
|
|
|
{ "editor_simple_statusbar", &simple_statusbar },
|
2009-10-26 19:32:56 +03:00
|
|
|
{ "editor_check_new_line", &option_check_nl_at_eof },
|
2010-01-03 01:50:29 +03:00
|
|
|
{ "editor_show_right_margin", &show_right_margin },
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* USE_INTERNAL_EDIT */
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "nice_rotating_dash", &nice_rotating_dash },
|
1999-01-17 07:17:20 +03:00
|
|
|
{ "horizontal_split", &horizontal_split },
|
2005-07-18 12:47:45 +04:00
|
|
|
{ "mcview_remember_file_position", &mcview_remember_file_position },
|
2009-01-23 00:29:10 +03:00
|
|
|
{ "auto_fill_mkdir_name", &auto_fill_mkdir_name },
|
2009-10-26 14:32:10 +03:00
|
|
|
{ "copymove_persistent_attr", &setup_copymove_persistent_attr },
|
2009-11-01 16:26:55 +03:00
|
|
|
{ "select_flags", &select_flags },
|
2010-03-09 22:03:51 +03:00
|
|
|
{ NULL, NULL }
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
2009-11-25 14:04:51 +03:00
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
static const struct
|
|
|
|
{
|
2005-09-07 12:55:31 +04:00
|
|
|
const char *opt_name;
|
|
|
|
char **opt_addr;
|
|
|
|
const char *opt_defval;
|
2010-03-13 13:06:36 +03:00
|
|
|
} str_options[] = {
|
2005-09-07 14:08:25 +04:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
2010-03-13 13:06:36 +03:00
|
|
|
{ "editor_backup_extension", &option_backup_ext, "~" },
|
2005-09-07 14:08:25 +04:00
|
|
|
#endif
|
2010-03-13 13:06:36 +03:00
|
|
|
{ "mcview_eof", &mcview_show_eof, "" },
|
|
|
|
{ NULL, NULL, NULL }
|
2005-09-07 12:55:31 +04:00
|
|
|
};
|
|
|
|
|
2010-03-20 19:04:07 +03:00
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
const char *opt_name;
|
|
|
|
const char *opt_old_name;
|
|
|
|
gboolean *opt_addr;
|
|
|
|
} panels_ini_options[] = {
|
2010-03-28 11:49:23 +04:00
|
|
|
{ "kilobyte_si", NULL, &panels_options.kilobyte_si },
|
2010-03-20 19:04:07 +03:00
|
|
|
{ "mix_all_files", NULL, &panels_options.mix_all_files },
|
|
|
|
{ "show_backups", NULL, &panels_options.show_backups },
|
|
|
|
{ "show_dot_files", NULL, &panels_options.show_dot_files },
|
|
|
|
{ "fast_reload", NULL, &panels_options.fast_reload },
|
2010-03-28 11:49:23 +04:00
|
|
|
{ "fast_reload_msg_shown", NULL, &panels_options.fast_reload_msg_shown },
|
2010-03-20 19:04:07 +03:00
|
|
|
{ "mark_moves_down", NULL, &panels_options.mark_moves_down },
|
2010-03-28 11:49:23 +04:00
|
|
|
{ "reverse_files_only", NULL, &panels_options.reverse_files_only },
|
|
|
|
{ "auto_save_setup_panels", "auto_save_setup", &panels_options.auto_save_setup },
|
2010-03-20 19:04:07 +03:00
|
|
|
{ "navigate_with_arrows", NULL, &panels_options.navigate_with_arrows },
|
|
|
|
{ "panel_scroll_pages", "scroll_pages", &panels_options.scroll_pages },
|
|
|
|
{ "mouse_move_pages", NULL, &panels_options.mouse_move_pages },
|
|
|
|
{ "filetype_mode", NULL, &panels_options.filetype_mode },
|
|
|
|
{ "permission_mode", NULL, &panels_options.permission_mode },
|
|
|
|
{ NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
/* *INDENT-ON* */
|
|
|
|
|
|
|
|
static const char *panels_section = "Panels";
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** file scope functions ************************************************************************/
|
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
/**
|
|
|
|
Get name of config file.
|
2009-05-20 16:34:33 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
\param subdir
|
2010-03-09 22:03:51 +03:00
|
|
|
if not NULL, then config also search into specified subdir.
|
2009-05-27 19:44:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
\param config_file_name
|
|
|
|
If specified filename is relative, then will search in standart patches.
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
\return
|
2010-03-09 22:03:51 +03:00
|
|
|
Newly allocated path to config name or NULL if file not found.
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
If config_file_name is a relative path, then search config in stantart pathes.
|
|
|
|
*/
|
2010-03-13 13:06:36 +03:00
|
|
|
static char *
|
|
|
|
load_setup_get_full_config_name (const char *subdir, const char *config_file_name)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
TODO: IMHO, in future this function must be placed into mc_config module.
|
|
|
|
Also, need to rename stupid mc_home and mc_home_alt to mc_sysconfdir and mc_datadir;
|
|
|
|
home_mc => mc_user_homedir
|
|
|
|
*/
|
|
|
|
char *lc_basename, *ret;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (config_file_name == NULL)
|
|
|
|
return NULL;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (g_path_is_absolute (config_file_name))
|
|
|
|
return g_strdup (config_file_name);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
lc_basename = g_path_get_basename (config_file_name);
|
|
|
|
if (lc_basename == NULL)
|
|
|
|
return NULL;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (subdir != NULL)
|
|
|
|
ret = g_build_filename (home_dir, MC_USERCONF_DIR, subdir, lc_basename, NULL);
|
|
|
|
else
|
|
|
|
ret = g_build_filename (home_dir, MC_USERCONF_DIR, lc_basename, NULL);
|
|
|
|
|
|
|
|
if (exist_file (ret))
|
2010-02-26 12:25:53 +03:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
g_free (lc_basename);
|
|
|
|
return ret;
|
2009-05-19 11:22:24 +04:00
|
|
|
}
|
2010-03-13 13:06:36 +03:00
|
|
|
g_free (ret);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (subdir != NULL)
|
|
|
|
ret = g_build_filename (mc_home, subdir, lc_basename, NULL);
|
|
|
|
else
|
|
|
|
ret = g_build_filename (mc_home, lc_basename, NULL);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (exist_file (ret))
|
|
|
|
{
|
|
|
|
g_free (lc_basename);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
g_free (ret);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (subdir != NULL)
|
|
|
|
ret = g_build_filename (mc_home_alt, subdir, lc_basename, NULL);
|
|
|
|
else
|
|
|
|
ret = g_build_filename (mc_home_alt, lc_basename, NULL);
|
2005-09-07 12:55:31 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
g_free (lc_basename);
|
2009-05-11 13:46:23 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (exist_file (ret))
|
|
|
|
return ret;
|
2009-05-19 11:22:24 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
g_free (ret);
|
|
|
|
return NULL;
|
2009-10-27 13:14:32 +03:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
static const char *
|
|
|
|
setup__is_cfg_group_must_panel_config (const char *grp)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
return (!strcasecmp ("Dirs", grp) ||
|
2010-03-09 22:03:51 +03:00
|
|
|
!strcasecmp ("Temporal:New Right Panel", grp) ||
|
|
|
|
!strcasecmp ("Temporal:New Left Panel", grp) ||
|
|
|
|
!strcasecmp ("New Left Panel", grp) || !strcasecmp ("New Right Panel", grp))
|
2010-03-13 13:06:36 +03:00
|
|
|
? grp : NULL;
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
static void
|
|
|
|
setup__move_panels_config_into_separate_file (const char *profile)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
mc_config_t *tmp_cfg;
|
|
|
|
char **groups, **curr_grp;
|
|
|
|
const char *need_grp;
|
2009-05-11 13:46:23 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (!exist_file (profile))
|
2010-02-26 12:25:53 +03:00
|
|
|
return;
|
2010-02-15 14:14:01 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
tmp_cfg = mc_config_init (profile);
|
|
|
|
if (!tmp_cfg)
|
2010-02-26 12:25:53 +03:00
|
|
|
return;
|
2009-12-24 14:19:36 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
curr_grp = groups = mc_config_get_groups (tmp_cfg, NULL);
|
|
|
|
if (!groups)
|
|
|
|
{
|
|
|
|
mc_config_deinit (tmp_cfg);
|
|
|
|
return;
|
|
|
|
}
|
2009-05-20 16:34:33 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
while (*curr_grp)
|
|
|
|
{
|
|
|
|
if (setup__is_cfg_group_must_panel_config (*curr_grp) == NULL)
|
|
|
|
mc_config_del_group (tmp_cfg, *curr_grp);
|
|
|
|
curr_grp++;
|
|
|
|
}
|
2009-10-04 20:09:06 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
mc_config_save_to_file (tmp_cfg, panels_profile_name, NULL);
|
|
|
|
mc_config_deinit (tmp_cfg);
|
2009-05-20 16:34:33 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
tmp_cfg = mc_config_init (profile);
|
|
|
|
if (!tmp_cfg)
|
|
|
|
{
|
|
|
|
g_strfreev (groups);
|
|
|
|
return;
|
|
|
|
}
|
2009-05-20 17:39:00 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
curr_grp = groups;
|
2009-05-20 17:39:00 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
while (*curr_grp)
|
|
|
|
{
|
|
|
|
need_grp = setup__is_cfg_group_must_panel_config (*curr_grp);
|
|
|
|
if (need_grp != NULL)
|
|
|
|
{
|
|
|
|
mc_config_del_group (tmp_cfg, need_grp);
|
|
|
|
}
|
|
|
|
curr_grp++;
|
|
|
|
}
|
|
|
|
g_strfreev (groups);
|
|
|
|
|
|
|
|
mc_config_save_file (tmp_cfg, NULL);
|
|
|
|
mc_config_deinit (tmp_cfg);
|
2009-05-11 13:46:23 +04:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
2010-03-13 13:06:36 +03:00
|
|
|
/**
|
|
|
|
Create new mc_config object from specified ini-file or
|
|
|
|
append data to existing mc_config object from ini-file
|
2009-05-19 11:22:24 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
*/
|
2010-11-10 14:09:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
static void
|
|
|
|
load_setup_init_config_from_file (mc_config_t ** config, const char *fname)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
TODO: IMHO, in future this function must be placed into mc_config module.
|
|
|
|
*/
|
|
|
|
if (exist_file (fname))
|
|
|
|
{
|
|
|
|
if (*config != NULL)
|
|
|
|
mc_config_read_file (*config, fname);
|
|
|
|
else
|
|
|
|
*config = mc_config_init (fname);
|
|
|
|
}
|
|
|
|
}
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
static void
|
|
|
|
load_layout (void)
|
|
|
|
{
|
|
|
|
size_t i;
|
2001-06-20 19:08:18 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
for (i = 0; layout[i].opt_name != NULL; i++)
|
|
|
|
*layout[i].opt_addr = mc_config_get_int (mc_main_config, "Layout",
|
2010-03-09 22:03:51 +03:00
|
|
|
layout[i].opt_name, *layout[i].opt_addr);
|
2010-03-13 13:06:36 +03:00
|
|
|
}
|
2009-05-20 16:34:33 +04:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
static void
|
|
|
|
load_keys_from_section (const char *terminal, mc_config_t * cfg)
|
|
|
|
{
|
|
|
|
char *section_name;
|
|
|
|
gchar **profile_keys, **keys;
|
|
|
|
gchar **values, **curr_values;
|
|
|
|
char *valcopy, *value;
|
|
|
|
long key_code;
|
|
|
|
gsize len, values_len;
|
2001-06-20 19:08:18 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (terminal == NULL)
|
|
|
|
return;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
section_name = g_strconcat ("terminal:", terminal, (char *) NULL);
|
|
|
|
profile_keys = keys = mc_config_get_keys (cfg, section_name, &len);
|
2001-06-06 02:49:15 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
while (*profile_keys != NULL)
|
|
|
|
{
|
|
|
|
/* copy=other causes all keys from [terminal:other] to be loaded. */
|
2010-04-25 18:56:14 +04:00
|
|
|
if (g_ascii_strcasecmp (*profile_keys, "copy") == 0)
|
2010-02-26 12:25:53 +03:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
valcopy = mc_config_get_string (cfg, section_name, *profile_keys, "");
|
|
|
|
load_keys_from_section (valcopy, cfg);
|
|
|
|
g_free (valcopy);
|
|
|
|
profile_keys++;
|
|
|
|
continue;
|
2010-02-26 12:25:53 +03:00
|
|
|
}
|
2001-09-16 05:10:09 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
curr_values = values =
|
|
|
|
mc_config_get_string_list (cfg, section_name, *profile_keys, &values_len);
|
2009-05-19 11:22:24 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
key_code = lookup_key (*profile_keys, NULL);
|
2009-05-19 11:22:24 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (key_code != 0)
|
2010-02-26 12:25:53 +03:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
if (curr_values != NULL)
|
|
|
|
{
|
|
|
|
while (*curr_values != NULL)
|
|
|
|
{
|
|
|
|
valcopy = convert_controls (*curr_values);
|
|
|
|
define_sequence (key_code, valcopy, MCKEY_NOACTION);
|
|
|
|
g_free (valcopy);
|
|
|
|
curr_values++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value = mc_config_get_string (cfg, section_name, *profile_keys, "");
|
|
|
|
valcopy = convert_controls (value);
|
|
|
|
define_sequence (key_code, valcopy, MCKEY_NOACTION);
|
|
|
|
g_free (valcopy);
|
|
|
|
g_free (value);
|
|
|
|
}
|
2010-02-26 12:25:53 +03:00
|
|
|
}
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
profile_keys++;
|
|
|
|
|
|
|
|
if (values != NULL)
|
|
|
|
g_strfreev (values);
|
|
|
|
}
|
|
|
|
g_strfreev (keys);
|
|
|
|
g_free (section_name);
|
2009-05-27 19:44:42 +04:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2009-05-27 19:44:42 +04:00
|
|
|
static void
|
2010-03-13 13:06:36 +03:00
|
|
|
load_keymap_from_section (const char *section_name, GArray * keymap, mc_config_t * cfg)
|
2009-05-27 19:44:42 +04:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
gchar **profile_keys, **keys;
|
|
|
|
gchar **values, **curr_values;
|
|
|
|
char *valcopy, *value;
|
|
|
|
int action;
|
|
|
|
gsize len, values_len;
|
2009-05-27 19:44:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (section_name == NULL)
|
2009-05-27 19:44:42 +04:00
|
|
|
return;
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
profile_keys = keys = mc_config_get_keys (cfg, section_name, &len);
|
2009-05-27 19:44:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
while (*profile_keys != NULL)
|
2009-05-27 19:44:42 +04:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
curr_values = values =
|
|
|
|
mc_config_get_string_list (cfg, section_name, *profile_keys, &values_len);
|
2009-05-27 19:44:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
action = lookup_action (*profile_keys);
|
2009-05-27 19:44:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (action > 0)
|
2009-05-27 19:44:42 +04:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
if (curr_values != NULL)
|
|
|
|
{
|
|
|
|
while (*curr_values != NULL)
|
|
|
|
{
|
|
|
|
valcopy = convert_controls (*curr_values);
|
|
|
|
keybind_cmd_bind (keymap, valcopy, action);
|
|
|
|
g_free (valcopy);
|
|
|
|
curr_values++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value = mc_config_get_string (cfg, section_name, *profile_keys, "");
|
|
|
|
valcopy = convert_controls (value);
|
|
|
|
/* define_sequence (key_code, valcopy, MCKEY_NOACTION); */
|
|
|
|
g_free (valcopy);
|
|
|
|
g_free (value);
|
|
|
|
}
|
2009-05-27 19:44:42 +04:00
|
|
|
}
|
2009-09-15 16:48:30 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
profile_keys++;
|
2009-09-15 16:48:30 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (values != NULL)
|
|
|
|
g_strfreev (values);
|
2009-09-15 16:48:30 +04:00
|
|
|
}
|
2010-03-13 13:06:36 +03:00
|
|
|
g_strfreev (keys);
|
2009-09-15 16:48:30 +04:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2009-09-15 16:48:30 +04:00
|
|
|
static mc_config_t *
|
2010-02-26 12:25:53 +03:00
|
|
|
load_setup_get_keymap_profile_config (void)
|
2009-09-15 16:48:30 +04:00
|
|
|
{
|
|
|
|
/*
|
2010-02-26 12:25:53 +03:00
|
|
|
TODO: IMHO, in future this function must be placed into mc_config module.
|
|
|
|
*/
|
|
|
|
mc_config_t *keymap_config = NULL;
|
2009-09-15 16:48:30 +04:00
|
|
|
char *fname, *fname2;
|
|
|
|
|
|
|
|
/* 1) /usr/share/mc (mc_home_alt) */
|
|
|
|
fname = g_build_filename (mc_home_alt, GLOBAL_KEYMAP_FILE, NULL);
|
2010-02-26 12:25:53 +03:00
|
|
|
load_setup_init_config_from_file (&keymap_config, fname);
|
|
|
|
g_free (fname);
|
2009-09-15 16:48:30 +04:00
|
|
|
|
|
|
|
/* 2) /etc/mc (mc_home) */
|
|
|
|
fname = g_build_filename (mc_home, GLOBAL_KEYMAP_FILE, NULL);
|
2010-02-26 12:25:53 +03:00
|
|
|
load_setup_init_config_from_file (&keymap_config, fname);
|
|
|
|
g_free (fname);
|
2009-09-15 16:48:30 +04:00
|
|
|
|
|
|
|
/* 3) ~/.mc (home_dir?) */
|
|
|
|
fname = g_build_filename (home_dir, MC_USERCONF_DIR, GLOBAL_KEYMAP_FILE, NULL);
|
2010-02-26 12:25:53 +03:00
|
|
|
load_setup_init_config_from_file (&keymap_config, fname);
|
|
|
|
g_free (fname);
|
2009-09-15 16:48:30 +04:00
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
/* 4) main config; [Midnight Commander] -> keymap */
|
2009-09-15 16:48:30 +04:00
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
fname2 =
|
|
|
|
mc_config_get_string (mc_main_config, CONFIG_APP_SECTION, "keymap", GLOBAL_KEYMAP_FILE);
|
|
|
|
fname = load_setup_get_full_config_name (NULL, fname2);
|
2010-03-13 13:06:36 +03:00
|
|
|
if (fname != NULL)
|
2009-09-15 16:48:30 +04:00
|
|
|
{
|
2010-02-26 12:25:53 +03:00
|
|
|
load_setup_init_config_from_file (&keymap_config, fname);
|
|
|
|
g_free (fname);
|
2009-09-15 16:48:30 +04:00
|
|
|
}
|
2010-02-26 12:25:53 +03:00
|
|
|
g_free (fname2);
|
2009-09-15 16:48:30 +04:00
|
|
|
|
|
|
|
/* 5) getenv("MC_KEYMAP") */
|
2010-02-26 12:25:53 +03:00
|
|
|
fname = load_setup_get_full_config_name (NULL, g_getenv ("MC_KEYMAP"));
|
2010-03-13 13:06:36 +03:00
|
|
|
if (fname != NULL)
|
2009-09-15 16:48:30 +04:00
|
|
|
{
|
2010-02-26 12:25:53 +03:00
|
|
|
load_setup_init_config_from_file (&keymap_config, fname);
|
|
|
|
g_free (fname);
|
2009-09-15 16:48:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 6) --keymap=<keymap> */
|
2010-02-26 12:25:53 +03:00
|
|
|
fname = load_setup_get_full_config_name (NULL, mc_args__keymap_file);
|
2010-03-13 13:06:36 +03:00
|
|
|
if (fname != NULL)
|
2009-09-15 16:48:30 +04:00
|
|
|
{
|
2010-02-26 12:25:53 +03:00
|
|
|
load_setup_init_config_from_file (&keymap_config, fname);
|
|
|
|
g_free (fname);
|
2009-09-15 16:48:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return keymap_config;
|
|
|
|
}
|
2009-09-04 17:31:38 +04:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
static panel_view_mode_t
|
|
|
|
setup__load_panel_state (const char *section)
|
|
|
|
{
|
|
|
|
char *buffer;
|
|
|
|
size_t i;
|
|
|
|
panel_view_mode_t mode = view_listing;
|
|
|
|
|
|
|
|
/* Load the display mode */
|
|
|
|
buffer = mc_config_get_string (mc_panels_config, section, "display", "listing");
|
|
|
|
|
|
|
|
for (i = 0; panel_types[i].opt_name != NULL; i++)
|
2010-04-25 18:56:14 +04:00
|
|
|
if (g_ascii_strcasecmp (panel_types[i].opt_name, buffer) == 0)
|
2010-03-13 13:06:36 +03:00
|
|
|
{
|
|
|
|
mode = panel_types[i].opt_type;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (buffer);
|
|
|
|
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
static void
|
|
|
|
panel_save_type (const char *section, panel_view_mode_t type)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
for (i = 0; panel_types[i].opt_name != NULL; i++)
|
|
|
|
if (panel_types[i].opt_type == type)
|
|
|
|
{
|
|
|
|
mc_config_set_string (mc_panels_config, section, "display", panel_types[i].opt_name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2010-03-09 22:03:51 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
/*** public functions ****************************************************************************/
|
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
2010-03-13 13:06:36 +03:00
|
|
|
|
2009-05-19 11:22:24 +04:00
|
|
|
char *
|
1999-02-17 06:00:27 +03:00
|
|
|
setup_init (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
2010-02-26 12:25:53 +03:00
|
|
|
char *profile;
|
|
|
|
char *inifile;
|
1999-02-17 06:00:27 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (profile_name != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
return profile_name;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2009-10-05 18:32:46 +04:00
|
|
|
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
2010-02-26 12:25:53 +03:00
|
|
|
if (!exist_file (profile))
|
|
|
|
{
|
|
|
|
inifile = concat_dir_and_file (mc_home, "mc.ini");
|
|
|
|
if (exist_file (inifile))
|
|
|
|
{
|
|
|
|
g_free (profile);
|
|
|
|
profile = inifile;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_free (inifile);
|
|
|
|
inifile = concat_dir_and_file (mc_home_alt, "mc.ini");
|
|
|
|
if (exist_file (inifile))
|
|
|
|
{
|
|
|
|
g_free (profile);
|
|
|
|
profile = inifile;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
g_free (inifile);
|
|
|
|
}
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2009-05-19 11:22:24 +04:00
|
|
|
profile_name = profile;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2009-05-19 11:22:24 +04:00
|
|
|
return profile;
|
1999-02-17 06:00:27 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
1999-02-17 06:00:27 +03:00
|
|
|
void
|
|
|
|
load_setup (void)
|
|
|
|
{
|
2009-05-19 11:22:24 +04:00
|
|
|
char *profile;
|
2010-03-13 13:06:36 +03:00
|
|
|
size_t i;
|
2009-05-20 16:34:33 +04:00
|
|
|
char *buffer;
|
2010-03-28 17:11:27 +04:00
|
|
|
const char *kt;
|
2010-09-09 10:56:51 +04:00
|
|
|
|
2010-09-16 13:39:29 +04:00
|
|
|
#ifdef HAVE_CHARSET
|
|
|
|
load_codepages_list ();
|
2010-09-09 10:56:51 +04:00
|
|
|
#endif /* HAVE_CHARSET */
|
1999-02-17 06:00:27 +03:00
|
|
|
|
2009-05-19 11:22:24 +04:00
|
|
|
profile = setup_init ();
|
2002-08-17 05:11:21 +04:00
|
|
|
|
|
|
|
/* mc.lib is common for all users, but has priority lower than
|
|
|
|
~/.mc/ini. FIXME: it's only used for keys and treestore now */
|
2010-09-16 09:50:22 +04:00
|
|
|
global_profile_name = g_build_filename (mc_home, MC_GLOBAL_CONFIG_FILE, (char *) NULL);
|
2010-02-26 12:25:53 +03:00
|
|
|
if (!exist_file (global_profile_name))
|
|
|
|
{
|
|
|
|
g_free (global_profile_name);
|
2010-09-16 09:50:22 +04:00
|
|
|
global_profile_name = g_build_filename (mc_home_alt, MC_GLOBAL_CONFIG_FILE, (char *) NULL);
|
2009-05-21 02:01:10 +04:00
|
|
|
}
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2009-10-05 18:32:46 +04:00
|
|
|
panels_profile_name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_PANELS_FILE, NULL);
|
2009-05-20 16:34:33 +04:00
|
|
|
|
2010-02-05 14:02:47 +03:00
|
|
|
mc_main_config = mc_config_init (profile);
|
2009-05-27 19:44:42 +04:00
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
if (!exist_file (panels_profile_name))
|
2010-02-05 14:02:47 +03:00
|
|
|
setup__move_panels_config_into_separate_file (profile);
|
2009-05-27 19:44:42 +04:00
|
|
|
|
2010-02-05 14:02:47 +03:00
|
|
|
mc_panels_config = mc_config_init (panels_profile_name);
|
2009-05-21 02:01:10 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Load integer boolean options */
|
2010-03-13 13:06:36 +03:00
|
|
|
for (i = 0; int_options[i].opt_name != NULL; i++)
|
2010-02-26 12:25:53 +03:00
|
|
|
*int_options[i].opt_addr =
|
|
|
|
mc_config_get_int (mc_main_config, CONFIG_APP_SECTION, int_options[i].opt_name,
|
|
|
|
*int_options[i].opt_addr);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-06-12 16:26:27 +04:00
|
|
|
if (option_tab_spacing <= 0)
|
|
|
|
option_tab_spacing = DEFAULT_TAB_SPACING;
|
|
|
|
|
|
|
|
#ifdef USE_INTERNAL_EDIT
|
|
|
|
if (option_word_wrap_line_length <= 0)
|
|
|
|
option_word_wrap_line_length = DEFAULT_WRAP_LINE_LENGTH;
|
|
|
|
#endif /* USE_INTERNAL_EDIT */
|
|
|
|
|
2010-03-28 17:11:27 +04:00
|
|
|
/* overwrite old_esc_mode_timeout */
|
|
|
|
kt = getenv ("KEYBOARD_KEY_TIMEOUT_US");
|
|
|
|
if ((kt != NULL) && (kt[0] != '\0'))
|
|
|
|
old_esc_mode_timeout = atoi (kt);
|
|
|
|
|
2005-09-07 12:55:31 +04:00
|
|
|
/* Load string options */
|
|
|
|
for (i = 0; str_options[i].opt_name != NULL; i++)
|
2010-02-26 12:25:53 +03:00
|
|
|
*str_options[i].opt_addr =
|
|
|
|
mc_config_get_string (mc_main_config, CONFIG_APP_SECTION, str_options[i].opt_name,
|
|
|
|
str_options[i].opt_defval);
|
2005-09-07 12:55:31 +04:00
|
|
|
|
2009-05-20 16:34:33 +04:00
|
|
|
load_layout ();
|
2010-03-09 22:03:51 +03:00
|
|
|
panels_load_options ();
|
1998-02-27 07:54:42 +03:00
|
|
|
load_panelize ();
|
|
|
|
|
2009-05-20 16:34:33 +04:00
|
|
|
startup_left_mode = setup__load_panel_state ("New Left Panel");
|
|
|
|
startup_right_mode = setup__load_panel_state ("New Right Panel");
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
/* At least one of the panels is a listing panel */
|
2009-12-31 21:46:02 +03:00
|
|
|
if (startup_left_mode != view_listing && startup_right_mode != view_listing)
|
2010-02-26 12:25:53 +03:00
|
|
|
startup_left_mode = view_listing;
|
|
|
|
|
2010-03-21 13:57:33 +03:00
|
|
|
if (mc_run_param1 == NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
{
|
|
|
|
buffer = mc_config_get_string (mc_panels_config, "Dirs", "other_dir", ".");
|
|
|
|
if (vfs_file_is_local (buffer))
|
2010-03-21 13:57:33 +03:00
|
|
|
mc_run_param1 = buffer;
|
2010-02-26 12:25:53 +03:00
|
|
|
else
|
|
|
|
g_free (buffer);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
2001-06-20 19:08:18 +04:00
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
boot_current_is_left = mc_config_get_int (mc_panels_config, "Dirs", "current_is_left", 1);
|
2001-06-20 19:08:18 +04:00
|
|
|
|
2009-11-25 14:04:51 +03:00
|
|
|
/* Load time formats */
|
2010-02-26 12:25:53 +03:00
|
|
|
user_recent_timeformat =
|
|
|
|
mc_config_get_string (mc_main_config, "Misc", "timeformat_recent", FMTTIME);
|
2009-11-25 14:04:51 +03:00
|
|
|
user_old_timeformat = mc_config_get_string (mc_main_config, "Misc", "timeformat_old", FMTYEAR);
|
|
|
|
|
2010-07-13 15:58:44 +04:00
|
|
|
#ifdef ENABLE_VFS_FTP
|
2010-02-05 14:02:47 +03:00
|
|
|
ftpfs_proxy_host = mc_config_get_string (mc_main_config, "Misc", "ftp_proxy_host", "gate");
|
2010-07-13 15:58:44 +04:00
|
|
|
ftpfs_ignore_chattr_errors = mc_config_get_bool (mc_main_config, CONFIG_APP_SECTION,
|
|
|
|
"ignore_ftp_chattr_errors", TRUE);
|
|
|
|
ftpfs_init_passwd ();
|
|
|
|
#endif /* ENABLE_VFS_FTP */
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* The default color and the terminal dependent color */
|
2010-02-05 14:02:47 +03:00
|
|
|
setup_color_string = mc_config_get_string (mc_main_config, "Colors", "base_color", "");
|
|
|
|
term_color_string = mc_config_get_string (mc_main_config, "Colors", getenv ("TERM"), "");
|
|
|
|
color_terminal_string = mc_config_get_string (mc_main_config, "Colors", "color_terminals", "");
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
/* Load the directory history */
|
2010-02-26 12:25:53 +03:00
|
|
|
/* directory_history_load (); */
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Remove the temporal entries */
|
2001-06-06 02:49:15 +04:00
|
|
|
|
|
|
|
#ifdef HAVE_CHARSET
|
2010-09-16 13:39:29 +04:00
|
|
|
if (codepages->len > 1)
|
2010-02-26 12:25:53 +03:00
|
|
|
{
|
|
|
|
buffer = mc_config_get_string (mc_main_config, "Misc", "display_codepage", "");
|
|
|
|
if (buffer[0] != '\0')
|
|
|
|
{
|
|
|
|
display_codepage = get_codepage_index (buffer);
|
|
|
|
cp_display = get_codepage_id (display_codepage);
|
|
|
|
}
|
|
|
|
g_free (buffer);
|
|
|
|
buffer = mc_config_get_string (mc_main_config, "Misc", "source_codepage", "");
|
|
|
|
if (buffer[0] != '\0')
|
|
|
|
{
|
|
|
|
default_source_codepage = get_codepage_index (buffer);
|
2010-09-09 10:56:51 +04:00
|
|
|
source_codepage = default_source_codepage; /* May be source_codepage doesn't need this */
|
2010-02-26 12:25:53 +03:00
|
|
|
cp_source = get_codepage_id (source_codepage);
|
|
|
|
}
|
|
|
|
g_free (buffer);
|
2001-06-08 00:47:36 +04:00
|
|
|
}
|
2010-02-05 14:02:47 +03:00
|
|
|
|
|
|
|
autodetect_codeset = mc_config_get_string (mc_main_config, "Misc", "autodetect_codeset", "");
|
2010-03-13 13:06:36 +03:00
|
|
|
if ((autodetect_codeset[0] != '\0') && (strcmp (autodetect_codeset, "off") != 0))
|
2010-02-26 12:25:53 +03:00
|
|
|
is_autodetect_codeset_enabled = TRUE;
|
2010-02-05 14:02:47 +03:00
|
|
|
|
2010-03-31 14:02:45 +04:00
|
|
|
g_free (init_translation_table (source_codepage, display_codepage));
|
2010-03-13 13:06:36 +03:00
|
|
|
buffer = (char *) get_codepage_id (display_codepage);
|
|
|
|
if (buffer != NULL)
|
|
|
|
utf8_display = str_isutf8 (buffer);
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* HAVE_CHARSET */
|
2010-09-09 10:56:51 +04:00
|
|
|
|
2010-07-11 19:08:18 +04:00
|
|
|
clipboard_store_path = mc_config_get_string (mc_main_config, "Misc", "clipboard_store", "");
|
|
|
|
clipboard_paste_path = mc_config_get_string (mc_main_config, "Misc", "clipboard_paste", "");
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
gboolean
|
|
|
|
save_setup (void)
|
|
|
|
{
|
|
|
|
char *tmp_profile;
|
|
|
|
gboolean ret;
|
|
|
|
|
|
|
|
saving_setup = 1;
|
|
|
|
|
|
|
|
save_config ();
|
|
|
|
save_layout ();
|
2010-03-09 22:03:51 +03:00
|
|
|
panels_save_options ();
|
2010-03-13 13:06:36 +03:00
|
|
|
save_hotlist ();
|
|
|
|
save_panelize ();
|
|
|
|
save_panel_types ();
|
|
|
|
/* directory_history_save (); */
|
|
|
|
|
2010-07-13 15:58:44 +04:00
|
|
|
#ifdef ENABLE_VFS_FTP
|
2010-03-13 13:06:36 +03:00
|
|
|
mc_config_set_string (mc_main_config, "Misc", "ftpfs_password", ftpfs_anonymous_passwd);
|
|
|
|
if (ftpfs_proxy_host)
|
|
|
|
mc_config_set_string (mc_main_config, "Misc", "ftp_proxy_host", ftpfs_proxy_host);
|
2010-07-13 15:58:44 +04:00
|
|
|
#endif /* ENABLE_VFS_FTP */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
#ifdef HAVE_CHARSET
|
|
|
|
mc_config_set_string (mc_main_config, "Misc", "display_codepage",
|
|
|
|
get_codepage_id (display_codepage));
|
|
|
|
mc_config_set_string (mc_main_config, "Misc", "source_codepage",
|
|
|
|
get_codepage_id (default_source_codepage));
|
|
|
|
mc_config_set_string (mc_main_config, "Misc", "autodetect_codeset", autodetect_codeset);
|
|
|
|
#endif /* HAVE_CHARSET */
|
2010-07-11 19:08:18 +04:00
|
|
|
mc_config_set_string (mc_main_config, "Misc", "clipboard_store", clipboard_store_path);
|
|
|
|
mc_config_set_string (mc_main_config, "Misc", "clipboard_paste", clipboard_paste_path);
|
2010-06-08 23:23:00 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
tmp_profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
|
|
|
ret = mc_config_save_to_file (mc_main_config, tmp_profile, NULL);
|
2009-05-20 16:34:33 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
g_free (tmp_profile);
|
|
|
|
saving_setup = 0;
|
|
|
|
return ret;
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2009-10-29 22:04:44 +03:00
|
|
|
void
|
|
|
|
done_setup (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
size_t i;
|
2009-10-29 22:04:44 +03:00
|
|
|
|
2009-05-19 11:22:24 +04:00
|
|
|
g_free (profile_name);
|
|
|
|
g_free (global_profile_name);
|
2009-10-29 22:04:44 +03:00
|
|
|
g_free (color_terminal_string);
|
|
|
|
g_free (term_color_string);
|
|
|
|
g_free (setup_color_string);
|
|
|
|
g_free (panels_profile_name);
|
|
|
|
mc_config_deinit (mc_main_config);
|
|
|
|
mc_config_deinit (mc_panels_config);
|
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
g_free (user_recent_timeformat);
|
|
|
|
g_free (user_old_timeformat);
|
2009-11-25 14:04:51 +03:00
|
|
|
|
2009-10-29 22:04:44 +03:00
|
|
|
for (i = 0; str_options[i].opt_name != NULL; i++)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_free (*str_options[i].opt_addr);
|
2009-10-29 22:04:44 +03:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
done_hotlist ();
|
|
|
|
done_panelize ();
|
2010-02-26 12:25:53 +03:00
|
|
|
/* directory_history_free (); */
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
void
|
|
|
|
save_config (void)
|
2009-05-19 11:22:24 +04:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
char *profile;
|
|
|
|
GError *error = NULL;
|
|
|
|
size_t i;
|
2009-05-19 11:22:24 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
2009-05-19 11:22:24 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
/* Save integer options */
|
|
|
|
for (i = 0; int_options[i].opt_name != NULL; i++)
|
|
|
|
mc_config_set_int (mc_main_config, CONFIG_APP_SECTION, int_options[i].opt_name,
|
|
|
|
*int_options[i].opt_addr);
|
2009-05-20 16:34:33 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
/* Save string options */
|
|
|
|
for (i = 0; str_options[i].opt_name != NULL; i++)
|
|
|
|
mc_config_set_string (mc_main_config, CONFIG_APP_SECTION, str_options[i].opt_name,
|
|
|
|
*str_options[i].opt_addr);
|
2010-02-26 12:25:53 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if (!mc_config_save_to_file (mc_main_config, profile, &error))
|
|
|
|
setup_save_config_show_error (profile, &error);
|
2010-02-26 12:25:53 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
g_free (profile);
|
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
void
|
|
|
|
setup_save_config_show_error (const char *filename, GError ** error)
|
|
|
|
{
|
|
|
|
if (error != NULL && *error != NULL)
|
|
|
|
{
|
|
|
|
message (D_ERROR, MSG_ERROR, _("Cannot save file %s:\n%s"), filename, (*error)->message);
|
|
|
|
g_error_free (*error);
|
|
|
|
*error = NULL;
|
2009-05-19 11:22:24 +04:00
|
|
|
}
|
2010-03-13 13:06:36 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
void
|
|
|
|
save_layout (void)
|
|
|
|
{
|
|
|
|
char *profile;
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
|
|
|
/* Save integer options */
|
|
|
|
for (i = 0; layout[i].opt_name != NULL; i++)
|
|
|
|
mc_config_set_int (mc_main_config, "Layout", layout[i].opt_name, *layout[i].opt_addr);
|
|
|
|
mc_config_save_to_file (mc_main_config, profile, NULL);
|
|
|
|
g_free (profile);
|
2009-05-19 11:22:24 +04:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
void
|
|
|
|
load_key_defs (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
2001-07-22 10:00:30 +04:00
|
|
|
/*
|
|
|
|
* Load keys from mc.lib before ~/.mc/ini, so that the user
|
|
|
|
* definitions override global settings.
|
|
|
|
*/
|
2009-05-20 16:34:33 +04:00
|
|
|
mc_config_t *mc_global_config;
|
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
mc_global_config = mc_config_init (global_profile_name);
|
2009-05-20 16:34:33 +04:00
|
|
|
if (mc_global_config != NULL)
|
|
|
|
{
|
|
|
|
load_keys_from_section ("general", mc_global_config);
|
|
|
|
load_keys_from_section (getenv ("TERM"), mc_global_config);
|
2010-02-26 12:25:53 +03:00
|
|
|
mc_config_deinit (mc_global_config);
|
2009-05-20 16:34:33 +04:00
|
|
|
}
|
2010-03-13 13:06:36 +03:00
|
|
|
|
2009-05-20 16:34:33 +04:00
|
|
|
load_keys_from_section ("general", mc_main_config);
|
|
|
|
load_keys_from_section (getenv ("TERM"), mc_main_config);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-07-13 15:58:44 +04:00
|
|
|
#ifdef ENABLE_VFS_FTP
|
2010-03-13 13:06:36 +03:00
|
|
|
char *
|
|
|
|
load_anon_passwd (void)
|
2009-07-05 19:04:42 +04:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
char *buffer;
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
buffer = mc_config_get_string (mc_main_config, "Misc", "ftpfs_password", "");
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
if ((buffer != NULL) && (buffer[0] != '\0'))
|
|
|
|
return buffer;
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
g_free (buffer);
|
|
|
|
return NULL;
|
2009-07-05 19:04:42 +04:00
|
|
|
}
|
2010-07-13 15:58:44 +04:00
|
|
|
#endif /* ENABLE_VFS_FTP */
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2009-07-05 19:04:42 +04:00
|
|
|
void
|
|
|
|
load_keymap_defs (void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Load keymap from GLOBAL_KEYMAP_FILE before ~/.mc/keymap, so that the user
|
|
|
|
* definitions override global settings.
|
|
|
|
*/
|
|
|
|
mc_config_t *mc_global_keymap;
|
|
|
|
|
2010-02-26 12:25:53 +03:00
|
|
|
mc_global_keymap = load_setup_get_keymap_profile_config ();
|
2009-09-15 16:48:30 +04:00
|
|
|
|
2009-07-05 19:04:42 +04:00
|
|
|
if (mc_global_keymap != NULL)
|
|
|
|
{
|
2009-10-23 10:27:28 +04:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
2009-10-23 21:58:01 +04:00
|
|
|
editor_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
2009-07-05 19:04:42 +04:00
|
|
|
load_keymap_from_section ("editor", editor_keymap, mc_global_keymap);
|
2009-10-23 21:58:01 +04:00
|
|
|
editor_x_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
|
|
|
load_keymap_from_section ("editor:xmap", editor_x_keymap, mc_global_keymap);
|
2009-10-23 10:27:28 +04:00
|
|
|
#endif
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2009-10-23 21:58:01 +04:00
|
|
|
viewer_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
2009-09-11 18:13:17 +04:00
|
|
|
load_keymap_from_section ("viewer", viewer_keymap, mc_global_keymap);
|
2009-10-23 21:58:01 +04:00
|
|
|
viewer_hex_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
2009-09-11 18:13:17 +04:00
|
|
|
load_keymap_from_section ("viewer:hex", viewer_hex_keymap, mc_global_keymap);
|
|
|
|
|
2009-10-23 21:58:01 +04:00
|
|
|
main_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
2009-07-05 19:04:42 +04:00
|
|
|
load_keymap_from_section ("main", main_keymap, mc_global_keymap);
|
2009-10-23 21:58:01 +04:00
|
|
|
main_x_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
2009-07-05 19:04:42 +04:00
|
|
|
load_keymap_from_section ("main:xmap", main_x_keymap, mc_global_keymap);
|
|
|
|
|
2009-10-23 21:58:01 +04:00
|
|
|
panel_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
2009-09-10 17:55:16 +04:00
|
|
|
load_keymap_from_section ("panel", panel_keymap, mc_global_keymap);
|
2009-09-10 19:21:08 +04:00
|
|
|
|
2009-10-23 21:58:01 +04:00
|
|
|
input_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
2009-09-24 16:22:13 +04:00
|
|
|
load_keymap_from_section ("input", input_keymap, mc_global_keymap);
|
2009-09-14 21:13:54 +04:00
|
|
|
|
2010-08-12 13:17:58 +04:00
|
|
|
listbox_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
|
|
|
load_keymap_from_section ("listbox", listbox_keymap, mc_global_keymap);
|
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
tree_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
|
|
|
load_keymap_from_section ("tree", tree_keymap, mc_global_keymap);
|
|
|
|
|
2009-11-07 18:36:44 +03:00
|
|
|
help_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
|
|
|
load_keymap_from_section ("help", help_keymap, mc_global_keymap);
|
|
|
|
|
2010-05-06 23:19:02 +04:00
|
|
|
dialog_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
|
|
|
load_keymap_from_section ("dialog", dialog_keymap, mc_global_keymap);
|
|
|
|
|
2010-03-03 16:09:15 +03:00
|
|
|
#ifdef USE_DIFF_VIEW
|
|
|
|
diff_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t));
|
|
|
|
load_keymap_from_section ("diffviewer", diff_keymap, mc_global_keymap);
|
|
|
|
#endif
|
2009-10-23 21:58:01 +04:00
|
|
|
mc_config_deinit (mc_global_keymap);
|
2009-07-05 19:04:42 +04:00
|
|
|
}
|
2010-05-06 23:19:02 +04:00
|
|
|
|
|
|
|
main_map = default_main_map;
|
|
|
|
if (main_keymap && main_keymap->len > 0)
|
|
|
|
main_map = (global_keymap_t *) main_keymap->data;
|
|
|
|
|
|
|
|
main_x_map = default_main_x_map;
|
|
|
|
if (main_x_keymap && main_x_keymap->len > 0)
|
|
|
|
main_x_map = (global_keymap_t *) main_x_keymap->data;
|
|
|
|
|
|
|
|
panel_map = default_panel_keymap;
|
|
|
|
if (panel_keymap && panel_keymap->len > 0)
|
|
|
|
panel_map = (global_keymap_t *) panel_keymap->data;
|
|
|
|
|
|
|
|
input_map = default_input_keymap;
|
|
|
|
if (input_keymap && input_keymap->len > 0)
|
|
|
|
input_map = (global_keymap_t *) input_keymap->data;
|
|
|
|
|
2010-08-12 13:17:58 +04:00
|
|
|
listbox_map = default_listbox_keymap;
|
|
|
|
if (listbox_keymap && listbox_keymap->len > 0)
|
|
|
|
listbox_map = (global_keymap_t *) listbox_keymap->data;
|
|
|
|
|
2010-05-06 23:19:02 +04:00
|
|
|
tree_map = default_tree_keymap;
|
|
|
|
if (tree_keymap && tree_keymap->len > 0)
|
|
|
|
tree_map = (global_keymap_t *) tree_keymap->data;
|
|
|
|
|
|
|
|
help_map = default_help_keymap;
|
|
|
|
if (help_keymap && help_keymap->len > 0)
|
|
|
|
help_map = (global_keymap_t *) help_keymap->data;
|
|
|
|
|
|
|
|
dialog_map = default_dialog_keymap;
|
|
|
|
if (dialog_keymap && dialog_keymap->len > 0)
|
|
|
|
dialog_map = (global_keymap_t *) dialog_keymap->data;
|
|
|
|
|
2010-05-08 16:49:53 +04:00
|
|
|
#ifdef USE_DIFF_VIEW
|
|
|
|
diff_map = default_diff_keymap;
|
|
|
|
if (diff_keymap && diff_keymap->len > 0)
|
|
|
|
diff_map = (global_keymap_t *) diff_keymap->data;
|
|
|
|
#endif
|
|
|
|
|
2009-07-05 19:04:42 +04:00
|
|
|
}
|
2009-10-27 13:14:32 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2009-10-29 22:04:44 +03:00
|
|
|
void
|
|
|
|
free_keymap_defs (void)
|
|
|
|
{
|
|
|
|
#ifdef USE_INTERNAL_EDIT
|
2010-01-11 19:10:16 +03:00
|
|
|
if (editor_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (editor_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (editor_x_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (editor_x_keymap, TRUE);
|
2009-10-29 22:04:44 +03:00
|
|
|
#endif
|
2010-01-11 19:10:16 +03:00
|
|
|
if (viewer_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (viewer_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (viewer_hex_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (viewer_hex_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (main_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (main_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (main_x_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (main_x_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (panel_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (panel_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (input_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (input_keymap, TRUE);
|
2010-08-12 13:17:58 +04:00
|
|
|
if (listbox_keymap != NULL)
|
|
|
|
g_array_free (listbox_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (tree_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (tree_keymap, TRUE);
|
2010-01-11 19:10:16 +03:00
|
|
|
if (help_keymap != NULL)
|
2010-02-26 12:25:53 +03:00
|
|
|
g_array_free (help_keymap, TRUE);
|
2010-05-06 23:19:02 +04:00
|
|
|
if (dialog_keymap != NULL)
|
|
|
|
g_array_free (dialog_keymap, TRUE);
|
2010-03-03 16:09:15 +03:00
|
|
|
#ifdef USE_DIFF_VIEW
|
|
|
|
if (diff_keymap != NULL)
|
|
|
|
g_array_free (diff_keymap, TRUE);
|
|
|
|
#endif
|
2009-10-29 22:04:44 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2009-10-27 13:14:32 +03:00
|
|
|
void
|
2010-03-13 13:06:36 +03:00
|
|
|
panel_load_setup (WPanel * panel, const char *section)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
char *buffer, buffer2[BUF_TINY];
|
|
|
|
|
|
|
|
panel->reverse = mc_config_get_int (mc_panels_config, section, "reverse", 0);
|
|
|
|
panel->case_sensitive =
|
|
|
|
mc_config_get_int (mc_panels_config, section, "case_sensitive",
|
|
|
|
OS_SORT_CASE_SENSITIVE_DEFAULT);
|
|
|
|
panel->exec_first = mc_config_get_int (mc_panels_config, section, "exec_first", 0);
|
|
|
|
|
|
|
|
/* Load sort order */
|
|
|
|
buffer = mc_config_get_string (mc_panels_config, section, "sort_order", "name");
|
|
|
|
panel->current_sort_field = panel_get_field_by_id (buffer);
|
|
|
|
if (panel->current_sort_field == NULL)
|
|
|
|
panel->current_sort_field = panel_get_field_by_id ("name");
|
|
|
|
|
|
|
|
g_free (buffer);
|
|
|
|
|
|
|
|
/* Load the listing mode */
|
|
|
|
buffer = mc_config_get_string (mc_panels_config, section, "list_mode", "full");
|
|
|
|
panel->list_type = list_full;
|
|
|
|
for (i = 0; list_types[i].key != NULL; i++)
|
2010-04-25 18:56:14 +04:00
|
|
|
if (g_ascii_strcasecmp (list_types[i].key, buffer) == 0)
|
2010-03-13 13:06:36 +03:00
|
|
|
{
|
|
|
|
panel->list_type = list_types[i].list_type;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
g_free (buffer);
|
|
|
|
|
|
|
|
/* User formats */
|
|
|
|
g_free (panel->user_format);
|
|
|
|
panel->user_format =
|
|
|
|
mc_config_get_string (mc_panels_config, section, "user_format", DEFAULT_USER_FORMAT);
|
|
|
|
|
|
|
|
for (i = 0; i < LIST_TYPES; i++)
|
|
|
|
{
|
|
|
|
g_free (panel->user_status_format[i]);
|
|
|
|
g_snprintf (buffer2, BUF_TINY, "user_status%lld", (long long) i);
|
|
|
|
panel->user_status_format[i] =
|
|
|
|
mc_config_get_string (mc_panels_config, section, buffer2, DEFAULT_USER_FORMAT);
|
|
|
|
}
|
|
|
|
|
|
|
|
panel->user_mini_status = mc_config_get_int (mc_panels_config, section, "user_mini_status", 0);
|
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
void
|
|
|
|
panel_save_setup (struct WPanel *panel, const char *section)
|
|
|
|
{
|
|
|
|
char buffer[BUF_TINY];
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
mc_config_set_int (mc_panels_config, section, "reverse", panel->reverse);
|
|
|
|
mc_config_set_int (mc_panels_config, section, "case_sensitive", panel->case_sensitive);
|
|
|
|
mc_config_set_int (mc_panels_config, section, "exec_first", panel->exec_first);
|
|
|
|
|
|
|
|
mc_config_set_string (mc_panels_config, section, "sort_order", panel->current_sort_field->id);
|
|
|
|
|
|
|
|
for (i = 0; list_types[i].key != NULL; i++)
|
|
|
|
if (list_types[i].list_type == panel->list_type)
|
|
|
|
{
|
|
|
|
mc_config_set_string (mc_panels_config, section, "list_mode", list_types[i].key);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
mc_config_set_string (mc_panels_config, section, "user_format", panel->user_format);
|
|
|
|
|
|
|
|
for (i = 0; i < LIST_TYPES; i++)
|
|
|
|
{
|
|
|
|
g_snprintf (buffer, BUF_TINY, "user_status%lld", (long long) i);
|
|
|
|
mc_config_set_string (mc_panels_config, section, buffer, panel->user_status_format[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
mc_config_set_int (mc_panels_config, section, "user_mini_status", panel->user_mini_status);
|
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
void
|
|
|
|
save_panel_types (void)
|
2009-10-27 13:14:32 +03:00
|
|
|
{
|
2010-03-13 13:06:36 +03:00
|
|
|
panel_view_mode_t type;
|
|
|
|
|
|
|
|
if (mc_run_mode != MC_RUN_FULL)
|
|
|
|
return;
|
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
if (!panels_options.auto_save_setup)
|
2009-10-27 13:14:32 +03:00
|
|
|
return;
|
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
type = get_display_type (0);
|
|
|
|
panel_save_type ("New Left Panel", type);
|
|
|
|
if (type == view_listing)
|
|
|
|
panel_save_setup (left_panel, left_panel->panel_name);
|
|
|
|
type = get_display_type (1);
|
|
|
|
panel_save_type ("New Right Panel", type);
|
|
|
|
if (type == view_listing)
|
|
|
|
panel_save_setup (right_panel, right_panel->panel_name);
|
|
|
|
|
|
|
|
mc_config_set_string (mc_panels_config, "Dirs", "other_dir", get_panel_dir_for (other_panel));
|
|
|
|
|
|
|
|
if (current_panel != NULL)
|
|
|
|
mc_config_set_string (mc_panels_config, "Dirs", "current_is_left",
|
|
|
|
get_current_index () == 0 ? "1" : "0");
|
|
|
|
|
|
|
|
if (mc_panels_config->ini_path == NULL)
|
|
|
|
mc_panels_config->ini_path = g_strdup (panels_profile_name);
|
|
|
|
|
|
|
|
mc_config_del_group (mc_panels_config, "Temporal:New Left Panel");
|
|
|
|
mc_config_del_group (mc_panels_config, "Temporal:New Right Panel");
|
2009-10-27 13:14:32 +03:00
|
|
|
|
2010-03-13 13:06:36 +03:00
|
|
|
mc_config_save_file (mc_panels_config, NULL);
|
2009-10-27 13:14:32 +03:00
|
|
|
}
|
2010-03-09 22:03:51 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
/**
|
2010-03-20 19:04:07 +03:00
|
|
|
Load panels options from [Panels] section.
|
2010-03-09 22:03:51 +03:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
panels_load_options (void)
|
|
|
|
{
|
2010-03-20 19:04:07 +03:00
|
|
|
size_t i;
|
2010-03-20 20:24:48 +03:00
|
|
|
int qmode;
|
2010-03-09 22:03:51 +03:00
|
|
|
|
|
|
|
/* Backward compatibility: load old parameters */
|
2010-03-20 19:04:07 +03:00
|
|
|
for (i = 0; panels_ini_options[i].opt_name != NULL; i++)
|
|
|
|
*panels_ini_options[i].opt_addr =
|
|
|
|
mc_config_get_int (mc_main_config, CONFIG_APP_SECTION,
|
|
|
|
panels_ini_options[i].opt_old_name != NULL
|
2010-11-10 14:09:42 +03:00
|
|
|
? panels_ini_options[i].
|
|
|
|
opt_old_name : panels_ini_options[i].opt_name,
|
2010-03-20 19:04:07 +03:00
|
|
|
*panels_ini_options[i].opt_addr);
|
2010-03-09 22:03:51 +03:00
|
|
|
|
2010-03-20 20:24:48 +03:00
|
|
|
qmode = mc_config_get_int (mc_main_config, CONFIG_APP_SECTION,
|
2010-11-10 14:09:42 +03:00
|
|
|
"quick_search_case_sensitive", (int) panels_options.qsearch_mode);
|
2010-03-20 20:24:48 +03:00
|
|
|
if (qmode < 0)
|
|
|
|
panels_options.qsearch_mode = QSEARCH_CASE_INSENSITIVE;
|
|
|
|
else if (qmode >= QSEARCH_NUM)
|
|
|
|
panels_options.qsearch_mode = QSEARCH_PANEL_CASE;
|
|
|
|
else
|
|
|
|
panels_options.qsearch_mode = (qsearch_mode_t) qmode;
|
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
/* overwrite by new parameters */
|
2010-03-20 19:04:07 +03:00
|
|
|
if (mc_config_has_group (mc_main_config, panels_section))
|
2010-03-20 20:24:48 +03:00
|
|
|
{
|
2010-03-20 19:04:07 +03:00
|
|
|
for (i = 0; panels_ini_options[i].opt_name != NULL; i++)
|
|
|
|
*panels_ini_options[i].opt_addr =
|
|
|
|
mc_config_get_bool (mc_main_config, panels_section,
|
|
|
|
panels_ini_options[i].opt_name,
|
|
|
|
*panels_ini_options[i].opt_addr);
|
2010-03-20 20:24:48 +03:00
|
|
|
|
|
|
|
qmode = mc_config_get_int (mc_main_config, panels_section,
|
2010-11-10 14:09:42 +03:00
|
|
|
"quick_search_mode", (int) panels_options.qsearch_mode);
|
2010-03-20 20:24:48 +03:00
|
|
|
if (qmode < 0)
|
|
|
|
panels_options.qsearch_mode = QSEARCH_CASE_INSENSITIVE;
|
|
|
|
else if (qmode >= QSEARCH_NUM)
|
|
|
|
panels_options.qsearch_mode = QSEARCH_PANEL_CASE;
|
|
|
|
else
|
|
|
|
panels_options.qsearch_mode = (qsearch_mode_t) qmode;
|
|
|
|
}
|
2010-03-09 22:03:51 +03:00
|
|
|
}
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* --------------------------------------------------------------------------------------------- */
|
|
|
|
|
2010-03-09 22:03:51 +03:00
|
|
|
/**
|
|
|
|
Save panels options in [Panels] section.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
panels_save_options (void)
|
|
|
|
{
|
2010-03-20 19:04:07 +03:00
|
|
|
size_t i;
|
|
|
|
|
|
|
|
for (i = 0; panels_ini_options[i].opt_name != NULL; i++)
|
2010-03-20 20:24:48 +03:00
|
|
|
mc_config_set_bool (mc_main_config, panels_section,
|
2010-03-20 19:04:07 +03:00
|
|
|
panels_ini_options[i].opt_name, *panels_ini_options[i].opt_addr);
|
2010-03-20 20:24:48 +03:00
|
|
|
|
|
|
|
mc_config_set_int (mc_main_config, panels_section,
|
2010-11-10 14:09:42 +03:00
|
|
|
"quick_search_mode", (int) panels_options.qsearch_mode);
|
2010-03-09 22:03:51 +03:00
|
|
|
}
|
2010-11-10 14:09:42 +03:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------- */
|