Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
1)click Save or move to next row will save as Approved 2)tick/untick …
Browse files Browse the repository at this point in the history
…will saved as Approved/Fuzzy, refuse to stay ticked when tick Approved on an empty cell
  • Loading branch information
jamesni committed Aug 2, 2011
1 parent ca0f367 commit 6eefb1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Expand Up @@ -97,6 +97,7 @@ public void onClick(ClickEvent event)
{
public void onClick(ClickEvent event)
{
cellValue.setStatus(ContentState.Approved);
acceptEdit();
// gotoNextRow(curRow);
}
Expand Down Expand Up @@ -391,6 +392,7 @@ public void editCell(CellEditInfo cellEditInfo, TransUnit cellValue, Callback<Tr
// save the content in previous cell before start new editing
if (this.cellValue != null && curRow != cellEditInfo.getRowIndex())
{
this.cellValue.setStatus(ContentState.Approved);
Log.debug("save content of previous cell");
acceptEdit();
}
Expand Down
Expand Up @@ -461,8 +461,13 @@ public void onToggleApproved(ToggleApprovedEvent event)
int row = display.getCurrentPage() * display.getPageSize() + rowOffset;
Log.info("toggle Approved for " + row);
TransUnit rowValue = event.getTransUnit();
display.getTableModel().setRowValueOverride(row, rowValue);
if (rowValue.getStatus() == ContentState.Approved)
{
if (rowValue.getTarget().isEmpty())
rowValue.setStatus(ContentState.New);
}

display.getTableModel().setRowValueOverride(row, rowValue);
// save the Approved state when target cell editor is not opened
// and target is not empty
if (!rowValue.getTarget().isEmpty())
Expand All @@ -473,8 +478,7 @@ public void onToggleApproved(ToggleApprovedEvent event)
}
else
{
if (rowValue.getStatus() == ContentState.NeedReview)
display.getTargetCellEditor().acceptEdit();
display.getTargetCellEditor().acceptEdit();
}
}
}
Expand Down

0 comments on commit 6eefb1a

Please sign in to comment.