From 4735aa520073100f0815b548b84bed2f9f429bbf Mon Sep 17 00:00:00 2001 From: Edd Barrett Date: Thu, 27 Jan 2011 18:08:41 +0000 Subject: better borders on xtp tables, keybinding for cookie jar, progress bars on download manager, basename on download urls. marco seems busy, 18:01 I expressedly ok your dl diff you prodded marco about, it causes no harm, looks better, and provides nice functionality --- xxxterm.1 | 2 ++ xxxterm.c | 41 +++++++++++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/xxxterm.1 b/xxxterm.1 index abce730..63f66f3 100644 --- a/xxxterm.1 +++ b/xxxterm.1 @@ -187,6 +187,8 @@ Page far right Page far left .It Cm M-f Favorites +.It Cm M-j +Cookie jar .It Cm M-d Download manager .It Cm C-p diff --git a/xxxterm.c b/xxxterm.c index ca2bd68..5c28131 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -270,11 +271,28 @@ struct karg { #define XT_DOCTYPE "" #define XT_HTML_TAG "" #define XT_DLMAN_REFRESH "10" -#define XT_PAGE_STYLE "\n\n" +#define XT_PAGE_STYLE "\n\n" #define XT_MAX_URL_LENGTH (4096) /* 1 page is atomic, don't make bigger */ #define XT_MAX_UNDO_CLOSE_TAB (32) @@ -3423,8 +3441,14 @@ xtp_page_dl_row(struct tab *t, char *html, struct download *dl) fmt_scaled( webkit_download_get_total_size(dl->download), tot_sz); - status_html = g_strdup_printf("%s of %s (%.2f%%)", cur_sz, - tot_sz, progress); + status_html = g_strdup_printf( + "
" + "
" + "
" + "
" + "
%s of %s (%.2f%%)
", + progress, cur_sz, tot_sz, progress); + cmd_html = g_strdup_printf("Cancel", xtp_prefix, XT_XTP_DL_CANCEL, dl->id); @@ -3452,7 +3476,7 @@ xtp_page_dl_row(struct tab *t, char *html, struct download *dl) new_html = g_strdup_printf( "%s\n%s%s" "%s\n", - html, webkit_download_get_uri(dl->download), + html, basename(webkit_download_get_uri(dl->download)), status_html, cmd_html); g_free(html); @@ -4110,6 +4134,7 @@ struct key_bindings { int (*func)(struct tab *, struct karg *); struct karg arg; } keys[] = { + { MOD1, 0, GDK_j, xtp_page_cl, {0} }, { MOD1, 0, GDK_d, xtp_page_dl, {0} }, { MOD1, 0, GDK_h, xtp_page_hl, {0} }, { CTRL, 0, GDK_p, print_page, {0}}, -- cgit 1.4.1-2-gfad0