mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 04:22:34 +03:00
remove unnecessary menu item. Menu 'Sort' is no longer needed.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
parent
5799bd846a
commit
a62fbd9628
@ -240,7 +240,6 @@ void edit_toggle_fullscreen (WEdit * edit);
|
|||||||
void edit_move_to_line (WEdit * e, long line);
|
void edit_move_to_line (WEdit * e, long line);
|
||||||
void edit_move_display (WEdit * e, long line);
|
void edit_move_display (WEdit * e, long line);
|
||||||
void edit_word_wrap (WEdit * edit);
|
void edit_word_wrap (WEdit * edit);
|
||||||
int edit_sort_cmd (WEdit * edit);
|
|
||||||
int edit_ext_cmd (WEdit * edit);
|
int edit_ext_cmd (WEdit * edit);
|
||||||
|
|
||||||
int edit_store_macro_cmd (WEdit * edit);
|
int edit_store_macro_cmd (WEdit * edit);
|
||||||
|
@ -3827,9 +3827,6 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
|
|||||||
case CK_UserMenu:
|
case CK_UserMenu:
|
||||||
user_menu (edit, NULL, -1);
|
user_menu (edit, NULL, -1);
|
||||||
break;
|
break;
|
||||||
case CK_Sort:
|
|
||||||
edit_sort_cmd (edit);
|
|
||||||
break;
|
|
||||||
case CK_ExternalCommand:
|
case CK_ExternalCommand:
|
||||||
edit_ext_cmd (edit);
|
edit_ext_cmd (edit);
|
||||||
break;
|
break;
|
||||||
|
@ -3060,77 +3060,6 @@ edit_insert_file_cmd (WEdit * edit)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
|
||||||
/** sorts a block, returns -1 on system fail, 1 on cancel and 0 on success */
|
|
||||||
|
|
||||||
int
|
|
||||||
edit_sort_cmd (WEdit * edit)
|
|
||||||
{
|
|
||||||
static char *old = 0;
|
|
||||||
char *exp, *tmp, *tmp_edit_block_name, *tmp_edit_temp_name;
|
|
||||||
off_t start_mark, end_mark;
|
|
||||||
int e;
|
|
||||||
|
|
||||||
if (!eval_marks (edit, &start_mark, &end_mark))
|
|
||||||
{
|
|
||||||
edit_error_dialog (_("Sort block"), _("You must first highlight a block of text"));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = mc_config_get_full_path (EDIT_BLOCK_FILE);
|
|
||||||
edit_save_block (edit, tmp, start_mark, end_mark);
|
|
||||||
g_free (tmp);
|
|
||||||
|
|
||||||
exp = input_dialog (_("Run sort"),
|
|
||||||
_("Enter sort options (see manpage) separated by whitespace:"),
|
|
||||||
MC_HISTORY_EDIT_SORT, (old != NULL) ? old : "", INPUT_COMPLETE_NONE);
|
|
||||||
|
|
||||||
if (!exp)
|
|
||||||
return 1;
|
|
||||||
g_free (old);
|
|
||||||
old = exp;
|
|
||||||
tmp_edit_block_name = mc_config_get_full_path (EDIT_BLOCK_FILE);
|
|
||||||
tmp_edit_temp_name = mc_config_get_full_path (EDIT_TEMP_FILE);
|
|
||||||
tmp =
|
|
||||||
g_strconcat (" sort ", exp, " ", tmp_edit_block_name,
|
|
||||||
" > ", tmp_edit_temp_name, (char *) NULL);
|
|
||||||
g_free (tmp_edit_temp_name);
|
|
||||||
g_free (tmp_edit_block_name);
|
|
||||||
|
|
||||||
e = system (tmp);
|
|
||||||
g_free (tmp);
|
|
||||||
if (e)
|
|
||||||
{
|
|
||||||
if (e == -1 || e == 127)
|
|
||||||
{
|
|
||||||
edit_error_dialog (_("Sort"), get_sys_error (_("Cannot execute sort command")));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char q[8];
|
|
||||||
sprintf (q, "%d ", e);
|
|
||||||
tmp = g_strdup_printf (_("Sort returned non-zero: %s"), q);
|
|
||||||
edit_error_dialog (_("Sort"), tmp);
|
|
||||||
g_free (tmp);
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
edit->force |= REDRAW_COMPLETELY;
|
|
||||||
|
|
||||||
if (edit_block_delete_cmd (edit))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
{
|
|
||||||
vfs_path_t *tmp_vpath;
|
|
||||||
|
|
||||||
tmp_vpath = mc_config_get_full_vpath (EDIT_TEMP_FILE);
|
|
||||||
edit_insert_file (edit, tmp_vpath);
|
|
||||||
vfs_path_free (tmp_vpath);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
/**
|
/**
|
||||||
* Ask user for a command, execute it and paste its output back to the
|
* Ask user for a command, execute it and paste its output back to the
|
||||||
|
@ -208,7 +208,6 @@ create_format_menu (void)
|
|||||||
entries = g_list_prepend (entries, menu_separator_create ());
|
entries = g_list_prepend (entries, menu_separator_create ());
|
||||||
entries =
|
entries =
|
||||||
g_list_prepend (entries, menu_entry_create (_("&Format paragraph"), CK_ParagraphFormat));
|
g_list_prepend (entries, menu_entry_create (_("&Format paragraph"), CK_ParagraphFormat));
|
||||||
entries = g_list_prepend (entries, menu_entry_create (_("&Sort..."), CK_Sort));
|
|
||||||
entries =
|
entries =
|
||||||
g_list_prepend (entries, menu_entry_create (_("&Paste output of..."), CK_ExternalCommand));
|
g_list_prepend (entries, menu_entry_create (_("&Paste output of..."), CK_ExternalCommand));
|
||||||
entries =
|
entries =
|
||||||
|
Loading…
Reference in New Issue
Block a user