Lior Vernia has posted comments on this change.
Change subject: webadmin: Hide profiles tab if network is non-VM
......................................................................
Patch Set 1:
(3 comments)
....................................................
File
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkModel.java
Line 441: if (succeeded) {
Line 442: if ((Boolean) getIsVmNetwork().getEntity()) {
Line 443: performProfilesActions(networkGuid);
Line 444: } else {
Line 445: stopProgress();
Right, moved it into the inner if clause.
Line 446: cancel();
Line 447: }
Line 448: }
Line 449: stopProgress();
....................................................
File
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/AbstractNetworkPopupPresenterWidget.java
Line 42: }
Line 43: }
Line 44: });
Line 45:
Line 46: getView().toggleProfilesVisibility((Boolean)
model.getIsVmNetwork().getEntity());
Not sure I understand what you mean by "duplicate", let's see if we're on the
same page.
The model's isVmNetwork member should always be set to either true or false by
the time the model is constructed (according to the dialog's defaults, whether
it's add or edit etc.). So when initially editing the view, I already want to
show/hide the tab according to the initial value.
(Setting to null to avoid the initial call would mean moving code that is
currently triggered by the constructor to be triggered by another call after
the view is already edited.)
However, the checkbox affecting the entity may also be checked/unchecked by the
user, in which case I want to also adjust the visibility according to the event.
So in that sense, if I understood you correctly, by design I want to allow
duplicate calls. Or did I misunderstand your comment?
Line 47: model.getIsVmNetwork().getEntityChangedEvent().addListener(new
IEventListener() {
Line 48:
Line 49: @Override
Line 50: public void eventRaised(Event ev, Object sender, EventArgs
args) {
Line 44: });
Line 45:
Line 46: getView().toggleProfilesVisibility((Boolean)
model.getIsVmNetwork().getEntity());
Line 47: model.getIsVmNetwork().getEntityChangedEvent().addListener(new
IEventListener() {
Line 48:
Done
Line 49: @Override
Line 50: public void eventRaised(Event ev, Object sender, EventArgs
args) {
Line 51: getView().toggleProfilesVisibility((Boolean)
model.getIsVmNetwork().getEntity());
Line 52: }
--
To view, visit http://gerrit.ovirt.org/19900
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0cb1d77310a88c58d89b997e6fb7a974d06b009e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches