aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-15 16:14:25 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-15 16:14:25 +0000
commit73d8d35b5f145a65c623ffb17ff1a653d6c3a724 (patch)
treeca5e2b70dcc3cffdb328f448fbbe5a387ba9a333
parentfix indent (diff)
downloadw3m-73d8d35b5f145a65c623ffb17ff1a653d6c3a724.tar.gz
w3m-73d8d35b5f145a65c623ffb17ff1a653d6c3a724.zip
[w3m-dev 03440] Re: restore alarm event
* fm.h (BP_RELOAD): added (DOWNLOAD_LIST_TITLE): added * main.c (main): if BP_RELOAD, do reload (reload): if buffer is DOWNLOAD_LIST, ldDL() (DownloadListBuffer): rewrite with DOWNLOAD_LIST_TITLE (download_action): delete "update" don't delete prev buffer (ldDL): rewrite to do reload From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--ChangeLog14
-rw-r--r--fm.h4
-rw-r--r--main.c44
3 files changed, 48 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 4197eb7..ee8ae23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03440] Re: restore alarm event
+ * fm.h (BP_RELOAD): added
+ (DOWNLOAD_LIST_TITLE): added
+ * main.c (main): if BP_RELOAD, do reload
+ (reload): if buffer is DOWNLOAD_LIST, ldDL()
+ (DownloadListBuffer): rewrite with DOWNLOAD_LIST_TITLE
+ (download_action): delete "update"
+ don't delete prev buffer
+ (ldDL): rewrite to do reload
+
+2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03439] restore alarm event
* fm.h (AL_RESTORE): added
* main.c (alarm_sec): deleted
@@ -4802,4 +4814,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.523 2002/11/15 16:05:13 ukai Exp $
+$Id: ChangeLog,v 1.524 2002/11/15 16:14:25 ukai Exp $
diff --git a/fm.h b/fm.h
index f4f68e3..794c1d2 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.81 2002/11/15 16:05:15 ukai Exp $ */
+/* $Id: fm.h,v 1.82 2002/11/15 16:14:25 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -177,6 +177,7 @@ void bzero(void *, int);
#define BP_NO_URL 0x10
#define BP_REDIRECTED 0x20
#define BP_CLOSE 0x40
+#define BP_RELOAD 0x80
/* Link Buffer */
#define LB_NOLINK -1
@@ -466,6 +467,7 @@ typedef struct _DownloadList {
struct _DownloadList *next;
struct _DownloadList *prev;
} DownloadList;
+#define DOWNLOAD_LIST_TITLE "Download List Panel"
#define COPY_BUFPOSITION(dstbuf, srcbuf) {\
(dstbuf)->topLine = (srcbuf)->topLine; \
diff --git a/main.c b/main.c
index 7e08a65..a778bf0 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.137 2002/11/15 16:05:56 ukai Exp $ */
+/* $Id: main.c,v 1.138 2002/11/15 16:14:25 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -986,6 +986,8 @@ main(int argc, char **argv, char **envp)
mouse_active();
#endif /* USE_MOUSE */
#ifdef USE_ALARM
+ if (Currentbuf->bufferprop & BP_RELOAD)
+ setAlarmEvent(1, AL_IMPLICIT, FUNCNAME_reload, NULL);
if (CurrentAlarm.status & AL_IMPLICIT) {
CurrentAlarm.buffer = Currentbuf;
CurrentAlarm.status = AL_IMPLICIT_DONE
@@ -4334,6 +4336,10 @@ reload(void)
int multipart;
if (Currentbuf->bufferprop & BP_INTERNAL) {
+ if (!strcmp(Currentbuf->buffername, DOWNLOAD_LIST_TITLE)) {
+ ldDL();
+ return;
+ }
disp_err_message("Can't reload...", FALSE);
return;
}
@@ -5809,10 +5815,9 @@ DownloadListBuffer(void)
if (!FirstDL)
return NULL;
cur_time = time(0);
- src = Strnew_charp("<html><head><title>Download Panel</title></head>\
-<body><h1 align=center>Download Panel</h1>\
-<form method=internal action=download>\
-<input type=submit name=update value=Update><hr>\n");
+ src = Strnew_charp("<html><head><title>" DOWNLOAD_LIST_TITLE \
+"</title></head>\n<body><h1 align=center>" DOWNLOAD_LIST_TITLE "</h1>\n" \
+"<form method=internal action=download><hr>\n");
for (d = LastDL; d != NULL; d = d->prev) {
#ifdef HAVE_LSTAT
if (lstat(d->lock, &st))
@@ -5888,9 +5893,7 @@ download_action(struct parsed_tagarg *arg)
pid_t pid;
for (; arg; arg = arg->next) {
- if (!strcmp(arg->arg, "update"))
- break;
- else if (!strncmp(arg->arg, "stop", 4)) {
+ if (!strncmp(arg->arg, "stop", 4)) {
pid = (pid_t) atoi(&arg->arg[4]);
kill(pid, SIGKILL);
}
@@ -5913,10 +5916,8 @@ download_action(struct parsed_tagarg *arg)
}
}
}
- if (FirstDL) {
+ if (FirstDL)
ldDL();
- deletePrevBuf();
- }
else
backBf();
}
@@ -5940,8 +5941,27 @@ stopDownload(void)
void
ldDL(void)
{
+ Buffer *prev = Currentbuf;
+ int delete = FALSE;
+#ifdef USE_ALARM
+ int reload;
+#endif
+
if (!FirstDL)
return;
+ if (Currentbuf->bufferprop & BP_INTERNAL &&
+ !strcmp(Currentbuf->buffername, DOWNLOAD_LIST_TITLE))
+ delete = TRUE;
+#ifdef USE_ALARM
+ reload = checkDownloadList();
+#endif
cmd_loadBuffer(DownloadListBuffer(), BP_NO_URL, LB_NOLINK);
- nextA();
+ if (delete && Currentbuf != prev)
+ deletePrevBuf();
+#ifdef USE_ALARM
+ if (reload && Currentbuf != prev) {
+ Currentbuf->bufferprop |= BP_RELOAD;
+ setAlarmEvent(1, AL_IMPLICIT, FUNCNAME_reload, NULL);
+ }
+#endif
}