From 2644460defb7119ee7794073f1cb92c249f3df01 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 23 Mar 2018 15:04:20 +0000 Subject: [PATCH] WebView 1.73: user can download link contents git-svn-id: svn://kolibrios.org@7208 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/TWB/TWB.c | 5 +++-- programs/cmm/browser/WebView.c | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c index fdcc8a0f5b..ce36c7788f 100644 --- a/programs/cmm/TWB/TWB.c +++ b/programs/cmm/TWB/TWB.c @@ -295,7 +295,8 @@ void TWebBrowser::SetStyle() { debugln("Document has no information about encoding, UTF will be used"); } if (opened) { - if (!strcmp(#header, #version)) { + if (strcmp(#header, #version) != 0) { + debugln("!!!!!!!!!!!!!!!!!!!!!!"); ChangeCharset(charsets[cur_encoding], "CP866", #header); sprintf(#header, "%s - %s", #header, #version); } @@ -355,7 +356,7 @@ void TWebBrowser::SetStyle() { if (istag("blockquote")) { style.blq = opened; return; } if (istag("pre")) || (istag("code")) { style.pre = opened; return; } if (istag("img")) { ImgCache.Images( left1, draw_y, WB1.list.w); return; } - if (istag("h1")) || (istag("h2")) || (istag("h3")) || (istag("h4")) || (istag("caption")) { + if (istag("h1")) || (istag("h2")) || (istag("h3")) || (istag("caption")) { style.h = opened; if (opened) { diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 113c47ae18..010e1868f5 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -31,7 +31,7 @@ char homepage[] = FROM "html\\homepage.htm""\0"; #ifdef LANG_RUS -char version[]="Текстовый браузер 1.72"; +char version[]="Текстовый браузер 1.73"; ?define IMAGES_CACHE_CLEARED "Кэш картинок очищен" ?define T_LAST_SLIDE "Это последний слайд" char loading[] = "Загрузка страницы...
"; @@ -43,9 +43,10 @@ char rmb_menu[] = История Менеджер загрузок"; char link_menu[] = -"Копировать ссылку"; +"Копировать ссылку +Скачать содержимое ссылки"; #else -char version[]="Text-based Browser 1.72"; +char version[]="Text-based Browser 1.73"; ?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define T_LAST_SLIDE "This slide is the last" char loading[] = "Loading...
"; @@ -57,7 +58,8 @@ Edit source History Download Manager"; char link_menu[] = -"Copy link"; +"Copy link +Download link contents"; #endif @@ -98,7 +100,8 @@ enum { VIEW_HISTORY, //FREE_IMG_CACHE, DOWNLOAD_MANAGER, - COPY_LINK=1200 + COPY_LINK=1200, + DOWNLOAD_LINK_CONTENTS, }; #include "..\TWB\TWB.c" @@ -378,6 +381,12 @@ void ProcessEvent(dword id__) Clipboard__CopyText(PageLinks.GetURL(PageLinks.active)); notify("'URL copied to clipboard'O"); return; + case DOWNLOAD_LINK_CONTENTS: + if (!downloader_opened) { + strcpy(#downloader_edit, PageLinks.GetURL(PageLinks.active)); + CreateThread(#Downloader,#downloader_stak+4092); + } + return; } } @@ -600,7 +609,7 @@ void EventShowPageMenu(dword _left, _top) void EventShowLinkMenu(dword _left, _top) { - menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 180, #link_menu, COPY_LINK); + menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 220, #link_menu, COPY_LINK); }