Alexander Wels has uploaded a new change for review. Change subject: userportal,webadmin: synchronize grid refresh ......................................................................
userportal,webadmin: synchronize grid refresh - Updated code to have refresh rates across tabs and sub tabs be identical. So if you switch the refresh rate on lets say the VM tab, the same refresh rate is used for all other tabs. As well as affecting the refresh rate of the events/alerts and tasks list. caveat: If you switch the refresh to 60 seconds and the events/alerts/tasks refresh, then you switch it to 5 seconds. It will take 60 seconds for the events/alerts and tasks to have the 5 second refresh rate as the refresh is updated only when the timer fires. Change-Id: I8742785cb9b3d890c39859586b03cd53c64b31e5 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=879662 Signed-off-by: Alexander Wels <aw...@redhat.com> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/refresh/AbstractRefreshManager.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/GridTimer.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SearchableListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/events/EventListModel.java 4 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/23605/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/refresh/AbstractRefreshManager.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/refresh/AbstractRefreshManager.java index ed37e50..e7232d8 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/refresh/AbstractRefreshManager.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/refresh/AbstractRefreshManager.java @@ -165,7 +165,7 @@ } String getRefreshRateItemKey() { - return GRID_REFRESH_RATE_PREFIX + "_" + controller.getId(); //$NON-NLS-1$ + return GRID_REFRESH_RATE_PREFIX; //$NON-NLS-1$ } void saveRefreshRate(int newRefreshRate) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/GridTimer.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/GridTimer.java index 8e66fa5..c5587d1 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/GridTimer.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/GridTimer.java @@ -109,7 +109,7 @@ private static final Logger logger = Logger.getLogger(GridTimer.class.getName()); - private int currentRate = 0; + private static int currentRate = 0; private final SimpleEventBus eventBus; @@ -119,7 +119,7 @@ private boolean paused; - private int normalInterval = DEFAULT_NORMAL_RATE; + private static int normalInterval = DEFAULT_NORMAL_RATE; private final RATE[] rateCycle = { RATE.NORMAL, RATE.FAST, RATE.MEDIUM, RATE.SLOW }; diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SearchableListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SearchableListModel.java index 59fd989..2f29a5a 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SearchableListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SearchableListModel.java @@ -319,10 +319,12 @@ public void execute() { logger.fine(SearchableListModel.this.getClass().getName() + ": Executing search"); //$NON-NLS-1$ syncSearch(); + gettimer().stop(); + gettimer().setRefreshRate(gettimer().getRefreshRate()); + gettimer().start(); } }); - gettimer().setRefreshRate(getConfigurator().getPollingTimerInterval()); } return gettimer(); } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/events/EventListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/events/EventListModel.java index 96bee5c..6fa6a8c 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/events/EventListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/events/EventListModel.java @@ -112,6 +112,10 @@ @Override public void execute() { getRefreshCommand().execute(); + //Stop the timer so the setRefreshRate can update the interval. It will also start the timer. + timer.stop(); + timer.setRefreshRate(timer.getRefreshRate()); + timer.start(); } }; -- To view, visit http://gerrit.ovirt.org/23605 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8742785cb9b3d890c39859586b03cd53c64b31e5 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alexander Wels <aw...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches