changeset 846:77660334b282

2006-11-2 Brian Masney <masneyb@gftp.org> * src/text/gftp-text.c src/text/gftp-text.h src/text/textui.c - use gftp_string_from_utf8() for the conversion between the various character sets.
author masneyb
date Fri, 03 Nov 2006 03:07:44 +0000
parents 8263cc35c027
children 14858879916f
files ChangeLog src/text/gftp-text.c src/text/gftp-text.h src/text/textui.c
diffstat 4 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Nov 03 03:02:51 2006 +0000
+++ b/ChangeLog	Fri Nov 03 03:07:44 2006 +0000
@@ -1,4 +1,8 @@
 2006-11-2 Brian Masney <masneyb@gftp.org>
+	* src/text/gftp-text.c src/text/gftp-text.h src/text/textui.c -
+	use gftp_string_from_utf8() for the conversion between the
+	various character sets.
+
 	* lib/gftp.h lib/local.c lib/misc.c lib/protocols.c lib/rfc959.c
 	lib/sshv2.c - added gftp_filename_to_utf8() and
 	gftp_filename_from_utf8().
@@ -3689,7 +3693,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.495 2006/11/03 03:02:47 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.496 2006/11/03 03:07:40 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/src/text/gftp-text.c	Fri Nov 03 03:02:51 2006 +0000
+++ b/src/text/gftp-text.c	Fri Nov 03 03:07:44 2006 +0000
@@ -44,7 +44,7 @@
 
   sw = gftp_text_get_win_size ();
 
-  locale_str = gftp_string_from_utf8 (request, string, &destlen);
+  locale_str = gftp_string_from_utf8 (request, 1, string, &destlen);
   if (locale_str == NULL)
     stpos = string;
   else
@@ -140,7 +140,8 @@
 
 
 char *
-gftp_text_ask_question (const char *question, int echo, char *buf, size_t size)
+gftp_text_ask_question (gftp_request * request, const char *question, int echo,
+                        char *buf, size_t size)
 {
   struct termios term, oldterm;
   gchar *locale_question;
@@ -174,12 +175,7 @@
   else
     infd = stdin;
 
-#if GLIB_MAJOR_VERSION > 1
-  locale_question = g_locale_from_utf8 (question, -1, NULL, NULL, NULL);
-#else
-  locale_question = NULL;
-#endif
-
+  locale_question = gftp_string_from_utf8 (request, 1, question, &destlen);
   if (locale_question != NULL)
     {
       printf ("%s%s%s ", GFTPUI_COMMON_COLOR_BLUE, locale_question,
--- a/src/text/gftp-text.h	Fri Nov 03 03:02:51 2006 +0000
+++ b/src/text/gftp-text.h	Fri Nov 03 03:07:44 2006 +0000
@@ -32,7 +32,8 @@
 
 unsigned int gftp_text_get_win_size 		( void );
 
-char * gftp_text_ask_question 			( const char *question,
+char * gftp_text_ask_question 			( gftp_request * request,
+						  const char *question,
 						  int echo,
 						  char *buf,
 						  size_t size );
--- a/src/text/textui.c	Fri Nov 03 03:02:51 2006 +0000
+++ b/src/text/textui.c	Fri Nov 03 03:07:44 2006 +0000
@@ -76,7 +76,8 @@
   char tempstr[256];
 
   gftp_set_username (request, 
-                     gftp_text_ask_question (_("Username [anonymous]:"), 1,
+                     gftp_text_ask_question (request,
+                                             _("Username [anonymous]:"), 1,
                                              tempstr, sizeof (tempstr)));
 }
 
@@ -88,7 +89,7 @@
   char tempstr[256];
 
   gftp_set_password (request,
-                     gftp_text_ask_question (_("Password:"), 0,
+                     gftp_text_ask_question (request, _("Password:"), 0,
                                              tempstr, sizeof (tempstr)));
 }
 
@@ -147,7 +148,7 @@
     
           g_snprintf (question, sizeof (question), _("%s already exists. (%s source size, %s destination size):\n(o)verwrite, (r)esume, (s)kip, (O)verwrite All, (R)esume All, (S)kip All: (%c)"), pos, srcsize, destsize, defaction);
 
-          gftp_text_ask_question (question, 1, &buf, 1);
+          gftp_text_ask_question (tdata->fromreq, question, 1, &buf, 1);
 
           switch (buf)
             {
@@ -261,7 +262,7 @@
 
   do
     {
-      gftp_text_ask_question (question, 1, buf, sizeof (buf));
+      gftp_text_ask_question (request, question, 1, buf, sizeof (buf));
       if (strcasecmp (buf, "yes") == 0)
         ret = 1;
       else if (strcasecmp (buf, "no") == 0)
@@ -283,7 +284,7 @@
 
   do
     {
-      gftp_text_ask_question (question, shown, buf, sizeof (buf));
+      gftp_text_ask_question (request, question, shown, buf, sizeof (buf));
     }
   while (*buf == '\0');