summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-20 14:09:08 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-20 14:09:08 +0200
commitdf0e00463c5b55f89471720c1bf4d83e1f428aae (patch)
tree00f39e4c7d7308e5b1d65473a538c691181abefa /src/ui/documentwidget.c
parentc998b25d4d428e860520bb8fa4fd5450c1b865fd (diff)
Preferences: Added a Gemini proxy
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 8640e7ae..59f5a92c 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2004,9 +2004,10 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
2004 iArray items; 2004 iArray items;
2005 init_Array(&items, sizeof(iMenuItem)); 2005 init_Array(&items, sizeof(iMenuItem));
2006 if (d->contextLink) { 2006 if (d->contextLink) {
2007 const iString *linkUrl = linkUrl_GmDocument(d->doc, d->contextLink->linkId); 2007 const iString *linkUrl = linkUrl_GmDocument(d->doc, d->contextLink->linkId);
2008 const iRangecc scheme = urlScheme_String(linkUrl); 2008 const iRangecc scheme = urlScheme_String(linkUrl);
2009 if (willUseProxy_App(scheme) || equalCase_Rangecc(scheme, "gemini") || 2009 const iBool isGemini = equalCase_Rangecc(scheme, "gemini");
2010 if (willUseProxy_App(scheme) || isGemini ||
2010 equalCase_Rangecc(scheme, "gopher")) { 2011 equalCase_Rangecc(scheme, "gopher")) {
2011 /* Regular links that we can open. */ 2012 /* Regular links that we can open. */
2012 pushBackN_Array( 2013 pushBackN_Array(
@@ -2031,14 +2032,15 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
2031 format_CStr("!open url:%s", cstr_String(linkUrl)) }); 2032 format_CStr("!open url:%s", cstr_String(linkUrl)) });
2032 } 2033 }
2033 if (willUseProxy_App(scheme)) { 2034 if (willUseProxy_App(scheme)) {
2034 pushBackN_Array(&items, 2035 pushBackN_Array(
2035 (iMenuItem[]){ { "---", 0, 0, NULL }, 2036 &items,
2036 { "Open Link in Default Browser", 2037 (iMenuItem[]){
2037 0, 2038 { "---", 0, 0, NULL },
2038 0, 2039 { isGemini ? "Open without Proxy" : "Open Link in Default Browser",
2039 format_CStr("!open noproxy:1 url:%s", 2040 0,
2040 cstr_String(linkUrl)) } }, 2041 0,
2041 2); 2042 format_CStr("!open noproxy:1 url:%s", cstr_String(linkUrl)) } },
2043 2);
2042 } 2044 }
2043 pushBackN_Array(&items, 2045 pushBackN_Array(&items,
2044 (iMenuItem[]){ { "---", 0, 0, NULL }, 2046 (iMenuItem[]){ { "---", 0, 0, NULL },