Ticket #2847: use unrar to view RAR archives if rar is unavailable.
[midnight-commander.git] / src / setup.h
blobec4f6948b4e7fb7f2d9ec7a61da926ddb1c5f486
1 /** \file setup.h
2 * \brief Header: setup loading/saving
3 */
5 #ifndef MC__SETUP_H
6 #define MC__SETUP_H
8 #include <config.h>
10 #include "lib/global.h" /* GError */
12 #include "filemanager/layout.h" /* panel_view_mode_t */
14 /*** typedefs(not structures) and defined constants **********************************************/
16 /* TAB length for editor and viewer */
17 #define DEFAULT_TAB_SPACING 8
19 /*** enums ***************************************************************************************/
21 typedef enum
23 QSEARCH_CASE_INSENSITIVE = 0, /* quick search in case insensitive mode */
24 QSEARCH_CASE_SENSITIVE = 1, /* quick search in case sensitive mode */
25 QSEARCH_PANEL_CASE = 2, /* quick search get value from panel case_sensitive */
26 QSEARCH_NUM
27 } qsearch_mode_t;
29 /*** structures declarations (and typedefs of structures)*****************************************/
31 /* panels ini options; [Panels] section */
32 typedef struct
34 gboolean show_mini_info; /* If true, show the mini-info on the panel */
35 gboolean kilobyte_si; /* If TRUE, SI units (1000 based) will be used for larger units
36 * (kilobyte, megabyte, ...). If FALSE, binary units (1024 based) will be used */
37 gboolean mix_all_files; /* If FALSE then directories are shown separately from files */
38 gboolean show_backups; /* If TRUE, show files ending in ~ */
39 gboolean show_dot_files; /* If TRUE, show files starting with a dot */
40 gboolean fast_reload; /* If TRUE then use stat() on the cwd to determine directory changes */
41 gboolean fast_reload_msg_shown; /* Have we shown the fast-reload warning in the past? */
42 gboolean mark_moves_down; /* If TRUE, marking a files moves the cursor down */
43 gboolean reverse_files_only; /* If TRUE, only selection of files is inverted */
44 gboolean auto_save_setup;
45 gboolean navigate_with_arrows; /* If TRUE: l&r arrows are used to chdir if the input line is empty */
46 gboolean scroll_pages; /* If TRUE, panel is scrolled by half the display when the cursor reaches
47 the end or the beginning of the panel */
48 gboolean mouse_move_pages; /* Scroll page/item using mouse wheel */
49 gboolean filetype_mode; /* If TRUE then add per file type hilighting */
50 gboolean permission_mode; /* If TRUE, we use permission hilighting */
51 qsearch_mode_t qsearch_mode; /* Quick search mode */
52 gboolean torben_fj_mode; /* If TRUE, use some usability hacks by Torben */
53 } panels_options_t;
55 struct WPanel;
57 /*** global variables defined in .c file *********************************************************/
59 /* global paremeters */
60 extern char *profile_name;
61 extern char *global_profile_name;
62 extern int confirm_delete;
63 extern int confirm_directory_hotlist_delete;
64 extern int confirm_execute;
65 extern int confirm_exit;
66 extern int confirm_overwrite;
67 extern int confirm_view_dir;
68 extern int safe_delete;
69 extern int clear_before_exec;
70 extern int auto_menu;
71 extern int drop_menus;
72 extern int verbose;
73 extern int select_flags;
74 extern int setup_copymove_persistent_attr;
75 extern int classic_progressbar;
76 extern int easy_patterns;
77 extern int option_tab_spacing;
78 extern int auto_save_setup;
79 extern int only_leading_plus_minus;
80 extern int cd_symlinks;
81 extern int auto_fill_mkdir_name;
82 extern int output_starts_shell;
83 extern int use_file_to_check_type;
84 extern int file_op_compute_totals;
86 extern panels_options_t panels_options;
88 extern panel_view_mode_t startup_left_mode;
89 extern panel_view_mode_t startup_right_mode;
90 extern gboolean boot_current_is_left;
92 /*** declarations of public functions ************************************************************/
94 char *setup_init (void);
95 void load_setup (void);
96 gboolean save_setup (gboolean save_options, gboolean save_panel_options);
97 void done_setup (void);
98 void save_config (void);
99 void setup_save_config_show_error (const char *filename, GError ** error);
101 void save_layout (void);
103 void load_key_defs (void);
104 #ifdef ENABLE_VFS_FTP
105 char *load_anon_passwd (void);
106 #endif /* ENABLE_VFS_FTP */
108 void load_keymap_defs (gboolean load_from_file);
109 void free_keymap_defs (void);
111 void panel_load_setup (struct WPanel *panel, const char *section);
112 void panel_save_setup (struct WPanel *panel, const char *section);
114 void panels_load_options (void);
115 void panels_save_options (void);
117 /*** inline functions ****************************************************************************/
119 #endif /* MC__SETUP_H */