add choice encoding in panel from list ( by call do_select_codepage() )

This commit is contained in:
Ilia Maslakov 2009-04-16 07:07:21 +00:00
parent ac8ae55181
commit 408e75c1fa

View File

@ -1395,9 +1395,9 @@ static char
char *result; char *result;
char *semi; char *semi;
char *slash; char *slash;
semi = g_strrstr (path, "#enc:"); semi = g_strrstr (path, "#enc:");
if (semi != NULL) { if (semi != NULL) {
slash = strchr (semi, PATH_SEP); slash = strchr (semi, PATH_SEP);
if (slash != NULL) { if (slash != NULL) {
@ -1410,23 +1410,26 @@ static char
} else { } else {
result = g_strconcat (path, "/#enc:", encoding, NULL); result = g_strconcat (path, "/#enc:", encoding, NULL);
} }
return result; return result;
} }
static void static void
set_panel_encoding (WPanel *panel) set_panel_encoding (WPanel *panel)
{ {
char *encoding; char *encoding = NULL;
char *cd_path; char *cd_path;
encoding = input_dialog ("Encoding", "Select encoding", NULL, ""); do_select_codepage ();
encoding = g_strdup( get_codepage_id ( source_codepage ) );
if (encoding) { if (encoding) {
cd_path = add_encoding_to_path (panel->cwd, encoding); cd_path = add_encoding_to_path (panel->cwd, encoding);
if (!do_panel_cd (MENU_PANEL, cd_path, 0)) if (!do_panel_cd (MENU_PANEL, cd_path, 0))
message (1, MSG_ERROR, _(" Cannot chdir to %s "), cd_path); message (1, MSG_ERROR, _(" Cannot chdir to %s "), cd_path);
g_free (cd_path); g_free (cd_path);
g_free (encoding);
} }
} }