33 |
#include "ui.h" |
#include "ui.h" |
34 |
#include "ui_draw.h" |
#include "ui_draw.h" |
35 |
#include "transfer.h" |
#include "transfer.h" |
|
#include "get.h" |
|
36 |
#include "settings.h" |
#include "settings.h" |
37 |
#include "format.h" |
#include "format.h" |
38 |
|
|
192 |
refresh(); |
refresh(); |
193 |
} |
} |
194 |
return 1; |
return 1; |
|
case 'S': |
|
|
/* Search for new sources on all downloads at once. */ |
|
|
for (i = 0; i < tree_children(&downloads)->num; i++) { |
|
|
t = list_index(tree_children(&downloads), i); |
|
|
if (t->transferred != t->filesize) |
|
|
download_search(t); |
|
|
} |
|
|
update_downloads(); |
|
|
refresh(); |
|
|
return 1; |
|
195 |
} |
} |
196 |
|
|
197 |
/* This is getting clearer, but still ugly... */ |
/* This is getting clearer, but still ugly... */ |
269 |
update_func(); |
update_func(); |
270 |
refresh(); |
refresh(); |
271 |
return 1; |
return 1; |
|
case 's': |
|
|
/* Issue a new search if one is not already running. Also |
|
|
don't search if the download is finished. */ |
|
|
if (active_tree == &uploads) |
|
|
break; |
|
|
if (t->transferred != t->filesize) { |
|
|
download_search(t); |
|
|
update_func(); |
|
|
refresh(); |
|
|
} |
|
|
return 1; |
|
272 |
case 'T': |
case 'T': |
273 |
case 't': |
case 't': |
274 |
if (s) { |
if (s) { |
533 |
if (!strcmp(key, "transferred")) |
if (!strcmp(key, "transferred")) |
534 |
RETURN_LONG(t->transferred); |
RETURN_LONG(t->transferred); |
535 |
if (!strcmp(key, "searching")) |
if (!strcmp(key, "searching")) |
536 |
RETURN_INT(!!t->search_id); |
RETURN_INT(0); /* FIXME */ |
537 |
if (!strcmp(key, "expanded")) |
if (!strcmp(key, "expanded")) |
538 |
RETURN_INT(t->tnode.expanded); |
RETURN_INT(t->tnode.expanded); |
539 |
if (!strcmp(key, "sources")) |
if (!strcmp(key, "sources")) |
541 |
if (!strcmp(key, "status")) |
if (!strcmp(key, "status")) |
542 |
RETURN_STR(_(t->status)); |
RETURN_STR(_(t->status)); |
543 |
if (!strcmp(key, "active")) |
if (!strcmp(key, "active")) |
544 |
RETURN_INT(t->id && !t->paused); |
RETURN_INT(t->active && !t->paused); |
545 |
if (!strcmp(key, "eta")) |
if (!strcmp(key, "eta")) |
546 |
RETURN_INT(t->bw.bandwidth ? (t->filesize - t->transferred) / t->bw.bandwidth : 0); |
RETURN_INT(t->bw.bandwidth ? (t->filesize - t->transferred) / t->bw.bandwidth : 0); |
547 |
if (!strcmp(key, "upload")) |
if (!strcmp(key, "upload")) |