From 69ef47e68cab336dabb4907ac2a44e3f217a0c25 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 8 May 2020 20:47:39 +0000 Subject: [PATCH] i2ptunnel: Tooltips for disabled options --- apps/i2ptunnel/jsp/editClient.jsi | 24 +++++++++++++++-------- apps/i2ptunnel/jsp/editServer.jsi | 32 ++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/apps/i2ptunnel/jsp/editClient.jsi b/apps/i2ptunnel/jsp/editClient.jsi index 14e4c8d8e0..589bde8859 100644 --- a/apps/i2ptunnel/jsp/editClient.jsi +++ b/apps/i2ptunnel/jsp/editClient.jsi @@ -493,7 +493,13 @@ } // if httpclient int currentSigType = editBean.getSigType(curTunnel, tunnelType); - String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" "; + boolean canChangeSigType = editBean.canChangeSigType(curTunnel); + String stopFirst = editBean.isSharedClient(curTunnel) ? + intl._t("Tunnel and all other shared client tunnels must be stopped to change this configuration") : + intl._t("Tunnel must be stopped to change this configuration"); + String tstopFirst = " title=\"" + stopFirst + "\" "; + String shdisabled = canChangeSigType ? "" : tstopFirst; + String disabled = canChangeSigType ? "" : " disabled=\"disabled\" "; %> @@ -502,12 +508,12 @@ <%=intl._t("Tunnel Cryptography Options")%> - - - -
+ > <%=intl._t("Signature type")%>
- > <% @@ -542,23 +548,25 @@ <% boolean has0 = editBean.hasEncType(curTunnel, 0); boolean has4 = editBean.hasEncType(curTunnel, 4); - String edisabled = editBean.canChangeEncType(curTunnel) ? "" : " disabled=\"disabled\" "; + boolean canChangeEncType = editBean.canChangeEncType(curTunnel); + String ehdisabled = canChangeEncType ? "" : tstopFirst; + String edisabled = canChangeEncType ? "" : " disabled=\"disabled\" "; %>
+ > <%=intl._t("Encryption types")%>
- + > - + > - + > diff --git a/apps/i2ptunnel/jsp/editServer.jsi b/apps/i2ptunnel/jsp/editServer.jsi index d744fb10ee..6e203066c6 100644 --- a/apps/i2ptunnel/jsp/editServer.jsi +++ b/apps/i2ptunnel/jsp/editServer.jsi @@ -406,6 +406,11 @@ } // isAdvanced() End outbound config section %> <% + boolean canChangeEncType = editBean.canChangeEncType(curTunnel); + String stopFirst = intl._t("Tunnel must be stopped to change this configuration"); + String tstopFirst = " title=\"" + stopFirst + "\" "; + String ehdisabled = canChangeEncType ? "" : tstopFirst; + // TODO, encrypted + offline is unimplemented if (!editBean.getIsOfflineKeys(curTunnel)) { %> @@ -423,10 +428,9 @@ <% String curEncryptMode = editBean.getEncryptMode(curTunnel); - boolean canChangeEncType = editBean.canChangeEncType(curTunnel); String cdisabled = canChangeEncType ? "" : " disabled=\"disabled\" "; %> - > <% @@ -495,8 +499,10 @@ <% if (allowBlinding /* && editBean.isAdvanced() */) { + String pwTitle = "title=\"" + intl._t("Set password required to access this service") + + (canChangeEncType ? "" : (" - " + stopFirst)) + '"'; %> - " value="<%=editBean.getBlindedPassword(curTunnel)%>" class="freetext password" <%=bdisabled%>/> + value="<%=editBean.getBlindedPassword(curTunnel)%>" class="freetext password" <%=bdisabled%>/> <% } // allowBlinding %> @@ -614,15 +620,19 @@ <% **********************/ int currentSigType = editBean.getSigType(curTunnel, tunnelType); - String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" "; + String tooLate = intl._t("Configuration cannot be changed after destination is created"); + String tTooLate = " title=\"" + tooLate + "\" "; + boolean canChangeSigType = editBean.canChangeSigType(curTunnel); + String shdisabled = canChangeSigType ? "" : tTooLate; + String disabled = canChangeSigType ? "" : " disabled=\"disabled\" "; %>
+ > <%=intl._t("Signature type")%>
- > <% if (editBean.isSigTypeAvailable(1)) { %> @@ -652,23 +662,23 @@ <% boolean has0 = editBean.hasEncType(curTunnel, 0); boolean has4 = editBean.hasEncType(curTunnel, 4); - String edisabled = editBean.canChangeEncType(curTunnel) ? "" : " disabled=\"disabled\" "; + String edisabled = canChangeEncType ? "" : " disabled=\"disabled\" "; %>
+ > <%=intl._t("Encryption types")%>
- + > - + > - + >