Commit 9048ac1d authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Fix delete assets not working in nb183a

Change-Id: I7aef0856d098b490d36d36d410dc9763ccb5a034
parent 923cc0d0
// -*- mode: java; c-basic-offset: 2; -*- // -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved // Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2019 MIT, All rights reserved // Copyright 2011-2020 MIT, All rights reserved
// Released under the Apache License, Version 2.0 // Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
......
// -*- mode: java; c-basic-offset: 2; -*- // -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved // Copyright 2020 MIT, All rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Released under the Apache License, Version 2.0 // Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
package com.google.appinventor.client.explorer.commands; package com.google.appinventor.client.explorer.commands;
import com.google.appinventor.client.Ode;
import static com.google.appinventor.client.Ode.MESSAGES; import static com.google.appinventor.client.Ode.MESSAGES;
import com.google.appinventor.client.Ode;
import com.google.appinventor.client.OdeAsyncCallback; import com.google.appinventor.client.OdeAsyncCallback;
import com.google.appinventor.client.explorer.project.Project; import com.google.appinventor.client.explorer.project.Project;
import com.google.appinventor.client.explorer.project.ProjectComparators;
import com.google.appinventor.shared.rpc.project.youngandroid.YoungAndroidFormNode;
import com.google.appinventor.shared.rpc.project.youngandroid.YoungAndroidSourceNode;
import com.google.appinventor.client.widgets.LabeledTextBox;
import com.google.appinventor.client.youngandroid.TextValidators;
import com.google.appinventor.shared.rpc.project.ProjectNode; import com.google.appinventor.shared.rpc.project.ProjectNode;
import com.google.appinventor.shared.rpc.project.ProjectRootNode; import com.google.appinventor.shared.rpc.project.ProjectRootNode;
import com.google.appinventor.shared.rpc.project.UserProject; import com.google.appinventor.shared.rpc.project.UserProject;
import com.google.appinventor.client.widgets.Validator;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -46,20 +21,21 @@ import java.util.List; ...@@ -46,20 +21,21 @@ import java.util.List;
* @author lizlooney@google.com (Liz Looney) * @author lizlooney@google.com (Liz Looney)
*/ */
public final class SaveScreenCheckpointCommand extends ChainableCommand { public final class SaveScreenCheckpointCommand extends ChainableCommand {
private boolean checkpoint; private final boolean checkpoint;
/** /**
* Creates a new command for copying a project. * Creates a new command for copying a project.
* *
* @param checkpoint whether the copy is a checkpoint * @param checkpoint whether the copy is a checkpoint
*/ */
public SaveScreenCheckpointCommand(boolean checkpoint) { public SaveScreenCheckpointCommand(boolean checkpoint, ChainableCommand next) {
super(next);
this.checkpoint = checkpoint; this.checkpoint = checkpoint;
} }
@Override @Override
public boolean willCallExecuteNextCommand() { public boolean willCallExecuteNextCommand() {
return false; // Is there a way to do this for this command? return true;
} }
@Override @Override
...@@ -68,7 +44,7 @@ public final class SaveScreenCheckpointCommand extends ChainableCommand { ...@@ -68,7 +44,7 @@ public final class SaveScreenCheckpointCommand extends ChainableCommand {
} }
private void handleOkClick(ProjectRootNode oldProjectNode) { private void handleOkClick(ProjectRootNode oldProjectNode) {
String oldName = oldProjectNode.getName()+"_Screen"; String oldName = oldProjectNode.getName() + "_Screen";
String defaultNewName; String defaultNewName;
if (checkpoint) { if (checkpoint) {
String prefix = MESSAGES.defaultCheckpointProjectName(oldName, ""); String prefix = MESSAGES.defaultCheckpointProjectName(oldName, "");
...@@ -100,7 +76,8 @@ public final class SaveScreenCheckpointCommand extends ChainableCommand { ...@@ -100,7 +76,8 @@ public final class SaveScreenCheckpointCommand extends ChainableCommand {
} }
copyProjectAction(oldProjectNode, defaultNewName); copyProjectAction(oldProjectNode, defaultNewName);
} }
protected void copyProjectAction(ProjectRootNode oldProjectNode, String newName) {
protected void copyProjectAction(final ProjectRootNode oldProjectNode, String newName) {
final Ode ode = Ode.getInstance(); final Ode ode = Ode.getInstance();
OdeAsyncCallback<UserProject> callback = new OdeAsyncCallback<UserProject>( OdeAsyncCallback<UserProject> callback = new OdeAsyncCallback<UserProject>(
// failure message // failure message
...@@ -112,6 +89,7 @@ public final class SaveScreenCheckpointCommand extends ChainableCommand { ...@@ -112,6 +89,7 @@ public final class SaveScreenCheckpointCommand extends ChainableCommand {
if (!checkpoint) { if (!checkpoint) {
ode.openYoungAndroidProjectInDesigner(newProject); ode.openYoungAndroidProjectInDesigner(newProject);
} }
executeNextCommand(oldProjectNode);
} }
}; };
// Create new copy on the backend // Create new copy on the backend
......
// -*- mode: java; c-basic-offset: 2; -*- // -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved // Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2018 MIT, All rights reserved // Copyright 2011-2020 MIT, All rights reserved
// Released under the Apache License, Version 2.0 // Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
......
...@@ -748,6 +748,12 @@ body { ...@@ -748,6 +748,12 @@ body {
text-shadow: none; text-shadow: none;
} }
.destructive-action[disabled],
.destructive-action[disabled]:hover {
background: #faa;
color: #888;
}
.ya-Toolbar .ode-TextButton { .ya-Toolbar .ode-TextButton {
font-size: 11px; font-size: 11px;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment