Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
9048ac1d
Commit
9048ac1d
authored
Apr 13, 2020
by
Evan W. Patton
Committed by
Jeffrey Schiller
Apr 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix delete assets not working in nb183a
Change-Id: I7aef0856d098b490d36d36d410dc9763ccb5a034
parent
923cc0d0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
188 additions
and
245 deletions
+188
-245
appinventor/appengine/src/com/google/appinventor/client/OdeMessages.java
...engine/src/com/google/appinventor/client/OdeMessages.java
+3
-3
appinventor/appengine/src/com/google/appinventor/client/explorer/commands/DeleteFileCommand.java
...pinventor/client/explorer/commands/DeleteFileCommand.java
+150
-191
appinventor/appengine/src/com/google/appinventor/client/explorer/commands/SaveScreenCheckpointCommand.java
...client/explorer/commands/SaveScreenCheckpointCommand.java
+26
-48
appinventor/appengine/src/com/google/appinventor/client/widgets/LabeledTextBox.java
...com/google/appinventor/client/widgets/LabeledTextBox.java
+3
-3
appinventor/appengine/war/static/css/Ya.css
appinventor/appengine/war/static/css/Ya.css
+6
-0
No files found.
appinventor/appengine/src/com/google/appinventor/client/OdeMessages.java
View file @
9048ac1d
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-20
19
MIT, All rights reserved
// Copyright 2011-20
20
MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
...
...
@@ -117,7 +117,7 @@ public interface OdeMessages extends Messages, AutogeneratedOdeMessages {
@DefaultMessage
(
"Checkpoint ..."
)
@Description
(
"Label of the button for checkpoint"
)
String
checkpointButton
();
@DefaultMessage
(
"Create checkpoint before deleting"
)
@Description
(
"Label of the CheckBox for checkpoint"
)
String
checkBoxButton
();
...
...
@@ -143,7 +143,7 @@ public interface OdeMessages extends Messages, AutogeneratedOdeMessages {
"There is no undo.\nAre you sure you want to delete {0}?"
)
@Description
(
"Confirmation query for removing a screen"
)
String
reallyDeleteForm
(
String
formName
);
@DefaultMessage
(
"Warning: You are deleting a screen.\nThis operation cannot be undone.\n"
+
"Please type the name of the screen {0} into the box below to confirm you really want to do this."
)
@Description
(
"Confirmation query for removing a screen"
)
...
...
appinventor/appengine/src/com/google/appinventor/client/explorer/commands/DeleteFileCommand.java
View file @
9048ac1d
This diff is collapsed.
Click to expand it.
appinventor/appengine/src/com/google/appinventor/client/explorer/commands/SaveScreenCheckpointCommand.java
View file @
9048ac1d
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Copyright 2020 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package
com.google.appinventor.client.explorer.commands
;
import
com.google.appinventor.client.Ode
;
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.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.ProjectRootNode
;
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
;
/**
...
...
@@ -46,34 +21,35 @@ import java.util.List;
* @author lizlooney@google.com (Liz Looney)
*/
public
final
class
SaveScreenCheckpointCommand
extends
ChainableCommand
{
private
boolean
checkpoint
;
private
final
boolean
checkpoint
;
/**
* Creates a new command for copying a project.
*
* @param checkpoint whether the copy is a checkpoint
*/
public
SaveScreenCheckpointCommand
(
boolean
checkpoint
)
{
public
SaveScreenCheckpointCommand
(
boolean
checkpoint
,
ChainableCommand
next
)
{
super
(
next
);
this
.
checkpoint
=
checkpoint
;
}
@Override
public
boolean
willCallExecuteNextCommand
()
{
return
false
;
// Is there a way to do this for this command?
return
true
;
}
@Override
public
void
execute
(
final
ProjectNode
node
)
{
handleOkClick
(
node
.
getProjectRoot
());
handleOkClick
(
node
.
getProjectRoot
());
}
private
void
handleOkClick
(
ProjectRootNode
oldProjectNode
)
{
String
oldName
=
oldProjectNode
.
getName
()
+
"_Screen"
;
String
oldName
=
oldProjectNode
.
getName
()
+
"_Screen"
;
String
defaultNewName
;
if
(
checkpoint
)
{
String
prefix
=
MESSAGES
.
defaultCheckpointProjectName
(
oldName
,
""
);
List
<
Project
>
checkpointProjects
=
Ode
.
getInstance
().
getProjectManager
().
getProjects
(
prefix
);
Ode
.
getInstance
().
getProjectManager
().
getProjects
(
prefix
);
String
nextSuffix
;
if
(
checkpointProjects
.
isEmpty
())
{
...
...
@@ -81,37 +57,39 @@ public final class SaveScreenCheckpointCommand extends ChainableCommand {
}
else
{
// Find the highest number in the checkpoint projects' names.
int
highestNumber
=
0
;
int
prefixLength
=
prefix
.
length
();
for
(
Project
checkpointProject
:
checkpointProjects
)
{
int
prefixLength
=
prefix
.
length
();
for
(
Project
checkpointProject
:
checkpointProjects
)
{
String
checkpointName
=
checkpointProject
.
getProjectName
();
try
{
highestNumber
=
Math
.
max
(
highestNumber
,
Integer
.
parseInt
(
checkpointName
.
substring
(
prefixLength
)));
Integer
.
parseInt
(
checkpointName
.
substring
(
prefixLength
)));
}
catch
(
NumberFormatException
e
)
{
continue
;
}
}
nextSuffix
=
Integer
.
toString
(
highestNumber
+
1
);
}
nextSuffix
=
Integer
.
toString
(
highestNumber
+
1
);
}
defaultNewName
=
MESSAGES
.
defaultCheckpointProjectName
(
oldName
,
nextSuffix
);
}
else
{
// Save As
// Save As
defaultNewName
=
MESSAGES
.
defaultSaveAsProjectName
(
oldName
);
}
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
();
OdeAsyncCallback
<
UserProject
>
callback
=
new
OdeAsyncCallback
<
UserProject
>(
// failure message
MESSAGES
.
copyProjectError
())
{
// failure message
MESSAGES
.
copyProjectError
())
{
@Override
public
void
onSuccess
(
UserProject
newProjectInfo
)
{
// Update project list
// Update project list
Project
newProject
=
ode
.
getProjectManager
().
addProject
(
newProjectInfo
);
if
(!
checkpoint
)
{
ode
.
openYoungAndroidProjectInDesigner
(
newProject
);
}
}
executeNextCommand
(
oldProjectNode
);
}
};
// Create new copy on the backend
...
...
appinventor/appengine/src/com/google/appinventor/client/widgets/LabeledTextBox.java
View file @
9048ac1d
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-20
18
MIT, All rights reserved
// Copyright 2011-20
20
MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
...
...
@@ -155,9 +155,9 @@ public class LabeledTextBox extends Composite {
public
void
setErrorMessage
(
String
errorMessage
)
{
this
.
errorMessage
=
errorMessage
;
}
public
void
setColor
(
String
color
)
{
textbox
.
getElement
().
getStyle
().
setBorderColor
(
color
);
textbox
.
getElement
().
getStyle
().
setBorderColor
(
color
);
}
/**
...
...
appinventor/appengine/war/static/css/Ya.css
View file @
9048ac1d
...
...
@@ -748,6 +748,12 @@ body {
text-shadow
:
none
;
}
.destructive-action
[
disabled
],
.destructive-action
[
disabled
]
:hover
{
background
:
#faa
;
color
:
#888
;
}
.ya-Toolbar
.ode-TextButton
{
font-size
:
11px
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment