Mercurial > gftp.yaz
comparison src/gtk/gtkui_transfer.c @ 582:5df46f79d9c1
2004-10-4 Brian Masney <masneyb@gftp.org>
* lib/protocols.c (gftp_string_from_utf8,gftp_string_to_utf8) - added
more printf() functions whenever there is a problem converting a string
* src/gtk/gtkui_transfer.c (gftpui_ask_transfer) - make sure the
filename that is to be displayed to the user is encoded in UTF8
author | masneyb |
---|---|
date | Tue, 05 Oct 2004 00:13:09 +0000 |
parents | 39e9945288ea |
children | 056c54ac52a0 |
comparison
equal
deleted
inserted
replaced
581:abcb6713b6b8 | 582:5df46f79d9c1 |
---|---|
204 | 204 |
205 void | 205 void |
206 gftpui_ask_transfer (gftp_transfer * tdata) | 206 gftpui_ask_transfer (gftp_transfer * tdata) |
207 { | 207 { |
208 char *dltitles[4], *add_data[4] = { NULL, NULL, NULL, NULL }, | 208 char *dltitles[4], *add_data[4] = { NULL, NULL, NULL, NULL }, |
209 tempstr[50], temp1str[50], *pos; | 209 tempstr[50], temp1str[50], *pos, *utf8_file; |
210 GtkWidget * dialog, * tempwid, * scroll, * hbox; | 210 GtkWidget * dialog, * tempwid, * scroll, * hbox; |
211 gftp_file * tempfle; | 211 gftp_file * tempfle; |
212 GList * templist; | 212 GList * templist; |
213 size_t len; | 213 size_t len; |
214 int i; | 214 int i; |
288 | 288 |
289 pos = tempfle->destfile; | 289 pos = tempfle->destfile; |
290 len = strlen (tdata->toreq->directory); | 290 len = strlen (tdata->toreq->directory); |
291 if (strncmp (pos, tdata->toreq->directory, len) == 0) | 291 if (strncmp (pos, tdata->toreq->directory, len) == 0) |
292 pos = tempfle->destfile + len + 1; | 292 pos = tempfle->destfile + len + 1; |
293 add_data[0] = pos; | 293 |
294 utf8_file = gftp_string_to_utf8 (tdata->toreq, pos); | |
295 add_data[0] = utf8_file != NULL ? utf8_file : pos; | |
294 | 296 |
295 gftp_get_transfer_action (tdata->fromreq, tempfle); | 297 gftp_get_transfer_action (tdata->fromreq, tempfle); |
296 switch (tempfle->transfer_action) | 298 switch (tempfle->transfer_action) |
297 { | 299 { |
298 case GFTP_TRANS_ACTION_OVERWRITE: | 300 case GFTP_TRANS_ACTION_OVERWRITE: |
313 add_data[2] = insert_commas (tempfle->startsize, temp1str, | 315 add_data[2] = insert_commas (tempfle->startsize, temp1str, |
314 sizeof (temp1str)); | 316 sizeof (temp1str)); |
315 | 317 |
316 i = gtk_clist_append (GTK_CLIST (tdata->clist), add_data); | 318 i = gtk_clist_append (GTK_CLIST (tdata->clist), add_data); |
317 gtk_clist_set_row_data (GTK_CLIST (tdata->clist), i, tempfle); | 319 gtk_clist_set_row_data (GTK_CLIST (tdata->clist), i, tempfle); |
320 | |
321 if (utf8_file != NULL) | |
322 g_free (utf8_file); | |
318 } | 323 } |
319 | 324 |
320 gtk_clist_select_all (GTK_CLIST (tdata->clist)); | 325 gtk_clist_select_all (GTK_CLIST (tdata->clist)); |
321 | 326 |
322 hbox = gtk_hbox_new (TRUE, 20); | 327 hbox = gtk_hbox_new (TRUE, 20); |