Mercurial > gftp.yaz
comparison src/uicommon/gftpui.c @ 380:05ee37a5558b
2003-1-28 Brian Masney <masneyb@gftp.org>
* src/gtk/bookmarks.c src/gtk/dnd.c src/gtk/gftp-gtk.c
src/gtk/gftp-gtk.h src/gtk/gtkui.c src/gtk/menu-items.c
src/gtk/transfer.c - renamed disconnect() to gftpui_disconnect()
* src/gtk/gtkui.c src/text/textui.c src/uicommon/gftpui.c - improved
prompting for the username/password
* src/gtk/gtkui.c src/text/textui.c src/uicommon/gftpui.c - call
gftpui_disconnect() after a command is run and if we are no longer
connected to the remote host
* src/text/gftp-text.c - parse the command line arguments for the host
to connect to
* src/text/textui.c (gftpui_refresh) - clear the cache.
(gftpui_ask_transfer) - check for carriage return or empty string
* src/uicommon/gftp.h - define gftpui_common_cmd_m{get,put}_file()
* lib/sshv2.c - removed temporary "fix"
author | masneyb |
---|---|
date | Wed, 28 Jan 2004 23:46:28 +0000 |
parents | 14da115b149b |
children | 2f5ce7fb5aad |
comparison
equal
deleted
inserted
replaced
379:c9aa122a1b92 | 380:05ee37a5558b |
---|---|
602 void *other_uidata, gftp_request * other_request, | 602 void *other_uidata, gftp_request * other_request, |
603 const char *command) | 603 const char *command) |
604 { | 604 { |
605 gftpui_callback_data * cdata; | 605 gftpui_callback_data * cdata; |
606 intptr_t retries; | 606 intptr_t retries; |
607 char *tempstr; | |
608 | 607 |
609 if (GFTP_IS_CONNECTED (request)) | 608 if (GFTP_IS_CONNECTED (request)) |
610 { | 609 { |
611 gftp_disconnect (request); /* FIXME */ | 610 gftp_disconnect (request); /* FIXME */ |
612 } | 611 } |
625 } | 624 } |
626 | 625 |
627 if (request->need_userpass) | 626 if (request->need_userpass) |
628 { | 627 { |
629 if (request->username == NULL || *request->username == '\0') | 628 if (request->username == NULL || *request->username == '\0') |
630 { | 629 gftpui_prompt_username (uidata, request); |
631 if ((tempstr = gftpui_prompt_username (uidata, request)) != NULL) | |
632 { | |
633 gftp_set_username (request, tempstr); | |
634 gftp_set_password (request, NULL); | |
635 g_free (tempstr); | |
636 } | |
637 } | |
638 | 630 |
639 if (request->username != NULL && | 631 if (request->username != NULL && |
640 strcmp (request->username, "anonymous") != 0 && | 632 strcmp (request->username, "anonymous") != 0 && |
641 (request->password == NULL || *request->password == '\0')) | 633 (request->password == NULL || *request->password == '\0')) |
642 { | 634 gftpui_prompt_password (uidata, request); |
643 if ((tempstr = gftpui_prompt_password (uidata, request)) != NULL) | |
644 { | |
645 gftp_set_password (request, tempstr); | |
646 g_free (tempstr); | |
647 } | |
648 } | |
649 } | 635 } |
650 | 636 |
651 gftp_lookup_request_option (request, "retries", &retries); | 637 gftp_lookup_request_option (request, "retries", &retries); |
652 | 638 |
653 cdata = g_malloc0 (sizeof (*cdata)); | 639 cdata = g_malloc0 (sizeof (*cdata)); |
1063 | 1049 |
1064 if (gftpui_common_commands[i].command != NULL) | 1050 if (gftpui_common_commands[i].command != NULL) |
1065 { | 1051 { |
1066 ret = gftpui_common_commands[i].func (uidata, request, | 1052 ret = gftpui_common_commands[i].func (uidata, request, |
1067 other_uidata, other_request, pos); | 1053 other_uidata, other_request, pos); |
1054 | |
1055 if (!GFTP_IS_CONNECTED (request)) | |
1056 gftpui_disconnect (uidata); | |
1068 } | 1057 } |
1069 else | 1058 else |
1070 { | 1059 { |
1071 gftpui_common_logfunc (gftp_logging_error, request, | 1060 gftpui_common_logfunc (gftp_logging_error, request, |
1072 _("Error: Command not recognized\n")); | 1061 _("Error: Command not recognized\n")); |