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:
Ilia Maslakov 2009-04-03 12:19:09 +00:00
parent 8fe8a1fc38
commit 365175195f
4 changed files with 11 additions and 39 deletions

View File

@ -1412,7 +1412,7 @@ set_panel_encoding (WPanel *panel)
char *encoding; char *encoding;
char *cd_path; char *cd_path;
encoding = input_dialog ("Encoding", "Select encoding", NULL); encoding = input_dialog ("Encoding", "Select encoding", NULL, "");
if (encoding) { if (encoding) {
cd_path = add_encoding_to_path (panel->cwd, encoding); cd_path = add_encoding_to_path (panel->cwd, encoding);

View File

@ -644,13 +644,8 @@ static void tree_move (WTree *tree, const char *default_dest)
if (!tree->selected_ptr) if (!tree->selected_ptr)
return; return;
g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"), g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"),
<<<<<<< HEAD:src/tree.c str_trunc (tree->selected_ptr->name, 50));
name_trunc (tree->selected_ptr->name, 50));
dest = input_expand_dialog (_(" Move "), cmd_buf, MC_HISTORY_FM_TREE_MOVE, default_dest); 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) if (!dest)
return; return;
if (!*dest){ if (!*dest){

View File

@ -705,29 +705,9 @@ short-month-name sizes for different locales */
size_t size_t
i18n_checktimelength (void) i18n_checktimelength (void)
{ {
<<<<<<< HEAD:src/util.c
=======
size_t length, a, b; size_t length, a, b;
char buf [MB_LEN_MAX * MAX_I18NTIMELENGTH + 1]; char buf [MB_LEN_MAX * MAX_I18NTIMELENGTH + 1];
>>>>>>> patches by Rostislav Beneš: mc-11-panels:src/util.c
time_t testtime = time (NULL); 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)); strftime (buf, sizeof(buf) - 1, _("%b %e %H:%M"), localtime(&testtime));
a = str_term_width1 (buf); a = str_term_width1 (buf);
strftime (buf, sizeof(buf) - 1, _("%b %e %Y"), localtime(&testtime)); strftime (buf, sizeof(buf) - 1, _("%b %e %Y"), localtime(&testtime));
@ -736,7 +716,6 @@ i18n_checktimelength (void)
length = max (a, b); length = max (a, b);
length = max (str_term_width1 (_("(invalid)")), length); 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) */ /* Don't handle big differences. Use standard value (email bug, please) */
if ( length > MAX_I18NTIMELENGTH || length < MIN_I18NTIMELENGTH ) if ( length > MAX_I18NTIMELENGTH || length < MIN_I18NTIMELENGTH )
length = STD_I18NTIMELENGTH; length = STD_I18NTIMELENGTH;
@ -773,8 +752,8 @@ file_date (time_t when)
fmt = fmtyear; fmt = fmtyear;
else else
fmt = fmttime; fmt = fmttime;
FMT_LOCALTIME(timebuf, i18n_timelength, fmt, when); FMT_LOCALTIME(timebuf, sizeof (timebuf), fmt, when);
return timebuf; return timebuf;
} }

View File

@ -3055,9 +3055,9 @@ view_search (WView *view, char *text,
dlg_run_done (d); dlg_run_done (d);
destroy_dlg (d); destroy_dlg (d);
} }
if (!s) { if (search_status <= 0) {
message (D_NORMAL, _("Search"), _(" Search string not found ")); message (D_NORMAL, _("Search"), _(" Search string not found "));
view->search_length = 0; view->search_end = view->search_start;
} }
str_release_buffer (buffer); str_release_buffer (buffer);
} }
@ -3221,7 +3221,6 @@ hex_search (WView *view, const char *text)
if (pos == INVALID_OFFSET) { if (pos == INVALID_OFFSET) {
message (D_NORMAL, _("Search"), _(" Search string not found ")); message (D_NORMAL, _("Search"), _(" Search string not found "));
view->search_length = 0;
return; return;
} }
@ -3657,22 +3656,21 @@ view_select_encoding (WView *view)
char *enc; char *enc;
iconv_t conv; iconv_t conv;
struct cache_line *line; struct cache_line *line;
enc = input_dialog ("encoding", "paste encoding", ""); enc = input_dialog ("Encoding", "Paste encoding", NULL, "");
if (enc != NULL) { if (enc != NULL) {
conv = str_crt_conv_from (enc); conv = str_crt_conv_from (enc);
if (conv != (iconv_t)(-1)) { if (conv != (iconv_t)(-1)) {
if (view->converter != str_cnv_from_term) str_close_conv (view->converter); if (view->converter != str_cnv_from_term) str_close_conv (view->converter);
view->converter = conv; view->converter = conv;
view_reset_cache_lines (view); view_reset_cache_lines (view);
line = view_offset_to_line (view, view->dpy_start); line = view_offset_to_line (view, view->dpy_start);
view_set_first_showed (view, line); view_set_first_showed (view, line);
} }
} }
} }
/* Both views */ /* Both views */
static cb_ret_t static cb_ret_t