aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-18 17:26:01 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-18 17:26:01 +0000
commit285d4c762fc8e691ff300744d4975b71d94f38f8 (patch)
tree5b1f4091078d980617b379c03311c45c5be36a1a /main.c
parent[w3m-dev 03445] download list for "w3m foo.tar.gz" (diff)
downloadw3m-285d4c762fc8e691ff300744d4975b71d94f38f8.tar.gz
w3m-285d4c762fc8e691ff300744d4975b71d94f38f8.zip
[w3m-dev 03446] Open download list panel on new tab
* fm.h (open_tab_dl_list): added * main.c (download_action): buffer delete when download done (ldDL): open buf in new tab if open_tab_dl_list * rc.c (CMT_OPEN_TAB_DL_LIST): added (open_tab_dl_list): added From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--main.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/main.c b/main.c
index e51f70e..f006293 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.141 2002/11/18 16:46:52 ukai Exp $ */
+/* $Id: main.c,v 1.142 2002/11/18 17:26:07 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -5934,8 +5934,15 @@ download_action(struct parsed_tagarg *arg)
}
if (FirstDL)
ldDL();
- else
- backBf();
+ else {
+ if (Currentbuf == Firstbuf && Currentbuf->nextBuffer == NULL) {
+ if (nTab > 1)
+ deleteTab(CurrentTab);
+ }
+ else
+ delBuffer(Currentbuf);
+ displayBuffer(Currentbuf, B_FORCE_REDRAW);
+ }
}
void
@@ -5958,7 +5965,7 @@ void
ldDL(void)
{
Buffer *prev = Currentbuf;
- int delete = FALSE;
+ int delete = FALSE, new_tab = FALSE;
#ifdef USE_ALARM
int reload;
#endif
@@ -5968,14 +5975,26 @@ ldDL(void)
if (Currentbuf->bufferprop & BP_INTERNAL &&
!strcmp(Currentbuf->buffername, DOWNLOAD_LIST_TITLE))
delete = TRUE;
+ else if (open_tab_dl_list) {
+ _newT();
+ prev = Currentbuf;
+ delete = TRUE;
+ new_tab = TRUE;
+ }
#ifdef USE_ALARM
reload = checkDownloadList();
#endif
cmd_loadBuffer(DownloadListBuffer(), BP_NO_URL, LB_NOLINK);
- if (delete && Currentbuf != prev)
+ if (Currentbuf == prev) {
+ if (new_tab)
+ deleteTab(CurrentTab);
+ displayBuffer(Currentbuf, B_FORCE_REDRAW);
+ return;
+ }
+ if (delete)
deletePrevBuf();
#ifdef USE_ALARM
- if (reload && Currentbuf != prev) {
+ if (reload) {
Currentbuf->bufferprop |= BP_RELOAD;
setAlarmEvent(1, AL_IMPLICIT, FUNCNAME_reload, NULL);
}