mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-22 03:02:06 +03:00
* selcodepage.c (do_select_codepage): New function.
* selcodepage.h: Declare it. From Walery Studennikov <hqsoftware@mail.ru>.
This commit is contained in:
parent
0e46f60810
commit
d34b0fde60
@ -1,5 +1,9 @@
|
||||
2001-06-05 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* selcodepage.c (do_select_codepage): New function.
|
||||
* selcodepage.h: Declare it.
|
||||
From Walery Studennikov <hqsoftware@mail.ru>.
|
||||
|
||||
* mfmt.c (omain): Warning fix.
|
||||
|
||||
* key.c [HAVE_TEXTMODE_X11_SUPPORT]: Rename `display' to
|
||||
|
@ -3,11 +3,13 @@
|
||||
#ifdef HAVE_CHARSET
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "i18n.h"
|
||||
#include "dlg.h"
|
||||
#include "dialog.h"
|
||||
#include "widget.h"
|
||||
#include "wtools.h"
|
||||
#include "charsets.h"
|
||||
#include "i18n.h"
|
||||
#include "main.h"
|
||||
|
||||
#define ENTRY_LEN 35
|
||||
|
||||
@ -60,4 +62,40 @@ int select_charset( int current_charset, int seldisplay )
|
||||
return (seldisplay) ? ( (i >= n_codepages) ? -1 : i )
|
||||
: ( i - 1 );
|
||||
}
|
||||
|
||||
/* Helper functions for codepages support */
|
||||
|
||||
|
||||
int do_select_codepage()
|
||||
{
|
||||
char *errmsg;
|
||||
|
||||
#ifndef HAVE_ICONV
|
||||
|
||||
message( 1, _(" Warning "),
|
||||
"Midnight Commander was compiled without iconv support,\n"
|
||||
"so charsets recoding feature is not available!" );
|
||||
return -1;
|
||||
|
||||
#else
|
||||
|
||||
if (display_codepage > 0) {
|
||||
source_codepage = select_charset( source_codepage, 0 );
|
||||
errmsg = init_translation_table( source_codepage, display_codepage );
|
||||
if (errmsg) {
|
||||
message( 1, _(" Error "), errmsg );
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
message( 1, _(" Warning "),
|
||||
"To use this feature select your codepage in\n"
|
||||
"Setup / Display Bits dialog!\n"
|
||||
"Do not forget to save options." );
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_ICONV */
|
||||
|
||||
#endif /* HAVE_CHARSET */
|
||||
|
@ -3,6 +3,7 @@
|
||||
#define __SELCODEPAGE_H__
|
||||
|
||||
int select_charset( int current_charset, int seldisplay );
|
||||
int do_select_codepage();
|
||||
|
||||
#endif /* __SELCODEPAGE_H__ */
|
||||
#endif /* HAVE_CHARSET */
|
||||
|
Loading…
Reference in New Issue
Block a user