Lior Vernia has uploaded a new change for review. Change subject: webadmin: Hide profiles tab if network is non-VM ......................................................................
webadmin: Hide profiles tab if network is non-VM A non-VM network cannot have profiles associated with it, so the profiles tab of the add/edit network dialog is now hidden whenever the VM network checkbox isn't marked. If the network is non-VM, then whatever's in the (hidden) profiles tab is ignored. Change-Id: I0cb1d77310a88c58d89b997e6fb7a974d06b009e Bug-Url: https://bugzilla.redhat.com/1007286 Signed-off-by: Lior Vernia <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkModel.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/AbstractNetworkPopupPresenterWidget.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/AbstractNetworkPopupView.java 3 files changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/00/19900/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkModel.java index 54932e8..7a88cb5 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkModel.java @@ -438,9 +438,13 @@ protected abstract void executeSave(); protected void postSaveAction(Guid networkGuid, boolean succeeded) { - if (succeeded) - { - performProfilesActions(networkGuid); + if (succeeded) { + if ((Boolean) getIsVmNetwork().getEntity()) { + performProfilesActions(networkGuid); + } else { + stopProgress(); + cancel(); + } } stopProgress(); } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/AbstractNetworkPopupPresenterWidget.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/AbstractNetworkPopupPresenterWidget.java index 2cd7db2..5d92652 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/AbstractNetworkPopupPresenterWidget.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/AbstractNetworkPopupPresenterWidget.java @@ -18,6 +18,7 @@ void updateVisibility(); + void toggleProfilesVisibility(boolean visible); } public AbstractNetworkPopupPresenterWidget(EventBus eventBus, V view) { @@ -41,6 +42,15 @@ } } }); + + getView().toggleProfilesVisibility((Boolean) model.getIsVmNetwork().getEntity()); + model.getIsVmNetwork().getEntityChangedEvent().addListener(new IEventListener() { + + @Override + public void eventRaised(Event ev, Object sender, EventArgs args) { + getView().toggleProfilesVisibility((Boolean) model.getIsVmNetwork().getEntity()); + } + }); } @Override diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/AbstractNetworkPopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/AbstractNetworkPopupView.java index 02e9e15..6bf1615 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/AbstractNetworkPopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/AbstractNetworkPopupView.java @@ -368,6 +368,11 @@ messageLabel.setVisible(false); } + @Override + public void toggleProfilesVisibility(boolean visible) { + profilesTab.setVisible(visible); + } + interface WidgetStyle extends CssResource { String mtuEditor(); -- To view, visit http://gerrit.ovirt.org/19900 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cb1d77310a88c58d89b997e6fb7a974d06b009e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Lior Vernia <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
