Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Work in progress: fixing on bug: https://bugzilla.redhat.com/show_bug…

  • Loading branch information...
commit ea2e877027be94dc80ed16b6a87d1da1d080f2b4 1 parent c5e540b
@aeng aeng authored
View
19 zanata-war/src/main/java/org/zanata/webtrans/client/editor/table/TableEditorPresenter.java
@@ -146,6 +146,8 @@
void setTransUnitDetails(TransUnit selectedTransUnit);
boolean isProcessing();
+
+ void ignoreStopProcessing();
}
private DocumentId documentId;
@@ -317,7 +319,6 @@ public void onFindMessage(FindMessageEvent event)
Log.info("cancelling selection");
display.getTargetCellEditor().clearSelection();
}
- display.startProcessing();
findMessage = event.getMessage();
display.setFindMessage(findMessage);
if (selectedTransUnit != null)
@@ -563,19 +564,25 @@ public void requestRows(final Request request, final Callback<TransUnit> callbac
{
int numRows = request.getNumRows();
int startRow = request.getStartRow();
- Log.info("Table requesting " + numRows + " starting from " + startRow);
if (documentId == null)
{
callback.onFailure(new RuntimeException("No DocumentId"));
return;
}
+ Log.info("Table requesting " + numRows + " starting from " + startRow);
- display.startProcessing();
+ if (display.isProcessing())
+ {
+ display.ignoreStopProcessing();
+ }
+ else
+ {
+ display.startProcessing();
+ }
dispatcher.execute(new GetTransUnitList(documentId, startRow, numRows, findMessage, filterViewConfirmationPanel.isFilterTranslated(), filterViewConfirmationPanel.isFilterNeedReview(), filterViewConfirmationPanel.isFilterUntranslated(), targetTransUnitId), new AsyncCallback<GetTransUnitListResult>()
{
-
@Override
public void onSuccess(GetTransUnitListResult result)
{
@@ -585,7 +592,6 @@ public void onSuccess(GetTransUnitListResult result)
Log.info("Got " + result.getUnits().size() + " rows back of " + result.getTotalCount() + " available");
callback.onRowsReady(request, response);
display.getTableModel().setRowCount(result.getTotalCount());
- display.stopProcessing();
int gotoRow = curRowIndex;
@@ -597,6 +603,7 @@ public void onSuccess(GetTransUnitListResult result)
}
tableModelHandler.gotoRow(gotoRow, false);
}
+ display.stopProcessing();
}
@Override
@@ -1119,7 +1126,7 @@ private void loadDocument(DocumentId selectDocId)
{
if (!selectDocId.equals(documentId))
{
- display.startProcessing();
+ // display.startProcessing();
documentId = selectDocId;
initialiseTransUnitList();
}
View
21 zanata-war/src/main/java/org/zanata/webtrans/client/editor/table/TableEditorView.java
@@ -33,6 +33,7 @@
import org.zanata.webtrans.shared.model.TransUnit;
import org.zanata.webtrans.shared.model.WorkspaceContext;
+import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.logical.shared.HasSelectionHandlers;
import com.google.gwt.event.logical.shared.SelectionEvent;
@@ -69,6 +70,7 @@ public TableEditorView(NavigationMessages messages, EventBus eventBus, Workspace
{
this(messages, new RedirectingTableModel<TransUnit>(), eventBus, workspaceContext, sourceContentsPresenter, targetContentsPresenter);
loadingPanel = new LoadingPanel(resources);
+ loadingPanel.hide();
}
private TableEditorView(NavigationMessages messages, RedirectingTableModel<TransUnit> tableModel, EventBus eventBus, WorkspaceContext workspaceContext, final SourceContentsPresenter sourceContentsPresenter, TargetContentsPresenter targetContentsPresenter)
@@ -140,6 +142,14 @@ public Widget asWidget()
return this;
}
+ private int ignoreStopProcessingCount = 0;
+
+ @Override
+ public void ignoreStopProcessing()
+ {
+ ignoreStopProcessingCount++;
+ }
+
@Override
public void startProcessing()
{
@@ -150,8 +160,15 @@ public void startProcessing()
@Override
public void stopProcessing()
{
- setVisible(true);
- loadingPanel.hide();
+ if (ignoreStopProcessingCount == 0)
+ {
+ setVisible(true);
+ loadingPanel.hide();
+ }
+ else
+ {
+ ignoreStopProcessingCount--;
+ }
}
@Override
Please sign in to comment.
Something went wrong with that request. Please try again.