commit ae37faa0b9b3a4426c1813a9c4714232e84a5b6f
parent 6867e70d23442c59c53402ab3f766a7ac6c3bdae
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Mon, 26 Jul 2021 15:59:16 +0000
less hacky downloading for type 9 links
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/gophra.c b/gophra.c
@@ -56,8 +56,6 @@ void
threadmain(int argc, char **argv)
{
URI uri;
- Mousectl *mc;
- Keyboardctl *kc;
char *sv;
Mouse mv;
Rune kv;
@@ -129,7 +127,7 @@ threadmain(int argc, char **argv)
if (kv == 'g') {
char buf[256];
buf[0] = 0;
- if (enter("goto:", buf, 255, mc, kc, 0) >=0)
+ if (enter("goto:", buf, 255, mc, kc, nil) >0)
if (runuri(buf) == 0){
drawmenu();
flush = 1;
@@ -375,6 +373,7 @@ extracturi(char *s)
void
handlelink(char *addr, char type, char *path)
{
+ char buf[256];
History *hnew;
switch (type) {
case '0':
@@ -389,7 +388,13 @@ handlelink(char *addr, char type, char *path)
loadtext(addr, path);
break;
case '9':
- save(addr, path, tmpfile);
+ buf[0] = 0;
+ if (enter("save as:", buf, 255, mc, kc, nil) > 0) {
+ snprint(status, 255, "downloading");
+ drawstatus();
+ flushimage(display, 1);
+ save(addr, path, buf);
+ };
break;
case 'I':
if (save(addr, path, tmpfile) == 0) proccreate(runpage, 0, 1024 * 8);