Frank Kobzik has uploaded a new change for review. Change subject: frontend: Adjust console tooltips ......................................................................
frontend: Adjust console tooltips Console tooltips for clients are vague and difficult to reach (user needs to hover over the radio button). This patch moves the description from radio button tooltip to explicit InfoIcon widget. Change-Id: I2459521e7ba303918a0992ffd95398b0c42f03df Bug-Url: https://bugzilla.redhat.com/1065947 Signed-off-by: Frantisek Kobzik <fkob...@redhat.com> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.ui.xml A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.java A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.ui.xml 5 files changed, 156 insertions(+), 13 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/25265/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java index 59521ed..6d06f67 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java @@ -1469,18 +1469,37 @@ @DefaultStringValue("SPICE Options") String spiceOptions(); - @DefaultStringValue("If there is a SPICE plugin installed in your browser, it is used for invoking the console session. Otherwise SPICE configuration file is downloaded.") + @DefaultStringValue("VNC Options") + String vncOptions(); + + @DefaultStringValue("If there is a SPICE plugin installed in your browser, it is used for invoking the console " + + "session.Otherwise SPICE configuration file is downloaded which will automatically launch locally " + + "installed Remote Viewer (found under \"Console Client Resources\" page.).") String spiceInvokeAuto(); - @DefaultStringValue("Downloads a SPICE configuration file to be opened by a SPICE client installed on your system.") - String spiceInvokeNative(); + @DefaultStringValue("Downloads a console configuration file to be opened by Remote Viewer application installed on " + + "your system (found under \"Console Client Resources\" page.).") + String consoleInvokeNative(); @DefaultStringValue("Uses SPICE browser plugin for invoking console session. For this you must have SPICE console plugin installed in your browser.") String spiceInvokePlugin(); - @DefaultStringValue("Uses SPICE HTML5 client that runs inside your browser.") + @DefaultStringValue("Uses SPICE HTML5 client that runs inside your browser. This client is a Technology preview and it's possible some functions (e.g. keyboard layouts) will not work as expected.") String spiceInvokeHtml5(); + @DefaultStringValue("Uses noVnc client that runs inside your browser. ") + String invokeNoVnc(); + + @DefaultStringValue("Uses RDP browser plugin if supported. Otherwise switches to \"Native client\" invocation.") + String rdpInvokeAuto(); + + @DefaultStringValue("Downloads a console configuration file to be opened by Remote Desktop client application on " + + "your system.") + String rdpInvokeNative(); + + @DefaultStringValue("Uses browser plugin to invoke the RDP session (MS Internet Explorer only) .") + String rdpInvokePlugin(); + @DefaultStringValue("Console Invocation") String consoleInvocation(); diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.java index 13ae773..4f56803 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.java @@ -1,5 +1,6 @@ package org.ovirt.engine.ui.common.view.popup; +import com.google.gwt.safehtml.shared.SafeHtmlUtils; import org.ovirt.engine.ui.common.CommonApplicationConstants; import org.ovirt.engine.ui.common.CommonApplicationMessages; import org.ovirt.engine.ui.common.CommonApplicationResources; @@ -8,6 +9,7 @@ import org.ovirt.engine.ui.common.presenter.popup.ConsolePopupPresenterWidget; import org.ovirt.engine.ui.common.utils.DynamicMessages; import org.ovirt.engine.ui.common.widget.Align; +import org.ovirt.engine.ui.common.widget.WidgetWithInfo; import org.ovirt.engine.ui.common.widget.dialog.SimpleDialogPanel; import org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor; import org.ovirt.engine.ui.common.widget.uicommon.popup.console.EntityModelValueCheckBoxEditor; @@ -46,6 +48,7 @@ interface Style extends CssResource { String remapCADContentWidget(); String consoleResourcesLink(); + String labelStyle(); } @UiField @@ -138,6 +141,15 @@ @UiField FlowPanel spicePanel; + + @UiField(provided = true) + WidgetWithInfo spiceHeadline; + + @UiField(provided = true) + WidgetWithInfo vncHeadline; + + @UiField(provided = true) + WidgetWithInfo rdpHeadline; @UiField FlowPanel vncPanel; @@ -325,6 +337,19 @@ vncRadioButton = new EntityModelRadioButtonEditor("1"); //$NON-NLS-1$ vncRadioButton.setLabel(constants.vnc()); + Label spiceInvocationLabel = new Label(); + spiceInvocationLabel.setText(constants.consoleInvocation()); + Label vncInvocationLabel = new Label(); + vncInvocationLabel.setText(constants.consoleInvocation()); + Label rdpInvocationLabel = new Label(); + rdpInvocationLabel.setText(constants.consoleInvocation()); + spiceHeadline = new WidgetWithInfo(spiceInvocationLabel); + spiceHeadline.setExplanation(SafeHtmlUtils.fromTrustedString(createSpiceInvocationInfo())); + vncHeadline= new WidgetWithInfo(vncInvocationLabel); + vncHeadline.setExplanation(SafeHtmlUtils.fromTrustedString(createVncInvocationInfo())); + rdpHeadline= new WidgetWithInfo(rdpInvocationLabel); + rdpHeadline.setExplanation(SafeHtmlUtils.fromTrustedString(createRdpInvocationInfo())); + initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); ViewIdHandler.idHandler.generateAndSetIds(this); @@ -336,6 +361,47 @@ remapCtrlAltDeleteSpice.getContentWidgetContainer().addStyleName(style.remapCADContentWidget()); remapCtrlAltDeleteVnc.getContentWidgetContainer().addStyleName(style.remapCADContentWidget()); asWidget().addStatusWidget(clientConsoleResourcesUrl); + spiceInvocationLabel.addStyleName(style.labelStyle()); + vncInvocationLabel.addStyleName(style.labelStyle()); + rdpInvocationLabel.addStyleName(style.labelStyle()); + } + + private String createSpiceInvocationInfo() { + return new KeyValueHtmlRowMaker(constants.auto(), constants.spiceInvokeAuto()) + .append(constants.nativeClient(), constants.consoleInvokeNative()) + .append(constants.browserPlugin(), constants.spiceInvokePlugin()) + .append(constants.spiceHtml5(), constants.spiceInvokeHtml5()).toString(); + } + + private String createVncInvocationInfo() { + return new KeyValueHtmlRowMaker(constants.nativeClient(), constants.consoleInvokeNative()) + .append(constants.noVnc(), constants.invokeNoVnc()) + .toString(); + } + + private String createRdpInvocationInfo() { + return new KeyValueHtmlRowMaker(constants.auto(), constants.rdpInvokeAuto()) + .append(constants.nativeClient(), constants.rdpInvokeNative()) + .append(constants.browserPlugin(), constants.rdpInvokePlugin()) + .toString(); + } + + private class KeyValueHtmlRowMaker { + + private String html; + + private KeyValueHtmlRowMaker(String key, String val) { + html = "<b>" + key + "</b>: " + val;// $NON-NLS-1$// $NON-NLS-2$ + } + + public KeyValueHtmlRowMaker append(String key, String val) { + html += "<br/>" + new KeyValueHtmlRowMaker(key, val).toString();// $NON-NLS-1$ + return this; + } + + public String toString() { + return html; + } } @SuppressWarnings("unchecked") diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.ui.xml index 9e5dd57..541d3bf 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.ui.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/ConsolePopupView.ui.xml @@ -3,6 +3,7 @@ <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog" +xmlns:v="urn:import:org.ovirt.engine.ui.common.widget" xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" xmlns:w="urn:import:org.ovirt.engine.ui.common.widget.uicommon.popup.console"> @@ -58,11 +59,11 @@ </g:FlowPanel> <g:FlowPanel ui:field="spicePanel" addStyleNames="{style.protocolPanel}"> - <g:Label text="{constants.consoleInvocation}" addStyleNames="{style.labelStyle}" /> - <e:EntityModelRadioButtonEditor ui:field="spiceAutoImplRadioButton" title="{constants.spiceInvokeAuto}"/> - <e:EntityModelRadioButtonEditor ui:field="spiceNativeImplRadioButton" title="{constants.spiceInvokeNative}"/> - <e:EntityModelRadioButtonEditor ui:field="spicePluginImplRadioButton" title="{constants.spiceInvokePlugin}"/> - <e:EntityModelRadioButtonEditor ui:field="spiceHtml5ImplRadioButton" title="{constants.spiceInvokeHtml5}"/> + <v:WidgetWithInfo ui:field="spiceHeadline" /> + <e:EntityModelRadioButtonEditor ui:field="spiceAutoImplRadioButton"/> + <e:EntityModelRadioButtonEditor ui:field="spiceNativeImplRadioButton"/> + <e:EntityModelRadioButtonEditor ui:field="spicePluginImplRadioButton"/> + <e:EntityModelRadioButtonEditor ui:field="spiceHtml5ImplRadioButton"/> <g:Label ui:field="spiceTitle" text="{constants.spiceOptions}" addStyleNames="{style.labelStyle}" /> <w:EntityModelValueCheckBoxEditor ui:field="remapCtrlAltDeleteSpice" /> @@ -80,14 +81,15 @@ </g:FlowPanel> <g:FlowPanel ui:field="vncPanel" addStyleNames="{style.protocolPanel}"> - <g:Label text="{constants.consoleInvocation}" addStyleNames="{style.labelStyle}" /> - <e:EntityModelRadioButtonEditor ui:field="vncNativeImplRadioButton" title="{constants.nativeClient}"/> - <e:EntityModelRadioButtonEditor ui:field="noVncImplRadioButton" title="{constants.noVnc}"/> + <v:WidgetWithInfo ui:field="vncHeadline" /> + <e:EntityModelRadioButtonEditor ui:field="vncNativeImplRadioButton" /> + <e:EntityModelRadioButtonEditor ui:field="noVncImplRadioButton"/> + <g:Label ui:field="vncTitle" text="{constants.vncOptions}" addStyleNames="{style.labelStyle}" /> <w:EntityModelValueCheckBoxEditor ui:field="remapCtrlAltDeleteVnc" /> </g:FlowPanel> <g:FlowPanel ui:field="rdpPanel" addStyleNames="{style.protocolPanel}"> - <g:Label text="{constants.consoleInvocation}" addStyleNames="{style.labelStyle}" /> + <v:WidgetWithInfo ui:field="rdpHeadline" /> <e:EntityModelRadioButtonEditor ui:field="rdpAutoImplRadioButton" /> <e:EntityModelRadioButtonEditor ui:field="rdpNativeImplRadioButton" /> <e:EntityModelRadioButtonEditor ui:field="rdpPluginImplRadioButton" /> diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.java new file mode 100644 index 0000000..fb20e3b --- /dev/null +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.java @@ -0,0 +1,39 @@ +package org.ovirt.engine.ui.common.widget; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlUtils; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.Widget; +import com.google.inject.Inject; +import org.ovirt.engine.ui.common.CommonApplicationResources; +import org.ovirt.engine.ui.common.widget.dialog.InfoIcon; + +public class WidgetWithInfo extends Composite { + + interface WidgetUiBinder extends UiBinder<Widget, WidgetWithInfo> { + WidgetUiBinder uiBinder = GWT.create(WidgetUiBinder.class); + } + + private static CommonApplicationResources resources = GWT.create(CommonApplicationResources.class); + + @UiField(provided = true) + Widget contentWidget; + + @UiField(provided = true) + InfoIcon infoIcon; + + @Inject + public WidgetWithInfo(Widget contentWidget) { + this.contentWidget = contentWidget; + infoIcon = new InfoIcon(SafeHtmlUtils.EMPTY_SAFE_HTML, resources); + initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); + } + + public void setExplanation(SafeHtml text) { + infoIcon.setText(text); + } + +} diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.ui.xml new file mode 100644 index 0000000..030f40e --- /dev/null +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/WidgetWithInfo.ui.xml @@ -0,0 +1,17 @@ +<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> +<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" + xmlns:g="urn:import:com.google.gwt.user.client.ui" + xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog"> + + <ui:style> + .style { + float: left; + } + </ui:style> + + <g:FlowPanel> + <g:Widget ui:field="contentWidget" addStyleNames="{style.style}"/> + <d:InfoIcon ui:field="infoIcon" addStyleNames="{style.style}"/> + </g:FlowPanel> + +</ui:UiBinder> \ No newline at end of file -- To view, visit http://gerrit.ovirt.org/25265 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2459521e7ba303918a0992ffd95398b0c42f03df Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Frank Kobzik <fkob...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches