mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
prevent Export with examples and untitled/unsaved sketches
This commit is contained in:
@@ -217,6 +217,10 @@ export.full_screen = Full Screen
|
||||
export.embed_java = Embed Java
|
||||
export.embed_java.for = Embed Java for
|
||||
export.code_signing = Code Signing
|
||||
export.messages.is_read_only = Sketch is Read-Only
|
||||
export.messages.is_read_only.description = Some files are marked "read-only", so you will\nneed to re-save the sketch in another location,\nand try again.
|
||||
export.messages.cannot_export = Cannot Export
|
||||
export.messages.cannot_export.description = You cannot export a sketch that has not been saved.
|
||||
|
||||
# Find (Frame)
|
||||
find = Find
|
||||
|
||||
@@ -1096,6 +1096,20 @@ public class JavaEditor extends Editor {
|
||||
* <A HREF="http://dev.processing.org/bugs/show_bug.cgi?id=157">Bug 157</A>
|
||||
*/
|
||||
protected boolean handleExportCheckModified() {
|
||||
if (sketch.isReadOnly()) {
|
||||
// if the files are read-only, need to first do a "save as".
|
||||
Base.showMessage(Language.text("export.messages.is_read_only"),
|
||||
Language.text("export.messages.is_read_only.description"));
|
||||
return false;
|
||||
}
|
||||
|
||||
// don't allow if untitled
|
||||
if (sketch.isUntitled()) {
|
||||
Base.showMessage(Language.text("export.messages.cannot_export"),
|
||||
Language.text("export.messages.cannot_export.description"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sketch.isModified()) {
|
||||
Object[] options = { Language.text("prompt.ok"), Language.text("prompt.cancel") };
|
||||
int result = JOptionPane.showOptionDialog(this,
|
||||
|
||||
3
todo.txt
3
todo.txt
@@ -5,8 +5,7 @@ X create sketchbook subfolders on startup
|
||||
X https://github.com/processing/processing/issues/3548
|
||||
X save export settings to preferences
|
||||
X disable Export button when no platforms selected
|
||||
_ export allowed with untitled sketches
|
||||
_ also with examples?
|
||||
X prevent Export with examples and untitled/unsaved sketches
|
||||
|
||||
|
||||
earlier/cleaning
|
||||
|
||||
Reference in New Issue
Block a user