Rename variable: midnight_dlg -> filemanager.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2020-10-31 20:04:50 +03:00
parent 4ed3e4b0f6
commit e7fab254f9
6 changed files with 43 additions and 45 deletions

View File

@ -40,7 +40,7 @@
/*** global variables ****************************************************************************/
WDialog *midnight_dlg = NULL;
WDialog *filemanager = NULL;
/*** file scope macro definitions ****************************************************************/
@ -86,7 +86,7 @@ dialog_switch_goto (GList * dlg)
mc_current = dlg;
if (old == midnight_dlg)
if (old == filemanager)
{
/* switch from panels to another dialog (editor, viewer, etc) */
dialog_switch_pending = TRUE;
@ -97,14 +97,14 @@ dialog_switch_goto (GList * dlg)
/* switch from editor, viewer, etc to another dialog */
widget_set_state (WIDGET (old), WST_SUSPENDED, TRUE);
if (DIALOG (dlg->data) != midnight_dlg)
if (DIALOG (dlg->data) != filemanager)
/* switch to another editor, viewer, etc */
/* return to panels before run the required dialog */
dialog_switch_pending = TRUE;
else
{
/* switch to panels */
widget_set_state (WIDGET (midnight_dlg), WST_ACTIVE, TRUE);
widget_set_state (WIDGET (filemanager), WST_ACTIVE, TRUE);
do_refresh ();
}
}
@ -273,7 +273,7 @@ dialog_switch_process_pending (void)
/* return to panels */
if (mc_global.mc_run_mode == MC_RUN_FULL)
{
mc_current = g_list_find (mc_dialogs, midnight_dlg);
mc_current = g_list_find (mc_dialogs, filemanager);
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "update_panels", NULL);
}
}

View File

@ -12,7 +12,7 @@
/*** global variables defined in .c file *********************************************************/
extern WDialog *midnight_dlg;
extern WDialog *filemanager;
/*** declarations of public functions ************************************************************/

View File

@ -964,7 +964,7 @@ chattr_init (void)
static WDialog *
chattr_dlg_create (WPanel * panel, const char *fname, unsigned long attr)
{
const Widget *mw = CONST_WIDGET (midnight_dlg);
Widget *mw = WIDGET (WIDGET (panel)->owner);
gboolean single_set;
WDialog *ch_dlg;
int lines, cols;

View File

@ -135,7 +135,7 @@ static menu_t *left_menu, *right_menu;
static void
stop_dialogs (void)
{
dlg_stop (midnight_dlg);
dlg_stop (filemanager);
if (top_dlg != NULL)
dlg_stop (DIALOG (top_dlg->data));
@ -902,14 +902,14 @@ done_mc (void)
static void
create_file_manager (void)
{
Widget *w = WIDGET (midnight_dlg);
WGroup *g = GROUP (midnight_dlg);
Widget *w = WIDGET (filemanager);
WGroup *g = GROUP (filemanager);
w->keymap = filemanager_map;
w->ext_keymap = filemanager_x_map;
midnight_dlg->get_shortcut = midnight_get_shortcut;
midnight_dlg->get_title = midnight_get_title;
filemanager->get_shortcut = midnight_get_shortcut;
filemanager->get_title = midnight_get_title;
/* allow rebind tab */
widget_want_tab (w, TRUE);
@ -1011,7 +1011,7 @@ show_editor_viewer_history (void)
char *s;
int act;
s = show_file_history (WIDGET (midnight_dlg), &act);
s = show_file_history (WIDGET (filemanager), &act);
if (s != NULL)
{
vfs_path_t *s_vpath;
@ -1368,7 +1368,7 @@ midnight_execute_cmd (Widget * sender, long command)
case CK_Select:
case CK_Unselect:
case CK_SelectInvert:
res = send_message (current_panel, midnight_dlg, MSG_ACTION, command, NULL);
res = send_message (current_panel, filemanager, MSG_ACTION, command, NULL);
break;
case CK_Shell:
toggle_subshell ();
@ -1380,7 +1380,7 @@ midnight_execute_cmd (Widget * sender, long command)
sort_cmd ();
break;
case CK_ExtendedKeyMap:
WIDGET (midnight_dlg)->ext_mode = TRUE;
WIDGET (filemanager)->ext_mode = TRUE;
break;
case CK_Suspend:
mc_event_raise (MCEVENT_GROUP_CORE, "suspend", NULL);
@ -1560,14 +1560,13 @@ midnight_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
{
/* Special treatement, since the input line will eat them */
if (parm == '+')
return send_message (current_panel, midnight_dlg, MSG_ACTION, CK_Select, NULL);
return send_message (current_panel, filemanager, MSG_ACTION, CK_Select, NULL);
if (parm == '\\' || parm == '-')
return send_message (current_panel, midnight_dlg, MSG_ACTION, CK_Unselect,
NULL);
return send_message (current_panel, filemanager, MSG_ACTION, CK_Unselect, NULL);
if (parm == '*')
return send_message (current_panel, midnight_dlg, MSG_ACTION, CK_SelectInvert,
return send_message (current_panel, filemanager, MSG_ACTION, CK_SelectInvert,
NULL);
}
else if (!command_prompt || input_is_empty (cmdline))
@ -1576,14 +1575,13 @@ midnight_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
* first char on input line
*/
if (parm == '+')
return send_message (current_panel, midnight_dlg, MSG_ACTION, CK_Select, NULL);
return send_message (current_panel, filemanager, MSG_ACTION, CK_Select, NULL);
if (parm == '\\' || parm == '-')
return send_message (current_panel, midnight_dlg, MSG_ACTION, CK_Unselect,
NULL);
return send_message (current_panel, filemanager, MSG_ACTION, CK_Unselect, NULL);
if (parm == '*')
return send_message (current_panel, midnight_dlg, MSG_ACTION, CK_SelectInvert,
return send_message (current_panel, filemanager, MSG_ACTION, CK_SelectInvert,
NULL);
}
}
@ -1647,7 +1645,7 @@ update_menu (void)
void
midnight_set_buttonbar (WButtonBar * b)
{
Widget *w = WIDGET (midnight_dlg);
Widget *w = WIDGET (filemanager);
buttonbar_set_label (b, 1, Q_ ("ButtonBar|Help"), w->keymap, NULL);
buttonbar_set_label (b, 2, Q_ ("ButtonBar|Menu"), w->keymap, NULL);
@ -1778,7 +1776,7 @@ WPanel *
change_panel (void)
{
input_complete_free (cmdline);
group_select_next_widget (GROUP (midnight_dlg));
group_select_next_widget (GROUP (filemanager));
return current_panel;
}
@ -1819,8 +1817,8 @@ do_nc (void)
edit_stack_init ();
#endif
midnight_dlg = dlg_create (FALSE, 0, 0, 1, 1, WPOS_FULLSCREEN, FALSE, dialog_colors,
midnight_callback, NULL, "[main]", NULL);
filemanager = dlg_create (FALSE, 0, 0, 1, 1, WPOS_FULLSCREEN, FALSE, dialog_colors,
midnight_callback, NULL, "[main]", NULL);
/* Check if we were invoked as an editor or file viewer */
if (mc_global.mc_run_mode != MC_RUN_FULL)
@ -1831,13 +1829,13 @@ do_nc (void)
else
{
/* We only need the first idle event to show user menu after start */
widget_idle (WIDGET (midnight_dlg), TRUE);
widget_idle (WIDGET (filemanager), TRUE);
setup_mc ();
mc_filehighlight = mc_fhl_new (TRUE);
create_file_manager ();
(void) dlg_run (midnight_dlg);
(void) dlg_run (filemanager);
mc_fhl_free (&mc_filehighlight);
@ -1857,7 +1855,7 @@ do_nc (void)
mc_global.midnight_shutdown = TRUE;
dialog_switch_shutdown ();
done_mc ();
dlg_destroy (midnight_dlg);
dlg_destroy (filemanager);
current_panel = NULL;
#ifdef USE_INTERNAL_EDIT

View File

@ -213,7 +213,7 @@ check_split (panels_layout_t * layout)
}
else
{
int md_cols = CONST_WIDGET (midnight_dlg)->cols;
int md_cols = CONST_WIDGET (filemanager)->cols;
if (layout->vertical_equal)
layout->left_panel_size = md_cols / 2;
@ -251,7 +251,7 @@ update_split (const WDialog * h)
if (panels_layout.horizontal_split)
tty_printf ("%03d", height - panels_layout.top_panel_size);
else
tty_printf ("%03d", CONST_WIDGET (midnight_dlg)->cols - panels_layout.left_panel_size);
tty_printf ("%03d", CONST_WIDGET (filemanager)->cols - panels_layout.left_panel_size);
widget_gotoyx (h, 6, 12);
tty_print_char ('=');
@ -352,7 +352,7 @@ layout_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *
{
case MSG_POST_KEY:
{
const Widget *mw = CONST_WIDGET (midnight_dlg);
const Widget *mw = CONST_WIDGET (filemanager);
gboolean _menubar_visible, _command_prompt, _keybar_visible, _message_visible;
_menubar_visible = check_options[1].widget->state;
@ -412,7 +412,7 @@ layout_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *
{
eq = panels_layout.vertical_equal;
if (eq)
panels_layout.left_panel_size = CONST_WIDGET (midnight_dlg)->cols / 2;
panels_layout.left_panel_size = CONST_WIDGET (filemanager)->cols / 2;
}
widget_disable (WIDGET (bleft_widget), eq);
@ -750,7 +750,7 @@ layout_box (void)
void
panel_update_cols (Widget * widget, panel_display_t frame_size)
{
const Widget *mw = CONST_WIDGET (midnight_dlg);
const Widget *mw = CONST_WIDGET (filemanager);
int cols, x;
/* don't touch panel if it is not in dialog yet */
@ -816,7 +816,7 @@ setup_panels (void)
* +--------+------------------------------------------------------+
*/
Widget *mw = WIDGET (midnight_dlg);
Widget *mw = WIDGET (filemanager);
int start_y;
gboolean active;
@ -969,7 +969,7 @@ panels_split_less (void)
void
setup_cmdline (void)
{
const Widget *mw = CONST_WIDGET (midnight_dlg);
const Widget *mw = CONST_WIDGET (filemanager);
int prompt_width;
int y;
char *tmp_prompt = (char *) mc_prompt;
@ -1050,7 +1050,7 @@ rotate_dash (gboolean show)
/* update with 10 FPS rate */
static const gint64 delay = G_USEC_PER_SEC / 10;
const Widget *w = CONST_WIDGET (midnight_dlg);
const Widget *w = CONST_WIDGET (filemanager);
if (!nice_rotating_dash || (ok_to_refresh <= 0))
return;
@ -1146,7 +1146,7 @@ create_panel (int num, panel_view_mode_t type)
if (old_type == view_listing && panel->frame_size == frame_full && type != view_listing)
{
int md_cols = CONST_WIDGET (midnight_dlg)->cols;
int md_cols = CONST_WIDGET (filemanager)->cols;
if (panels_layout.horizontal_split)
{
@ -1217,8 +1217,8 @@ create_panel (int num, panel_view_mode_t type)
if (old_type == view_listing)
{
/* save and write directory history of panel
* ... and other histories of midnight_dlg */
dlg_save_history (midnight_dlg);
* ... and other histories of filemanager */
dlg_save_history (filemanager);
}
widget_replace (old_widget, new_widget);
@ -1233,7 +1233,7 @@ create_panel (int num, panel_view_mode_t type)
{
ev_history_load_save_t event_data = { NULL, new_widget };
mc_event_raise (midnight_dlg->event_group, MCEVENT_HISTORY_LOAD, &event_data);
mc_event_raise (filemanager->event_group, MCEVENT_HISTORY_LOAD, &event_data);
}
if (num == 0)
@ -1493,7 +1493,7 @@ do_load_prompt (void)
return ret;
/* Don't actually change the prompt if it's invisible */
if (top_dlg != NULL && DIALOG (top_dlg->data) == midnight_dlg && command_prompt)
if (top_dlg != NULL && DIALOG (top_dlg->data) == filemanager && command_prompt)
{
setup_cmdline ();
@ -1501,7 +1501,7 @@ do_load_prompt (void)
* tty_get_event channels, the prompt updating does not take place
* automatically: force a cursor update and a screen refresh
*/
widget_update_cursor (WIDGET (midnight_dlg));
widget_update_cursor (WIDGET (filemanager));
mc_refresh ();
ret = TRUE;
}

View File

@ -3869,7 +3869,7 @@ panel_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
directory_history_list (panel);
else if (event->x == w->cols - 6)
/* "." button show/hide hidden files */
send_message (midnight_dlg, NULL, MSG_ACTION, CK_ShowHidden, NULL);
send_message (filemanager, NULL, MSG_ACTION, CK_ShowHidden, NULL);
else
{
/* no other events on 1st line, return MOU_UNHANDLED */