do revision check and set RELEASE variable based on the result

This commit is contained in:
benfry
2010-03-11 17:56:39 +00:00
parent b2d9268035
commit 40d53e01a9
2 changed files with 15 additions and 6 deletions

View File

@@ -41,7 +41,10 @@ import processing.core.*;
*/
public class Base {
static final int REVISION = 179;
public static String VERSION_NAME = "0179";
/** This might be replaced by main() if there's a lib/version.txt file. */
static public String VERSION_NAME = "0179";
/** Set true if this a proper release rather than a numbered revision. */
static public boolean RELEASE = false;
static HashMap<Integer, String> platformNames = new HashMap<Integer, String>();
static {
@@ -103,7 +106,11 @@ public class Base {
try {
File versionFile = getContentFile("lib/version.txt");
if (versionFile.exists()) {
VERSION_NAME = PApplet.loadStrings(versionFile)[0];
String version = PApplet.loadStrings(versionFile)[0];
if (!version.equals(VERSION_NAME)) {
VERSION_NAME = version;
RELEASE = true;
}
}
} catch (Exception e) {
e.printStackTrace();

View File

@@ -820,10 +820,12 @@ public class Editor extends JFrame implements RunnerListener {
// These are temporary entries while Android mode is being worked out.
// The mode will not be in the tools menu, and won't involve a cmd-key
item = createToolMenuItem("processing.app.tools.android.AndroidTool");
item.setAccelerator(KeyStroke.getKeyStroke('D', modifiers));
menu.add(item);
menu.add(createToolMenuItem("processing.app.tools.android.Reset"));
if (!Base.RELEASE) {
item = createToolMenuItem("processing.app.tools.android.AndroidTool");
item.setAccelerator(KeyStroke.getKeyStroke('D', modifiers));
menu.add(item);
menu.add(createToolMenuItem("processing.app.tools.android.Reset"));
}
return menu;
}