diff options
| author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-15 16:14:25 +0000 | 
|---|---|---|
| committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-15 16:14:25 +0000 | 
| commit | 73d8d35b5f145a65c623ffb17ff1a653d6c3a724 (patch) | |
| tree | ca5e2b70dcc3cffdb328f448fbbe5a387ba9a333 | |
| parent | fix indent (diff) | |
| download | w3m-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>
| -rw-r--r-- | ChangeLog | 14 | ||||
| -rw-r--r-- | fm.h | 4 | ||||
| -rw-r--r-- | main.c | 44 | 
3 files changed, 48 insertions, 14 deletions
@@ -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 $ @@ -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; \ @@ -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  }  | 
