aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--ChangeLog11
-rw-r--r--fm.h3
-rw-r--r--main.c31
-rw-r--r--rc.c6
4 files changed, 42 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e6fbe0..6b75e8c 100644
--- 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
@@ -4836,4 +4845,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.528 2002/11/18 16:46:48 ukai Exp $
+$Id: ChangeLog,v 1.529 2002/11/18 17:26:01 ukai Exp $
diff --git a/fm.h b/fm.h
index 794c1d2..fbb2cf8 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.82 2002/11/15 16:14:25 ukai Exp $ */
+/* $Id: fm.h,v 1.83 2002/11/18 17:26:06 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -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
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);
}
diff --git a/rc.c b/rc.c
index 19450b7..af08ac4 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.63 2002/11/14 16:56:24 ukai Exp $ */
+/* $Id: rc.c,v 1.64 2002/11/18 17:26:10 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -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,