mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
fix: cmd.c 'set_panel_encoding' add param to encoding = input_dialog(...)
fix: tree.c dirty patching tree_move fix: util.c dirty patching 'i18n_checktimelength' fix: view.c 'view_search' bug's fix: view.c 'view_select_encoding' add param to encoding = input_dialog(...) fix: some trailing spaces removed
This commit is contained in:
parent
8fe8a1fc38
commit
365175195f
@ -1412,7 +1412,7 @@ set_panel_encoding (WPanel *panel)
|
||||
char *encoding;
|
||||
char *cd_path;
|
||||
|
||||
encoding = input_dialog ("Encoding", "Select encoding", NULL);
|
||||
encoding = input_dialog ("Encoding", "Select encoding", NULL, "");
|
||||
|
||||
if (encoding) {
|
||||
cd_path = add_encoding_to_path (panel->cwd, encoding);
|
||||
|
@ -644,13 +644,8 @@ static void tree_move (WTree *tree, const char *default_dest)
|
||||
if (!tree->selected_ptr)
|
||||
return;
|
||||
g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"),
|
||||
<<<<<<< HEAD:src/tree.c
|
||||
name_trunc (tree->selected_ptr->name, 50));
|
||||
str_trunc (tree->selected_ptr->name, 50));
|
||||
dest = input_expand_dialog (_(" Move "), cmd_buf, MC_HISTORY_FM_TREE_MOVE, default_dest);
|
||||
=======
|
||||
str_trunc (tree->selected_ptr->name, 50));
|
||||
dest = input_expand_dialog (_(" Move "), cmd_buf, default_dest);
|
||||
>>>>>>> patches by Rostislav Beneš: mc-28-fix:src/tree.c
|
||||
if (!dest)
|
||||
return;
|
||||
if (!*dest){
|
||||
|
23
src/util.c
23
src/util.c
@ -705,29 +705,9 @@ short-month-name sizes for different locales */
|
||||
size_t
|
||||
i18n_checktimelength (void)
|
||||
{
|
||||
<<<<<<< HEAD:src/util.c
|
||||
=======
|
||||
size_t length, a, b;
|
||||
char buf [MB_LEN_MAX * MAX_I18NTIMELENGTH + 1];
|
||||
>>>>>>> patches by Rostislav Beneš: mc-11-panels:src/util.c
|
||||
time_t testtime = time (NULL);
|
||||
<<<<<<< HEAD:src/util.c
|
||||
struct tm* lt = localtime(&testtime);
|
||||
size_t length;
|
||||
|
||||
if (lt == NULL) {
|
||||
// huh, localtime() doesnt seem to work ... falling back to "(invalid)"
|
||||
length = strlen(INVALID_TIME_TEXT);
|
||||
} else {
|
||||
char buf [MAX_I18NTIMELENGTH + 1];
|
||||
size_t a, b;
|
||||
a = strftime (buf, sizeof(buf)-1, _("%b %e %H:%M"), lt);
|
||||
b = strftime (buf, sizeof(buf)-1, _("%b %e %Y"), lt);
|
||||
length = max (a, b);
|
||||
}
|
||||
|
||||
=======
|
||||
|
||||
strftime (buf, sizeof(buf) - 1, _("%b %e %H:%M"), localtime(&testtime));
|
||||
a = str_term_width1 (buf);
|
||||
strftime (buf, sizeof(buf) - 1, _("%b %e %Y"), localtime(&testtime));
|
||||
@ -736,7 +716,6 @@ i18n_checktimelength (void)
|
||||
length = max (a, b);
|
||||
length = max (str_term_width1 (_("(invalid)")), length);
|
||||
|
||||
>>>>>>> patches by Rostislav Beneš: mc-11-panels:src/util.c
|
||||
/* Don't handle big differences. Use standard value (email bug, please) */
|
||||
if ( length > MAX_I18NTIMELENGTH || length < MIN_I18NTIMELENGTH )
|
||||
length = STD_I18NTIMELENGTH;
|
||||
@ -774,7 +753,7 @@ file_date (time_t when)
|
||||
else
|
||||
fmt = fmttime;
|
||||
|
||||
FMT_LOCALTIME(timebuf, i18n_timelength, fmt, when);
|
||||
FMT_LOCALTIME(timebuf, sizeof (timebuf), fmt, when);
|
||||
|
||||
return timebuf;
|
||||
}
|
||||
|
@ -3055,9 +3055,9 @@ view_search (WView *view, char *text,
|
||||
dlg_run_done (d);
|
||||
destroy_dlg (d);
|
||||
}
|
||||
if (!s) {
|
||||
if (search_status <= 0) {
|
||||
message (D_NORMAL, _("Search"), _(" Search string not found "));
|
||||
view->search_length = 0;
|
||||
view->search_end = view->search_start;
|
||||
}
|
||||
str_release_buffer (buffer);
|
||||
}
|
||||
@ -3221,7 +3221,6 @@ hex_search (WView *view, const char *text)
|
||||
|
||||
if (pos == INVALID_OFFSET) {
|
||||
message (D_NORMAL, _("Search"), _(" Search string not found "));
|
||||
view->search_length = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3658,14 +3657,13 @@ view_select_encoding (WView *view)
|
||||
iconv_t conv;
|
||||
struct cache_line *line;
|
||||
|
||||
enc = input_dialog ("encoding", "paste encoding", "");
|
||||
enc = input_dialog ("Encoding", "Paste encoding", NULL, "");
|
||||
|
||||
if (enc != NULL) {
|
||||
conv = str_crt_conv_from (enc);
|
||||
if (conv != (iconv_t)(-1)) {
|
||||
if (view->converter != str_cnv_from_term) str_close_conv (view->converter);
|
||||
view->converter = conv;
|
||||
|
||||
view_reset_cache_lines (view);
|
||||
line = view_offset_to_line (view, view->dpy_start);
|
||||
view_set_first_showed (view, line);
|
||||
|
Loading…
Reference in New Issue
Block a user