mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
(change_panel): return current_panel.
(chdir_other_panel): use result of change_panel() instead of global variable current_panel. (chdir_to_readlink): likewise. (tree_chdir_sel): likewise. (quick_view_cmd): mark that we don't use the result of change_panel(). (midnight_execute_cmd): likewise. (panel_mouse_callback): likewise. (tree_mouse_callback): likewise. (mcview_mouse_callback): likewise. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
be14894455
commit
59070e8313
@ -1583,7 +1583,7 @@ void
|
||||
quick_view_cmd (void)
|
||||
{
|
||||
if (PANEL (get_panel_widget (MENU_PANEL_IDX)) == current_panel)
|
||||
change_panel ();
|
||||
(void) change_panel ();
|
||||
create_panel (MENU_PANEL_IDX, view_quick);
|
||||
}
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ midnight_execute_cmd (Widget * sender, long command)
|
||||
switch (command)
|
||||
{
|
||||
case CK_ChangePanel:
|
||||
change_panel ();
|
||||
(void) change_panel ();
|
||||
break;
|
||||
case CK_HotListAdd:
|
||||
add2hotlist_cmd (current_panel);
|
||||
@ -1765,12 +1765,18 @@ load_hint (gboolean force)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Change current panel in the file manager.
|
||||
*
|
||||
* @return current_panel
|
||||
*/
|
||||
|
||||
void
|
||||
WPanel *
|
||||
change_panel (void)
|
||||
{
|
||||
input_complete_free (cmdline);
|
||||
group_select_next_widget (GROUP (midnight_dlg));
|
||||
return current_panel;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -43,7 +43,7 @@ void update_menu (void);
|
||||
void midnight_set_buttonbar (WButtonBar * b);
|
||||
char *get_random_hint (gboolean force);
|
||||
void load_hint (gboolean force);
|
||||
void change_panel (void);
|
||||
WPanel *change_panel (void);
|
||||
void save_cwds_stat (void);
|
||||
gboolean quiet_quit_cmd (void);
|
||||
gboolean do_nc (void);
|
||||
|
@ -2876,6 +2876,7 @@ chdir_other_panel (WPanel * panel)
|
||||
const file_entry_t *entry = &panel->dir.list[panel->selected];
|
||||
vfs_path_t *new_dir_vpath;
|
||||
char *sel_entry = NULL;
|
||||
WPanel *p;
|
||||
|
||||
if (get_other_type () != view_listing)
|
||||
create_panel (get_other_index (), view_listing);
|
||||
@ -2888,13 +2889,13 @@ chdir_other_panel (WPanel * panel)
|
||||
sel_entry = strrchr (vfs_path_get_last_path_str (panel->cwd_vpath), PATH_SEP);
|
||||
}
|
||||
|
||||
change_panel ();
|
||||
do_cd (current_panel, new_dir_vpath, cd_exact);
|
||||
p = change_panel ();
|
||||
do_cd (p, new_dir_vpath, cd_exact);
|
||||
vfs_path_free (new_dir_vpath);
|
||||
|
||||
if (sel_entry)
|
||||
try_to_select (current_panel, sel_entry);
|
||||
change_panel ();
|
||||
try_to_select (p, sel_entry);
|
||||
(void) change_panel ();
|
||||
|
||||
move_down (panel);
|
||||
}
|
||||
@ -2931,6 +2932,7 @@ chdir_to_readlink (WPanel * panel)
|
||||
struct stat st;
|
||||
vfs_path_t *panel_fname_vpath;
|
||||
gboolean ok;
|
||||
WPanel *cpanel;
|
||||
|
||||
if (get_other_type () != view_listing)
|
||||
return;
|
||||
@ -2969,10 +2971,10 @@ chdir_to_readlink (WPanel * panel)
|
||||
else
|
||||
new_dir_vpath = vfs_path_append_new (panel->cwd_vpath, buffer, (char *) NULL);
|
||||
|
||||
change_panel ();
|
||||
do_cd (current_panel, new_dir_vpath, cd_exact);
|
||||
cpanel = change_panel ();
|
||||
do_cd (cpanel, new_dir_vpath, cd_exact);
|
||||
vfs_path_free (new_dir_vpath);
|
||||
change_panel ();
|
||||
(void) change_panel ();
|
||||
|
||||
move_down (panel);
|
||||
}
|
||||
@ -3879,7 +3881,7 @@ panel_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
}
|
||||
|
||||
if (!is_active)
|
||||
change_panel ();
|
||||
(void) change_panel ();
|
||||
MC_FALLTHROUGH;
|
||||
|
||||
case MSG_MOUSE_DRAG:
|
||||
|
@ -586,16 +586,18 @@ tree_chdir_sel (WTree * tree)
|
||||
{
|
||||
if (tree->is_panel)
|
||||
{
|
||||
change_panel ();
|
||||
WPanel *p;
|
||||
|
||||
if (do_cd (current_panel, tree->selected_ptr->name, cd_exact))
|
||||
select_item (current_panel);
|
||||
p = change_panel ();
|
||||
|
||||
if (do_cd (p, tree->selected_ptr->name, cd_exact))
|
||||
select_item (p);
|
||||
else
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot chdir to \"%s\"\n%s"),
|
||||
vfs_path_as_str (tree->selected_ptr->name), unix_error_string (errno));
|
||||
|
||||
widget_draw (WIDGET (current_panel));
|
||||
change_panel ();
|
||||
widget_draw (WIDGET (p));
|
||||
(void) change_panel ();
|
||||
show_tree (tree);
|
||||
}
|
||||
else
|
||||
@ -1229,7 +1231,7 @@ tree_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
event->result.abort = TRUE;
|
||||
}
|
||||
else if (!widget_get_state (w, WST_FOCUSED))
|
||||
change_panel ();
|
||||
(void) change_panel ();
|
||||
break;
|
||||
|
||||
case MSG_MOUSE_CLICK:
|
||||
|
@ -108,7 +108,7 @@ mcview_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
if (!widget_get_state (w, WST_FOCUSED))
|
||||
{
|
||||
/* Grab focus */
|
||||
change_panel ();
|
||||
(void) change_panel ();
|
||||
}
|
||||
}
|
||||
MC_FALLTHROUGH;
|
||||
|
Loading…
Reference in New Issue
Block a user