2 * \brief Header: setup loading/saving
10 #include "lib/global.h" /* GError */
12 #include "filemanager/layout.h" /* panel_view_mode_t */
13 #include "filemanager/panel.h" /* WPanel */
15 /*** typedefs(not structures) and defined constants **********************************************/
17 /* TAB length for editor and viewer */
18 #define DEFAULT_TAB_SPACING 8
20 #define MAX_MACRO_LENGTH 1024
22 /*** enums ***************************************************************************************/
26 QSEARCH_CASE_INSENSITIVE
= 0, /* quick search in case insensitive mode */
27 QSEARCH_CASE_SENSITIVE
= 1, /* quick search in case sensitive mode */
28 QSEARCH_PANEL_CASE
= 2, /* quick search get value from panel case_sensitive */
32 /*** structures declarations (and typedefs of structures)*****************************************/
34 /* panels ini options; [Panels] section */
37 gboolean show_mini_info
; /* If true, show the mini-info on the panel */
38 gboolean kilobyte_si
; /* If TRUE, SI units (1000 based) will be used for larger units
39 * (kilobyte, megabyte, ...). If FALSE, binary units (1024 based) will be used */
40 gboolean mix_all_files
; /* If FALSE then directories are shown separately from files */
41 gboolean show_backups
; /* If TRUE, show files ending in ~ */
42 gboolean show_dot_files
; /* If TRUE, show files starting with a dot */
43 gboolean fast_reload
; /* If TRUE then use stat() on the cwd to determine directory changes */
44 gboolean fast_reload_msg_shown
; /* Have we shown the fast-reload warning in the past? */
45 gboolean mark_moves_down
; /* If TRUE, marking a files moves the cursor down */
46 gboolean reverse_files_only
; /* If TRUE, only selection of files is inverted */
47 gboolean auto_save_setup
;
48 gboolean navigate_with_arrows
; /* If TRUE: l&r arrows are used to chdir if the input line is empty */
49 gboolean scroll_pages
; /* If TRUE, panel is scrolled by half the display when the cursor reaches
50 the end or the beginning of the panel */
51 gboolean mouse_move_pages
; /* Scroll page/item using mouse wheel */
52 gboolean filetype_mode
; /* If TRUE then add per file type hilighting */
53 gboolean permission_mode
; /* If TRUE, we use permission hilighting */
54 qsearch_mode_t qsearch_mode
; /* Quick search mode */
55 gboolean torben_fj_mode
; /* If TRUE, use some usability hacks by Torben */
56 panel_select_flags_t select_flags
; /* Select/unselect file flags */
59 typedef struct macro_action_t
65 typedef struct macros_t
73 /*** global variables defined in .c file *********************************************************/
75 /* global paremeters */
76 extern char *global_profile_name
;
77 extern int confirm_delete
;
78 extern int confirm_directory_hotlist_delete
;
79 extern int confirm_execute
;
80 extern int confirm_exit
;
81 extern int confirm_overwrite
;
82 extern int confirm_view_dir
;
83 extern int safe_delete
;
84 extern int clear_before_exec
;
86 extern int drop_menus
;
88 extern int setup_copymove_persistent_attr
;
89 extern int classic_progressbar
;
90 extern int easy_patterns
;
91 extern int option_tab_spacing
;
92 extern int auto_save_setup
;
93 extern int only_leading_plus_minus
;
94 extern int cd_symlinks
;
95 extern int auto_fill_mkdir_name
;
96 extern int output_starts_shell
;
97 extern int use_file_to_check_type
;
98 extern int file_op_compute_totals
;
99 extern int editor_ask_filename_before_edit
;
101 extern panels_options_t panels_options
;
103 extern panel_view_mode_t startup_left_mode
;
104 extern panel_view_mode_t startup_right_mode
;
105 extern gboolean boot_current_is_left
;
106 extern int use_internal_view
;
107 extern int use_internal_edit
;
110 extern int default_source_codepage
;
111 extern char *autodetect_codeset
;
112 extern gboolean is_autodetect_codeset_enabled
;
113 #endif /* !HAVE_CHARSET */
116 extern char *spell_language
;
119 /* Value of "other_dir" key in ini file */
120 extern char *saved_other_dir
;
122 /* If set, then print to the given file the last directory we were at */
123 extern char *last_wd_string
;
126 /* Set to TRUE to suppress printing the last directory */
127 extern gboolean print_last_revert
;
129 #ifdef USE_INTERNAL_EDIT
130 /* index to record_macro_buf[], -1 if not recording a macro */
131 extern int macro_index
;
134 extern struct macro_action_t record_macro_buf
[MAX_MACRO_LENGTH
];
136 extern GArray
*macros_list
;
137 #endif /* USE_INTERNAL_EDIT */
139 extern int saving_setup
;
141 /*** declarations of public functions ************************************************************/
143 const char *setup_init (void);
144 void load_setup (void);
145 gboolean
save_setup (gboolean save_options
, gboolean save_panel_options
);
146 void done_setup (void);
147 void setup_save_config_show_error (const char *filename
, GError
** mcerror
);
149 void load_key_defs (void);
150 #ifdef ENABLE_VFS_FTP
151 char *load_anon_passwd (void);
152 #endif /* ENABLE_VFS_FTP */
154 void load_keymap_defs (gboolean load_from_file
);
155 void free_keymap_defs (void);
157 void panel_load_setup (WPanel
* panel
, const char *section
);
158 void panel_save_setup (WPanel
* panel
, const char *section
);
160 /*** inline functions ****************************************************************************/
162 #endif /* MC__SETUP_H */