From bccccbb66280c3a29d53a5df7ccd2c909982f50a Mon Sep 17 00:00:00 2001 From: gohai Date: Sat, 4 Jun 2016 08:49:40 -0400 Subject: [PATCH] Fix upload when Linux isn't selected for export in dialog --- resources/build.properties | 4 ++-- src/gohai/uploadtopi/UploadToPiTool.java | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/build.properties b/resources/build.properties index 78b3820..f9fd2c6 100755 --- a/resources/build.properties +++ b/resources/build.properties @@ -134,12 +134,12 @@ source.repository=https://github.com/gohai/processing-uploadtopi.git # This is used to compare different versions of the same Tool, and check if an # update is available. -tool.version=6 +tool.version=7 # The version as the user will see it. -tool.prettyVersion=1.0.5 +tool.prettyVersion=1.0.6 # The min and max revision of Processing compatible with your Tool. diff --git a/src/gohai/uploadtopi/UploadToPiTool.java b/src/gohai/uploadtopi/UploadToPiTool.java index df1753a..62fc939 100755 --- a/src/gohai/uploadtopi/UploadToPiTool.java +++ b/src/gohai/uploadtopi/UploadToPiTool.java @@ -304,8 +304,15 @@ public void exportSketch() throws NoSuchMethodException, IllegalAccessException, Mode mode = editor.getMode(); Sketch sketch = editor.getSketch(); - Method javaModeMethod = mode.getClass().getMethod("handleExportApplication", sketch.getClass()); - javaModeMethod.invoke(mode, sketch); + String oldSetting = Preferences.get("export.application.platform_linux"); + Preferences.set("export.application.platform_linux", "true"); + + try { + Method javaModeMethod = mode.getClass().getMethod("handleExportApplication", sketch.getClass()); + javaModeMethod.invoke(mode, sketch); + } finally { + Preferences.set("export.application.platform_linux", oldSetting); + } }