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

Commit

Permalink
Merge branch '1.4' of github.com:zanata/zanata into 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Sep 25, 2011
2 parents 94383c8 + d2768c7 commit fa22e70
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/zanata-war/eclipse/launch/debug-jboss-flies.launch
Expand Up @@ -9,7 +9,7 @@
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ALLOW_TERMINATE" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ALLOW_TERMINATE" value="false"/>
<mapAttribute key="org.eclipse.jdt.launching.CONNECT_MAP">
<mapEntry key="hostname" value="localhost"/>
<mapEntry key="port" value="8787"/>
Expand Down
Expand Up @@ -33,6 +33,8 @@
public class Application implements EntryPoint
{

private static boolean IS_DEBUG = false;

private static String zanataUrl = null;
private static WorkspaceId workspaceId;
private static WorkspaceContext workspaceContext;
Expand Down Expand Up @@ -231,7 +233,7 @@ private static void showErrorWithLink(String message, Throwable e, String linkTe
layoutPanel.add(a);
}

if (e != null)
if (IS_DEBUG && e != null)
{
String stackTrace = "Stack trace for the error:<br/>\n";
for (StackTraceElement ste : e.getStackTrace())
Expand Down
Expand Up @@ -489,8 +489,12 @@ else if (cellValue.getStatus() == ContentState.New)
*/
protected void acceptFuzzyEdit()
{
cellValue.setStatus(ContentState.NeedReview);
cellValue.setTarget(textArea.getText());
String text = textArea.getText();
cellValue.setTarget(text);
if (text == null || text.isEmpty())
cellValue.setStatus(ContentState.New);
else
cellValue.setStatus(ContentState.NeedReview);
curCallback.onComplete(curCellEditInfo, cellValue);
}

Expand Down
Expand Up @@ -188,7 +188,7 @@ else if (action.getContentState() != ContentState.New && StringUtils.isEmpty(act
TransUnit tu = new TransUnit(action.getTransUnitId(), hTextFlow.getResId(),
locale, hTextFlow.getContent(),
CommentsUtil.toString(hTextFlow.getComment()),
action.getContent(), action.getContentState(),
action.getContent(), target.getState(),
authenticatedAccount.getPerson().getName(),
SIMPLE_FORMAT.format(new Date()));
// @formatter:on
Expand Down
Expand Up @@ -7,6 +7,8 @@
import org.zanata.webtrans.shared.rpc.AbstractWorkspaceAction;
import org.zanata.webtrans.shared.rpc.ActivateWorkspaceAction;
import org.zanata.webtrans.shared.rpc.ActivateWorkspaceResult;
import org.zanata.webtrans.shared.rpc.EditingTranslationAction;
import org.zanata.webtrans.shared.rpc.EditingTranslationResult;
import org.zanata.webtrans.shared.rpc.GetDocumentList;
import org.zanata.webtrans.shared.rpc.GetDocumentListResult;
import org.zanata.webtrans.shared.rpc.GetProjectStatusCount;
Expand All @@ -19,6 +21,8 @@
import org.zanata.webtrans.shared.rpc.GetTranslationMemoryResult;
import org.zanata.webtrans.shared.rpc.GetTranslatorList;
import org.zanata.webtrans.shared.rpc.GetTranslatorListResult;
import org.zanata.webtrans.shared.rpc.UpdateTransUnit;
import org.zanata.webtrans.shared.rpc.UpdateTransUnitResult;

import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.DeferredCommand;
Expand Down Expand Up @@ -90,6 +94,18 @@ else if (action instanceof GetTranslationMemory)
AsyncCallback<GetTranslationMemoryResult> _callback = (AsyncCallback<GetTranslationMemoryResult>) callback;
DeferredCommand.addCommand(new DummyGetTranslationMemoryCommand(_action, _callback));
}
else if (action instanceof UpdateTransUnit)
{
final UpdateTransUnit _action = (UpdateTransUnit) action;
AsyncCallback<UpdateTransUnitResult> _callback = (AsyncCallback<UpdateTransUnitResult>) callback;
DeferredCommand.addCommand(new DummyUpdateTransUnitCommand(_action, _callback));
}
else if (action instanceof EditingTranslationAction)
{
final EditingTranslationAction _action = (EditingTranslationAction) action;
AsyncCallback<EditingTranslationResult> _callback = (AsyncCallback<EditingTranslationResult>) callback;
DeferredCommand.addCommand(new DummyEditingTranslationCommand(_action, _callback));
}
else
{
Log.warn("DummyDispatchAsync: ignoring action of " + action.getClass());
Expand Down
@@ -0,0 +1,30 @@
/**
*
*/
package org.zanata.webtrans.client.rpc;

import org.zanata.webtrans.shared.rpc.EditingTranslationAction;
import org.zanata.webtrans.shared.rpc.EditingTranslationResult;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;

final class DummyEditingTranslationCommand implements Command
{
// private final EditingTranslationAction action;
private final AsyncCallback<EditingTranslationResult> callback;

DummyEditingTranslationCommand(EditingTranslationAction action, AsyncCallback<EditingTranslationResult> callback)
{
// this.action = action;
this.callback = callback;
}

@Override
public void execute()
{
EditingTranslationResult result = new EditingTranslationResult(true);
callback.onSuccess(result);
}

}
@@ -0,0 +1,34 @@
/**
*
*/
package org.zanata.webtrans.client.rpc;

import org.zanata.webtrans.shared.rpc.UpdateTransUnit;
import org.zanata.webtrans.shared.rpc.UpdateTransUnitResult;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;

final class DummyUpdateTransUnitCommand implements Command
{
private final UpdateTransUnit action;
private final AsyncCallback<UpdateTransUnitResult> callback;

DummyUpdateTransUnitCommand(UpdateTransUnit action, AsyncCallback<UpdateTransUnitResult> callback)
{
this.action = action;
this.callback = callback;
}

@Override
public void execute()
{

// TransUnitUpdated updated = new TransUnitUpdated(documentId, wordCount,
// previousStatus, tu);

UpdateTransUnitResult result = new UpdateTransUnitResult(true);
callback.onSuccess(result);
}

}

0 comments on commit fa22e70

Please sign in to comment.