From 0154bed8d76b0d0d7eae5e21411f37acadfe6c25 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 8 Dec 2019 17:23:36 +0000 Subject: [PATCH] Add page info icon to Amiga frontend --- frontends/amiga/gui.c | 115 ++++++++++++++++++ frontends/amiga/resources/Themes/AISS/Theme | 5 + .../amiga/resources/Themes/Default/Theme | 5 + resources/FatMessages | 11 +- .../16x16/actions/page-info-insecure.png | Bin 0 -> 527 bytes .../16x16/actions/page-info-internal.png | Bin 0 -> 799 bytes .../icons/16x16/actions/page-info-local.png | Bin 0 -> 456 bytes .../icons/16x16/actions/page-info-secure.png | Bin 0 -> 330 bytes .../icons/16x16/actions/page-info-warning.png | Bin 0 -> 552 bytes 9 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 resources/icons/16x16/actions/page-info-insecure.png create mode 100644 resources/icons/16x16/actions/page-info-internal.png create mode 100644 resources/icons/16x16/actions/page-info-local.png create mode 100644 resources/icons/16x16/actions/page-info-secure.png create mode 100644 resources/icons/16x16/actions/page-info-warning.png diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 5384ffec4..6bb9ffbfb 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -213,6 +213,12 @@ enum GID_FORWARD, GID_THROBBER, GID_SEARCH_ICON, + GID_PAGEINFO, + GID_PAGEINFO_INSECURE_BM, + GID_PAGEINFO_INTERNAL_BM, + GID_PAGEINFO_LOCAL_BM, + GID_PAGEINFO_SECURE_BM, + GID_PAGEINFO_WARNING_BM, GID_FAVE, GID_FAVE_ADD, GID_FAVE_RMV, @@ -2238,6 +2244,7 @@ static void ami_gui_scroller_update(struct gui_window_2 *gwin) } } +/* For future use static void ami_gui_console_log_clear(struct gui_window *g) { if(g->shared->objects[GID_LOG] != NULL) { @@ -2256,6 +2263,7 @@ static void ami_gui_console_log_clear(struct gui_window *g) TAG_DONE); } } +*/ static void ami_gui_console_log_add(struct gui_window *g) { @@ -4534,6 +4542,7 @@ gui_window_create(struct browser_window *bw, char closetab[100],closetab_s[100],closetab_g[100]; char addtab[100],addtab_s[100],addtab_g[100]; char fave[100], unfave[100]; + char pi_insecure[100], pi_internal[100], pi_local[100], pi_secure[100], pi_warning[100]; char tabthrobber[100]; ULONG refresh_mode = WA_SmartRefresh; ULONG defer_layout = TRUE; @@ -4755,6 +4764,12 @@ gui_window_create(struct browser_window *bw, g->shared->helphints[GID_ADDTAB] = translate_escape_chars(messages_get("HelpToolbarAddTab")); + g->shared->helphints[GID_PAGEINFO_INSECURE_BM] = ami_utf8_easy(messages_get("PageInfoInsecure")); + g->shared->helphints[GID_PAGEINFO_LOCAL_BM] = ami_utf8_easy(messages_get("PageInfoLocal")); + g->shared->helphints[GID_PAGEINFO_SECURE_BM] = ami_utf8_easy(messages_get("PageInfoSecure")); + g->shared->helphints[GID_PAGEINFO_WARNING_BM] = ami_utf8_easy(messages_get("PageInfoWarning")); + g->shared->helphints[GID_PAGEINFO_INTERNAL_BM] = ami_utf8_easy(messages_get("PageInfoInternal")); + ami_get_theme_filename(nav_west, "theme_nav_west", false); ami_get_theme_filename(nav_west_s, "theme_nav_west_s", false); ami_get_theme_filename(nav_west_g, "theme_nav_west_g", false); @@ -4779,6 +4794,11 @@ gui_window_create(struct browser_window *bw, ami_get_theme_filename(tabthrobber, "theme_tab_loading", false); ami_get_theme_filename(fave, "theme_fave", false); ami_get_theme_filename(unfave, "theme_unfave", false); + ami_get_theme_filename(pi_insecure, "theme_pageinfo_insecure", false); + ami_get_theme_filename(pi_internal, "theme_pageinfo_internal", false); + ami_get_theme_filename(pi_local, "theme_pageinfo_local", false); + ami_get_theme_filename(pi_secure, "theme_pageinfo_secure", false); + ami_get_theme_filename(pi_warning, "theme_pageinfo_warning", false); g->shared->objects[GID_FAVE_ADD] = BitMapObj, BITMAP_SourceFile, fave, @@ -4808,6 +4828,37 @@ gui_window_create(struct browser_window *bw, BITMAP_Masking, TRUE, BitMapEnd; + g->shared->objects[GID_PAGEINFO_INSECURE_BM] = BitMapObj, + BITMAP_SourceFile, pi_insecure, + BITMAP_Screen, scrn, + BITMAP_Masking, TRUE, + BitMapEnd; + + g->shared->objects[GID_PAGEINFO_INTERNAL_BM] = BitMapObj, + BITMAP_SourceFile, pi_internal, + BITMAP_Screen, scrn, + BITMAP_Masking, TRUE, + BitMapEnd; + + g->shared->objects[GID_PAGEINFO_LOCAL_BM] = BitMapObj, + BITMAP_SourceFile, pi_local, + BITMAP_Screen, scrn, + BITMAP_Masking, TRUE, + BitMapEnd; + + g->shared->objects[GID_PAGEINFO_SECURE_BM] = BitMapObj, + BITMAP_SourceFile, pi_secure, + BITMAP_Screen, scrn, + BITMAP_Masking, TRUE, + BitMapEnd; + + g->shared->objects[GID_PAGEINFO_WARNING_BM] = BitMapObj, + BITMAP_SourceFile, pi_warning, + BITMAP_Screen, scrn, + BITMAP_Masking, TRUE, + BitMapEnd; + + if(ClickTabBase->lib_Version < 53) { addtabclosegadget = LAYOUT_AddChild; @@ -4966,6 +5017,14 @@ gui_window_create(struct browser_window *bw, SpaceEnd, CHILD_WeightedWidth, 0, CHILD_WeightedHeight, 0, + LAYOUT_AddChild, g->shared->objects[GID_PAGEINFO] = ButtonObj, + GA_ID, GID_PAGEINFO, + GA_RelVerify, TRUE, + GA_ReadOnly, TRUE, + BUTTON_RenderImage, g->shared->objects[GID_PAGEINFO_INTERNAL_BM], + ButtonEnd, + CHILD_WeightedWidth, 0, + CHILD_WeightedHeight, 0, LAYOUT_AddChild, g->shared->objects[GID_URL] = #ifdef __amigaos4__ NewObject(urlStringClass, NULL, @@ -5335,6 +5394,11 @@ static void gui_window_destroy(struct gui_window *g) DisposeObject(g->shared->objects[GID_TABS_FLAG]); DisposeObject(g->shared->objects[GID_FAVE_ADD]); DisposeObject(g->shared->objects[GID_FAVE_RMV]); + DisposeObject(g->shared->objects[GID_PAGEINFO_INSECURE_BM]); + DisposeObject(g->shared->objects[GID_PAGEINFO_INTERNAL_BM]); + DisposeObject(g->shared->objects[GID_PAGEINFO_LOCAL_BM]); + DisposeObject(g->shared->objects[GID_PAGEINFO_SECURE_BM]); + DisposeObject(g->shared->objects[GID_PAGEINFO_WARNING_BM]); ami_gui_opts_websearch_free(g->shared->web_search_list); if(g->shared->search_bm) DisposeObject(g->shared->search_bm); @@ -6005,6 +6069,53 @@ static void gui_window_new_content(struct gui_window *g) ami_gui_scroller_update(g->shared); } +static nserror gui_page_info_change(struct gui_window *gw) +{ + int bm_idx; + browser_window_page_info_state pistate; + struct gui_window_2 *gwin = ami_gui_get_gui_window_2(gw); + struct browser_window *bw = ami_gui_get_browser_window(gw); + + pistate = browser_window_get_page_info_state(bw); + + switch(pistate) { + case PAGE_STATE_INTERNAL: + bm_idx = GID_PAGEINFO_INTERNAL_BM; + break; + + case PAGE_STATE_LOCAL: + bm_idx = GID_PAGEINFO_LOCAL_BM; + break; + + case PAGE_STATE_INSECURE: + bm_idx = GID_PAGEINFO_INSECURE_BM; + break; + + case PAGE_STATE_SECURE_OVERRIDE: + bm_idx = GID_PAGEINFO_WARNING_BM; + break; + + case PAGE_STATE_SECURE_ISSUES: + bm_idx = GID_PAGEINFO_WARNING_BM; + break; + + case PAGE_STATE_SECURE: + bm_idx = GID_PAGEINFO_SECURE_BM; + break; + + default: + bm_idx = GID_PAGEINFO_INTERNAL_BM; + break; + } + + RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_PAGEINFO], gwin->win, NULL, + BUTTON_RenderImage, gwin->objects[bm_idx], + GA_HintInfo, gwin->helphints[bm_idx], + TAG_DONE); + + return NSERROR_OK; +} + static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type, const struct rect *rect) { @@ -6319,6 +6430,10 @@ gui_window_event(struct gui_window *gw, enum gui_window_event event) gui_window_stop_throbber(gw); break; + case GW_EVENT_PAGE_INFO_CHANGE: + gui_page_info_change(gw); + break; + default: break; } diff --git a/frontends/amiga/resources/Themes/AISS/Theme b/frontends/amiga/resources/Themes/AISS/Theme index 8c5af103c..f8265bf73 100755 --- a/frontends/amiga/resources/Themes/AISS/Theme +++ b/frontends/amiga/resources/Themes/AISS/Theme @@ -31,6 +31,11 @@ theme_tab_loading:*TBImages:list_download theme_search:*TBImages:list_search theme_fave:*TBImages:list_favouriteadd theme_unfave:*TBImages:list_favourite +theme_pageinfo_insecure:*TBImages:list_warning +theme_pageinfo_internal:*TBImages:list_info +theme_pageinfo_local:*TBImages:list_info +theme_pageinfo_secure:*TBImages:list_securezone +theme_pageinfo_warning:*TBImages:list_warning ptr_default:*PROGDIR:Resources/Pointers/Default ptr_point:*PROGDIR:Resources/Pointers/Point ptr_caret:*PROGDIR:Resources/Pointers/Caret diff --git a/frontends/amiga/resources/Themes/Default/Theme b/frontends/amiga/resources/Themes/Default/Theme index 141e84f54..7e8e9c8d6 100755 --- a/frontends/amiga/resources/Themes/Default/Theme +++ b/frontends/amiga/resources/Themes/Default/Theme @@ -44,6 +44,11 @@ theme_tab_loading: theme_search:search.png theme_fave:*PROGDIR:Resources/icons/hotlist-add.png theme_unfave:*PROGDIR:Resources/icons/hotlist-rmv.png +theme_pageinfo_insecure:*PROGDIR:Resources/icons/16x16/actions/page-info-insecure.png +theme_pageinfo_internal:*PROGDIR:Resources/icons/16x16/actions/page-info-internal.png +theme_pageinfo_local:*PROGDIR:Resources/icons/16x16/actions/page-info-local.png +theme_pageinfo_secure:*PROGDIR:Resources/icons/16x16/actions/page-info-secure.png +theme_pageinfo_warning:*PROGDIR:Resources/icons/16x16/actions/page-info-warning.png ptr_default:*PROGDIR:Resources/Pointers/Default ptr_point:*PROGDIR:Resources/Pointers/Point ptr_caret:*PROGDIR:Resources/Pointers/Caret diff --git a/resources/FatMessages b/resources/FatMessages index c5cfd3e21..745fa9ea7 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -4084,7 +4084,7 @@ nl.ro.HelpToolbarFav:Dit is het websitesymbool: een kleine logo dat meegeleverd en.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. de.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. fr.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. -it.ro.HelpToolbarHot:\Tindicatore segnalibri: se acceso significa che il corrente indirizzo è presente nei segnalibri.|M\Sper aggiungere il corrente indirizzo ai segnalibri.|M\Aper rimuovere il corrente indirizzo dai segnalibri. +it.ro.HelpToolbarHot:\Tindicatore segnalibri: se acceso significa che il corrente indirizzo \E8 presente nei segnalibri.|M\Sper aggiungere il corrente indirizzo ai segnalibri.|M\Aper rimuovere il corrente indirizzo dai segnalibri. nl.ro.HelpToolbarHot:Dit is de favorietenindicator: wanneer deze oplicht, staat het webadres al in de favorietenlijst.|MKlik met KIES om het adres aan de favorietenlijst toe te voegen.|MKlik met PASAAN om het adres uit de favorietenlijst te verwijderen. en.ro.HelpStatus0:\Tstatus bar resizer.|MDrag to alter the size of the status bar. @@ -5168,7 +5168,7 @@ nl.ro.HelpCacheConfig:Diverse bufferinstelligen kunnen in dit venster gewijzigd en.ro.HelpCacheConfig3:\Tamount of memory to be used for caching content. de.ro.HelpCacheConfig3:Speichergröße, die verwendet wird um Inhalte zwischenzuspeichern. fr.ro.HelpCacheConfig3:\Tla quantité de mémoire à utiliser pour le contenu du cache. -it.ro.HelpCacheConfig3:\Tquantità di memoria da usare per il contenuto della cache. +it.ro.HelpCacheConfig3:\Tquantit\E0 di memoria da usare per il contenuto della cache. nl.ro.HelpCacheConfig3:Dit invoerveld toont de hoeveelheid geheugen die wordt gebruikt om de pagina-inhoud te bufferen. en.ro.HelpCacheConfig4:\Sreduce the amount of memory. de.ro.HelpCacheConfig4:Klicken mit AUSWAHL verringert die Größe des Cachespeichers. @@ -5183,7 +5183,7 @@ nl.ro.HelpCacheConfig5:Klik met KIES om de geheugenruimte groter te maken. en.ro.HelpCacheConfig10:\Tamount of disc space to be used for caching content between sessions. de.ro.HelpCacheConfig10:\Tamount of disc space to be used for caching content between sessions. fr.ro.HelpCacheConfig10:\Tamount of disc space to be used for caching content between sessions. -it.ro.HelpCacheConfig10:\Tquantità di spazio su disco da usare per il contenuto della cache tra le sessioni. +it.ro.HelpCacheConfig10:\Tquantit\E0 di spazio su disco da usare per il contenuto della cache tra le sessioni. nl.ro.HelpCacheConfig10:Dit invoerveld toont de hoeveelheid schijfruimte die wordt gebruikt om de pagina-inhoud tussen sessies te bufferen. en.ro.HelpCacheConfig11:\Sreduce the amount of memory. de.ro.HelpCacheConfig11:Klicken mit AUSWAHL verringert die Größe des Cachespeichers. @@ -5788,6 +5788,11 @@ de.ami.HelpToolbarAddTab:Tab hinzufügen. fr.ami.HelpToolbarAddTab:Add tab\nLMB: Adds a new blank tab it.ami.HelpToolbarAddTab:Apri una nuova scheda nl.ami.HelpToolbarAddTab:Tabblad toevoegen\nLMB: Een nieuwe leeg tabblad wordt geopend +en.ami.PageInfoInsecure:Insecure +en.ami.PageInfoLocal:Local +en.ami.PageInfoSecure:Secure +en.ami.PageInfoWarning:Warning +en.ami.PageInfoInternal:Internal # Configuration tokens diff --git a/resources/icons/16x16/actions/page-info-insecure.png b/resources/icons/16x16/actions/page-info-insecure.png new file mode 100644 index 0000000000000000000000000000000000000000..1a4bc156c5c6437930eac8e7e1e5fb838682a79b GIT binary patch literal 527 zcmV+q0`UEbP)t<88FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10gOpRK~y-6wb3zX6JZ#D;r9~AB5j7)-e3%La4Le})C!#<2#vTz zaEj1DhfW<*&^S~vW+)UzU0lyDRm81h9SXYCf`g!oTM-dW!GbAVUWX<$cP3*$_?91@ zm;b+m6Pjzld!Pdx0PldS0O~3Au6lYDz5#TBJ>UuO6!;FrwOZ}A`pKhtI}8WFH{d5Q zIdFcaTCM*1yS5fvE^DXLYgkJMCINw${R1^;yZzjS1%;z+H2Q(vbl_|+@S=x{?(BSY zdiofHj*aQz;aBy1I#B8bqISD|*^Q0g=JQEhD(U9tmYPrFi@=W{2)t9T+g)BxLa;kO zZ>wJ42hI)qfR77>f?H9fv$IK@&APv|@NTS002ovPDHLkV1mN@=#T&a literal 0 HcmV?d00001 diff --git a/resources/icons/16x16/actions/page-info-internal.png b/resources/icons/16x16/actions/page-info-internal.png new file mode 100644 index 0000000000000000000000000000000000000000..e8422c70901ca86fa5e411272c45ff78817125b2 GIT binary patch literal 799 zcmV+)1K|9LP)C%4g+r`B|Y*C~2(;!_e>d`#*NO-7kRX9|cQGOCPwd`{Ll> z;OWA`f+eLSj$?!nbUK~v@bK`rZnyi~^Sp0gF}c6OySuyJ?Ck8kxxT(`Wm$$XhBQqv z#!#=0;PN}-gZ*=*vvF70-kFbpxq;5g30L|}}`q?F`xIZCAxQc8?5 zXst<-ggA~FjYdc*(OM&=WIP@hCW0UchEhsw+a?S{gb<`@IuRsEf>MekNzhtzdwYv9 z#sjbc27|#5mzS5R5P~?4>GgUDA&^p{lp=~EqA23(>WWsY#mvl%QA&L`>A`qB{;AjN zeYCl`Ip1ov@O_^w%Q!zjr&_JjY&MylouyPN;W!RQM@KKa-R{SLepRGodV2bo(P;Gk z*4CDrWf`95QLooYl7z*@MF5mioSvR`?(XhBRZ6w~)2?- zDIm;Pxu5qvkRe&(8c`CQpH@mmtT}V`<;yx0|TS0r;B5V zMep3p_WqLtMc6*b^ENW7zt-?EaL5*Ttj4q9WWt2AzK5PWu5fSvPvg?%xpkW@qb5pXlTn zXFi-iwA@I6H;3mm>p|r+;_rU{xGuh=(f&iQRD@vvN5xa`ACxZZ5|ue*8JEJ+oN-?; zf$wY(hnJ+I^nc?Tapo6O3fewew`@<8S*}`hcy%>P1Xq0MOV2c;MbrN9%xlkG<(=a# z9oF|-K`dtfAuG2-VaM{Xcr+`leHxzm`<{pNk9GRl%mdKI;Vst0Jk={ssI20 literal 0 HcmV?d00001 diff --git a/resources/icons/16x16/actions/page-info-secure.png b/resources/icons/16x16/actions/page-info-secure.png new file mode 100644 index 0000000000000000000000000000000000000000..7ef0bedd9ddfd28afde9ce490bf43379588ace48 GIT binary patch literal 330 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2>S zWe{e(`b8`j$dD{?jVKAuPb(=;EJ|f4FE7{2%*!rLPAo{(%P&fw{mw=TsOY$-i(`mI z@79aN?`Ln%=#(Ggw)@b|dhg=iZ9hb%|0Fah8m+mgsipUj+t@_;pWyxt<88FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10i{VqK~y-6wU9AOTX7V{fA7U4#N*ghtbVD7=4?|8;qhmzM`|@h+Ep z?mg$8d*OlN9q=8nfootFcza*+2S5Yoz&fx2q=6zZT#al1e}D_1(S^SN{sRZq1R4PW zwtad#jhg66g3FzhCH1q>%gfS~*wsuxk46z#E<*{+ml zrXqTPf6fU4$l5}e$l;*K;h<#q2jr<065ub;>F3}hkSG<&)(A82o5);VvHK%U{UgoN zbQ?e`FzzQ1aobs)e@UpOz`=2juX`B~#ms1eR5DsN>-_-$uX|$*zlwskLFYjVplt#u zR_9vE{!k$hFb&q`nn4tZBK}14ENtv+$lyNSe38M6M$P>9FVm4upw{&0000