[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>
This commit is contained in:
@@ -1,3 +1,15 @@
|
|||||||
|
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>
|
2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 03439] restore alarm event
|
* [w3m-dev 03439] restore alarm event
|
||||||
@@ -4802,4 +4814,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-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 $
|
||||||
|
|||||||
@@ -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
|
* w3m: WWW wo Miru utility
|
||||||
*
|
*
|
||||||
@@ -177,6 +177,7 @@ void bzero(void *, int);
|
|||||||
#define BP_NO_URL 0x10
|
#define BP_NO_URL 0x10
|
||||||
#define BP_REDIRECTED 0x20
|
#define BP_REDIRECTED 0x20
|
||||||
#define BP_CLOSE 0x40
|
#define BP_CLOSE 0x40
|
||||||
|
#define BP_RELOAD 0x80
|
||||||
|
|
||||||
/* Link Buffer */
|
/* Link Buffer */
|
||||||
#define LB_NOLINK -1
|
#define LB_NOLINK -1
|
||||||
@@ -466,6 +467,7 @@ typedef struct _DownloadList {
|
|||||||
struct _DownloadList *next;
|
struct _DownloadList *next;
|
||||||
struct _DownloadList *prev;
|
struct _DownloadList *prev;
|
||||||
} DownloadList;
|
} DownloadList;
|
||||||
|
#define DOWNLOAD_LIST_TITLE "Download List Panel"
|
||||||
|
|
||||||
#define COPY_BUFPOSITION(dstbuf, srcbuf) {\
|
#define COPY_BUFPOSITION(dstbuf, srcbuf) {\
|
||||||
(dstbuf)->topLine = (srcbuf)->topLine; \
|
(dstbuf)->topLine = (srcbuf)->topLine; \
|
||||||
|
|||||||
@@ -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
|
#define MAINPROGRAM
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -986,6 +986,8 @@ main(int argc, char **argv, char **envp)
|
|||||||
mouse_active();
|
mouse_active();
|
||||||
#endif /* USE_MOUSE */
|
#endif /* USE_MOUSE */
|
||||||
#ifdef USE_ALARM
|
#ifdef USE_ALARM
|
||||||
|
if (Currentbuf->bufferprop & BP_RELOAD)
|
||||||
|
setAlarmEvent(1, AL_IMPLICIT, FUNCNAME_reload, NULL);
|
||||||
if (CurrentAlarm.status & AL_IMPLICIT) {
|
if (CurrentAlarm.status & AL_IMPLICIT) {
|
||||||
CurrentAlarm.buffer = Currentbuf;
|
CurrentAlarm.buffer = Currentbuf;
|
||||||
CurrentAlarm.status = AL_IMPLICIT_DONE
|
CurrentAlarm.status = AL_IMPLICIT_DONE
|
||||||
@@ -4334,6 +4336,10 @@ reload(void)
|
|||||||
int multipart;
|
int multipart;
|
||||||
|
|
||||||
if (Currentbuf->bufferprop & BP_INTERNAL) {
|
if (Currentbuf->bufferprop & BP_INTERNAL) {
|
||||||
|
if (!strcmp(Currentbuf->buffername, DOWNLOAD_LIST_TITLE)) {
|
||||||
|
ldDL();
|
||||||
|
return;
|
||||||
|
}
|
||||||
disp_err_message("Can't reload...", FALSE);
|
disp_err_message("Can't reload...", FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -5809,10 +5815,9 @@ DownloadListBuffer(void)
|
|||||||
if (!FirstDL)
|
if (!FirstDL)
|
||||||
return NULL;
|
return NULL;
|
||||||
cur_time = time(0);
|
cur_time = time(0);
|
||||||
src = Strnew_charp("<html><head><title>Download Panel</title></head>\
|
src = Strnew_charp("<html><head><title>" DOWNLOAD_LIST_TITLE \
|
||||||
<body><h1 align=center>Download Panel</h1>\
|
"</title></head>\n<body><h1 align=center>" DOWNLOAD_LIST_TITLE "</h1>\n" \
|
||||||
<form method=internal action=download>\
|
"<form method=internal action=download><hr>\n");
|
||||||
<input type=submit name=update value=Update><hr>\n");
|
|
||||||
for (d = LastDL; d != NULL; d = d->prev) {
|
for (d = LastDL; d != NULL; d = d->prev) {
|
||||||
#ifdef HAVE_LSTAT
|
#ifdef HAVE_LSTAT
|
||||||
if (lstat(d->lock, &st))
|
if (lstat(d->lock, &st))
|
||||||
@@ -5888,9 +5893,7 @@ download_action(struct parsed_tagarg *arg)
|
|||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
for (; arg; arg = arg->next) {
|
for (; arg; arg = arg->next) {
|
||||||
if (!strcmp(arg->arg, "update"))
|
if (!strncmp(arg->arg, "stop", 4)) {
|
||||||
break;
|
|
||||||
else if (!strncmp(arg->arg, "stop", 4)) {
|
|
||||||
pid = (pid_t) atoi(&arg->arg[4]);
|
pid = (pid_t) atoi(&arg->arg[4]);
|
||||||
kill(pid, SIGKILL);
|
kill(pid, SIGKILL);
|
||||||
}
|
}
|
||||||
@@ -5913,10 +5916,8 @@ download_action(struct parsed_tagarg *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FirstDL) {
|
if (FirstDL)
|
||||||
ldDL();
|
ldDL();
|
||||||
deletePrevBuf();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
backBf();
|
backBf();
|
||||||
}
|
}
|
||||||
@@ -5940,8 +5941,27 @@ stopDownload(void)
|
|||||||
void
|
void
|
||||||
ldDL(void)
|
ldDL(void)
|
||||||
{
|
{
|
||||||
|
Buffer *prev = Currentbuf;
|
||||||
|
int delete = FALSE;
|
||||||
|
#ifdef USE_ALARM
|
||||||
|
int reload;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!FirstDL)
|
if (!FirstDL)
|
||||||
return;
|
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);
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user