Skip to content

Commit 8075e6f

Browse files
committed
fix the messages during Export to Application
1 parent 3185eba commit 8075e6f

File tree

3 files changed

+26
-37
lines changed

3 files changed

+26
-37
lines changed

app/src/processing/app/ui/ExportPrompt.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@
2323

2424
package processing.app.ui;
2525

26-
import processing.app.Language;
27-
import processing.app.Platform;
28-
import processing.app.Preferences;
29-
import processing.app.SketchException;
30-
import processing.app.platform.MacPlatform;
31-
import processing.core.PApplet;
32-
import processing.data.StringDict;
33-
import processing.data.StringList;
34-
3526
import javax.swing.*;
3627
import javax.swing.border.EmptyBorder;
3728
import javax.swing.border.TitledBorder;
@@ -43,6 +34,15 @@
4334
import java.util.ArrayList;
4435
import java.util.List;
4536

37+
import processing.app.Language;
38+
import processing.app.Platform;
39+
import processing.app.Preferences;
40+
import processing.app.platform.MacPlatform;
41+
42+
import processing.core.PApplet;
43+
import processing.data.StringDict;
44+
import processing.data.StringList;
45+
4646

4747
public class ExportPrompt {
4848
static final String MACOS_EXPORT_WIKI =
@@ -111,7 +111,7 @@ protected boolean anyExportButton() {
111111
}
112112

113113

114-
public boolean trigger() throws SketchException {
114+
public void trigger() {
115115
final JDialog dialog = new JDialog(editor, Language.text("export"), true);
116116

117117
JPanel panel = new JPanel();
@@ -347,7 +347,7 @@ public void mousePressed(MouseEvent event) {
347347
// closed window by hitting Cancel or ESC
348348
editor.statusNotice(Language.text("export.notice.exporting.cancel"));
349349
}
350-
return false;
350+
// return false;
351351
}
352352

353353

java/src/processing/mode/java/JavaEditor.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -469,34 +469,23 @@ public String getCommentPrefix() {
469469

470470

471471
/**
472-
* Handler for Sketch → Export Application
472+
* Handler for Sketch Export Application
473473
*/
474474
public void handleExportApplication() {
475475
if (handleExportCheckModified()) {
476476
statusNotice(Language.text("export.notice.exporting"));
477-
try {
478-
ExportPrompt ep = new ExportPrompt(this, () -> {
479-
try {
480-
jmode.handleExportApplication(getSketch());
481-
} catch (Exception e) {
482-
statusNotice(Language.text("export.notice.exporting.error"));
483-
e.printStackTrace();
477+
ExportPrompt ep = new ExportPrompt(this, () -> {
478+
try {
479+
if (jmode.handleExportApplication(getSketch())) {
480+
Platform.openFolder(sketch.getFolder());
481+
statusNotice(Language.text("export.notice.exporting.done"));
484482
}
485-
});
486-
if (ep.trigger()) {
487-
Platform.openFolder(sketch.getFolder());
488-
statusNotice(Language.text("export.notice.exporting.done"));
489-
//} else {
490-
// error message will already be visible
491-
// or there was no error, in which case it was canceled.
483+
} catch (Exception e) {
484+
statusNotice(Language.text("export.notice.exporting.error"));
485+
e.printStackTrace();
492486
}
493-
} catch (SketchException se) {
494-
EventQueue.invokeLater(() -> statusError(se));
495-
496-
} catch (Exception e) {
497-
statusNotice(Language.text("export.notice.exporting.error"));
498-
e.printStackTrace();
499-
}
487+
});
488+
ep.trigger();
500489
}
501490
}
502491

todo.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ X move ExportDialog to processing.app.ui (out of Java Mode) so it can be used by
2424
X move isXcodeInstalled() methods from JavaBuild into MacPlatform
2525
X add activateIgnoringOtherApps() to ThinkDifferent
2626

27+
export
2728
X Exported project to Windows cannot find Java
2829
X https://github.com/processing/processing4/issues/667
29-
30-
_ when not exporting Java as well, the "exporting application" message doesn't seem to clear
31-
32-
_ after exporting application, open the sketch folder
30+
X when exporting, the "exporting application" message doesn't seem to clear
31+
X was a regression caused by ExportPrompt changes
32+
X after exporting application, open the sketch folder
3333

3434
_ exporting application while still running on Windows
3535
_ just says "Error during export" rather than something more useful about deleting dir

0 commit comments

Comments
 (0)