Mercurial > gftp.yaz
comparison src/text/textui.c @ 377:14da115b149b
2003-1-23 Brian Masney <masneyb@gftp.org>
* src/text/gftp-text.c src/uicommon/gftpui.c - added file transfer
functions to the command line.
* src/uicommon/gftpui_transfer.c src/uicommon/gftpui.h src/text/textui.c
src/gtk/gtkui_transfer.c - added
gftpui_{start,update,finish}_current_file_in_transfer() functions
that will be called throughout the lifetime of a file transfer.
Also, gftpui_start_transfer() that will be called whenever a file
transfer is created
* src/uicommon/gftpui.h src/uicommon/gftpui.c src/gtk/gftp-gtk.c
src/gtk/transfer.c - added other_uidata and other_request arguments
to all of the command line functions
* lib/protocols.c lib/gftp.h - set the filespec argument to
gftp_get_next_file to be a constant
* lib/gftp.h - added tot_file_trans variable to gftp_transfer struct
author | masneyb |
---|---|
date | Sat, 24 Jan 2004 11:45:11 +0000 |
parents | d5409bf03ff1 |
children | 712d3810f4e1 |
comparison
equal
deleted
inserted
replaced
376:6b25e7a2ff20 | 377:14da115b149b |
---|---|
81 } | 81 } |
82 | 82 |
83 | 83 |
84 void | 84 void |
85 gftpui_add_file_to_transfer (gftp_transfer * tdata, GList * curfle, | 85 gftpui_add_file_to_transfer (gftp_transfer * tdata, GList * curfle, |
86 char *filepos ) | 86 char *filepos ) |
87 { | 87 { |
88 /* FIXME */ | 88 /* FIXME */ |
89 } | 89 } |
90 | 90 |
91 | 91 |
93 gftpui_ask_transfer (gftp_transfer * tdata) | 93 gftpui_ask_transfer (gftp_transfer * tdata) |
94 { | 94 { |
95 /* FIXME */ | 95 /* FIXME */ |
96 } | 96 } |
97 | 97 |
98 | |
99 static void | |
100 _gftpui_text_print_status (gftp_transfer * tdata) | |
101 { | |
102 static int progress_pos = 0; | |
103 char *progress = "|/-\\"; | |
104 int sw, tot, i; | |
105 | |
106 printf ("\r%c [", progress[progress_pos++]); | |
107 | |
108 if (progress[progress_pos] == '\0') | |
109 progress_pos = 0; | |
110 | |
111 sw = gftp_text_get_win_size () - 20; | |
112 tot = (float) tdata->curtrans / (float) tdata->tot_file_trans * (float) sw; | |
113 | |
114 if (tot > sw) | |
115 tot = sw; | |
116 | |
117 for (i=0; i<tot; i++) | |
118 printf ("="); | |
119 | |
120 for (i=0; i<sw-tot; i++) | |
121 printf (" "); | |
122 | |
123 printf ("] @ %.2fKB/s", tdata->kbs); | |
124 | |
125 fflush (stdout); | |
126 } | |
127 | |
128 | |
129 void | |
130 gftpui_start_current_file_in_transfer (gftp_transfer * tdata) | |
131 { | |
132 _gftpui_text_print_status (tdata); | |
133 } | |
134 | |
135 | |
136 void | |
137 gftpui_update_current_file_in_transfer (gftp_transfer * tdata) | |
138 { | |
139 _gftpui_text_print_status (tdata); | |
140 } | |
141 | |
142 | |
143 void | |
144 gftpui_finish_current_file_in_transfer (gftp_transfer * tdata) | |
145 { | |
146 _gftpui_text_print_status (tdata); | |
147 printf ("\n"); | |
148 } | |
149 | |
150 | |
151 void | |
152 gftpui_start_transfer (gftp_transfer * tdata) | |
153 { | |
154 gftpui_common_transfer_files (tdata); | |
155 } | |
156 |