Removed mc_global.args structure.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-09-07 12:06:03 +03:00 committed by Andrew Borodin
parent 67c35a20a6
commit 70ff1dc3aa
9 changed files with 26 additions and 33 deletions

View File

@ -73,13 +73,7 @@ mc_global_t mc_global = {
.is_right = FALSE,
.args =
{
.disable_colors = FALSE,
.skin = NULL,
.ugly_line_drawing = FALSE,
.old_mouse = FALSE,
},
.skin = NULL,
.widget =
{
@ -107,6 +101,9 @@ mc_global_t mc_global = {
.command_line_colors = NULL,
.xterm_flag = FALSE,
.slow_terminal = FALSE,
.disable_colors = FALSE,
.ugly_line_drawing = FALSE,
.old_mouse = FALSE,
},
.vfs =

View File

@ -203,20 +203,8 @@ typedef struct
/* Set if the command is being run from the "Right" menu */
gboolean is_right; /* If the selected menu was the right */
struct
{
/* Use the specified skin */
char *skin;
/* Set to force black and white display at program startup */
gboolean disable_colors;
/* If true use +, -, | for line drawing */
gboolean ugly_line_drawing;
/* Tries to use old highlight mouse tracking */
gboolean old_mouse;
} args;
/* Use the specified skin */
char *skin;
struct
{
@ -262,6 +250,14 @@ typedef struct
/* If true lines are shown by spaces */
gboolean slow_terminal;
/* Set to force black and white display at program startup */
gboolean disable_colors;
/* If true use +, -, | for line drawing */
gboolean ugly_line_drawing;
/* Tries to use old highlight mouse tracking */
gboolean old_mouse;
} tty;
struct

View File

@ -271,7 +271,7 @@ mc_skin_color_check_bw_mode (mc_skin_t * mc_skin)
{
gchar **groups, **orig_groups;
if (tty_use_colors () && !mc_global.args.disable_colors)
if (tty_use_colors () && !mc_global.tty.disable_colors)
return;
orig_groups = groups = mc_config_get_groups (mc_skin->config, NULL);

View File

@ -67,8 +67,8 @@ mc_skin_get_default_name (void)
char *tmp_str;
/* from command line */
if (mc_global.args.skin != NULL)
return g_strdup (mc_global.args.skin);
if (mc_global.skin != NULL)
return g_strdup (mc_global.skin);
/* from envirovement variable */
tmp_str = getenv ("MC_SKIN");
@ -185,7 +185,7 @@ mc_skin_deinit (void)
gchar *
mc_skin_get (const gchar * group, const gchar * key, const gchar * default_value)
{
if (mc_global.args.ugly_line_drawing)
if (mc_global.tty.ugly_line_drawing)
{
return g_strdup (default_value);
}

View File

@ -98,7 +98,7 @@ mc_skin_lines_parse_ini_file (mc_skin_t * mc_skin)
{
if (mc_global.tty.slow_terminal)
mc_skin_hardcoded_space_lines (mc_skin);
else if (mc_global.args.ugly_line_drawing)
else if (mc_global.tty.ugly_line_drawing)
mc_skin_hardcoded_ugly_lines (mc_skin);
/* single lines */

View File

@ -297,7 +297,7 @@ tty_init (gboolean mouse_enable, gboolean is_xterm)
/* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
SLang_init_tty (XCTRL ('g'), 1, 0);
if (mc_global.args.ugly_line_drawing)
if (mc_global.tty.ugly_line_drawing)
SLtt_Has_Alt_Charset = 0;
/* If SLang uses fileno(stderr) for terminal input MC will hang

View File

@ -313,7 +313,7 @@ tty_init_xterm_support (gboolean is_xterm)
/* Enable mouse unless explicitly disabled by --nomouse */
if (use_mouse_p != MOUSE_DISABLED)
{
if (mc_global.args.old_mouse)
if (mc_global.tty.old_mouse)
use_mouse_p = MOUSE_XTERM_NORMAL_TRACKING;
else
{

View File

@ -235,7 +235,7 @@ static const GOptionEntry argument_terminal_table[] = {
{
"stickchars", 'a', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE,
&mc_global.args.ugly_line_drawing,
&mc_global.tty.ugly_line_drawing,
N_("Use stickchars to draw"),
NULL
},
@ -277,7 +277,7 @@ static const GOptionEntry argument_color_table[] = {
/* color options */
{
"nocolor", 'b', ARGS_COLOR_OPTIONS, G_OPTION_ARG_NONE,
&mc_global.args.disable_colors,
&mc_global.tty.disable_colors,
N_("Requests to run in black and white"),
NULL
},
@ -298,7 +298,7 @@ static const GOptionEntry argument_color_table[] = {
{
"skin", 'S', ARGS_COLOR_OPTIONS, G_OPTION_ARG_STRING,
&mc_global.args.skin,
&mc_global.skin,
N_("Show mc with specified skin"),
"<string>"
},
@ -604,7 +604,7 @@ mc_args_process (int argc, char *argv[])
}
if (mc_args__force_colors)
mc_global.args.disable_colors = FALSE;
mc_global.tty.disable_colors = FALSE;
#ifdef HAVE_SUBSHELL_SUPPORT
if (mc_args__nouse_subshell)

View File

@ -455,7 +455,7 @@ main (int argc, char *argv[])
macros_list = g_array_new (TRUE, FALSE, sizeof (macros_t));
tty_init_colors (mc_global.args.disable_colors, mc_args__force_colors);
tty_init_colors (mc_global.tty.disable_colors, mc_args__force_colors);
{
GError *error2 = NULL;