w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 2eaaf844e5120dff5fa91d20407b3a632f120e9c
parent 39d8f992c426df144417fd3e42227105b6d13084
Author: ukai <ukai>
Date:   Mon, 18 Nov 2002 17:26:01 +0000

[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:
MChangeLog | 9+++++++++
Mfm.h | 1+
Mmain.c | 29++++++++++++++++++++++++-----
Mrc.c | 4++++
4 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,14 @@ 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [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 + +2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03445] download list for "w3m foo.tar.gz" * main.c (main): display download list diff --git a/fm.h b/fm.h @@ -804,6 +804,7 @@ global TabBuffer *CurrentTab; global TabBuffer *FirstTab; global TabBuffer *LastTab; global int open_tab_blank init(FALSE); +global int open_tab_dl_list init(FALSE); global int close_tab_back init(FALSE); global int nTab; global int TabCols init(10); diff --git a/main.c b/main.c @@ -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); } diff --git a/rc.c b/rc.c @@ -66,6 +66,7 @@ static char *config_file = NULL; #define CMT_ARGV_IS_URL "scheme のない引数も URL とみなす" #define CMT_TSELF "targetが未指定の場合に_selfを使用する" #define CMT_OPEN_TAB_BLANK "targetが_blankか_newの場合は新しいタブで開く" +#define CMT_OPEN_TAB_DL_LIST "Download list panel を新しいタブで開く" #define CMT_DISPLINK "リンク先の自動表示" #define CMT_DISPLINEINFO "現在の行番号の表示" #define CMT_DISP_IMAGE "インライン画像を表示" @@ -218,6 +219,7 @@ static char *config_file = NULL; #define CMT_ARGV_IS_URL "Treat argument without scheme as URL" #define CMT_TSELF "Use _self as default target" #define CMT_OPEN_TAB_BLANK "Open link on new tab if target is _blank or _new" +#define CMT_OPEN_TAB_DL_LIST "Open download list panel on new tab" #define CMT_DISPLINK "Display link URL automatically" #define CMT_DISPLINEINFO "Display current line number" #define CMT_DISP_IMAGE "Display inline images" @@ -499,6 +501,8 @@ struct param_ptr params1[] = { {"target_self", P_CHARINT, PI_ONOFF, (void *)&TargetSelf, CMT_TSELF, NULL}, {"open_tab_blank", P_INT, PI_ONOFF, (void *)&open_tab_blank, CMT_OPEN_TAB_BLANK, NULL}, + {"open_tab_dl_list", P_INT, PI_ONOFF, (void *)&open_tab_dl_list, + CMT_OPEN_TAB_DL_LIST, NULL}, {"display_link", P_INT, PI_ONOFF, (void *)&displayLink, CMT_DISPLINK, NULL}, {"display_lineinfo", P_INT, PI_ONOFF, (void *)&displayLineInfo,