The following commit has been merged in the patch/version branch: commit 52736ab6cc4b631ac13339207aa54906687f4f41 Merge: 30bc5d39c4b3e487769094137ee76a6238b3b549 cb0585b952c976be56d9811276f8222975abd743 Author: Giovanni Mascellani <mascell...@poisson.phc.unipi.it> Date: Sat May 12 00:30:19 2012 +0200
Merge commit 'refs/top-bases/patch/version' into patch/version diff --combined geogebra/GeoGebra.java index 2a279c4,bd03821..ff31dfc --- a/geogebra/GeoGebra.java +++ b/geogebra/GeoGebra.java @@@ -19,8 -19,8 +19,8 @@@ import java.net.URL public class GeoGebra extends Object { // GeoGebra version - public static final String BUILD_DATE = "10 January 2012"; - public static final String VERSION_STRING = "4.0.19.0"; + public static final String BUILD_DATE = "20 April 2012"; + public static final String VERSION_STRING = "4.0.30.0"; public static final String SPLASH_STRING = "splash40.png"; public static final String PREFERENCES_ROOT = "/geogebra40"; public static final String SHORT_VERSION_STRING = "4.0"; // used for online @@@ -28,16 -28,10 +28,12 @@@ public static final boolean CAS_VIEW_ENABLED = false; public static final boolean IS_PRE_RELEASE = !VERSION_STRING.endsWith(".0"); + public static final String DEBIAN_VERSION_STRING = GeoGebraDebian.DEBIAN_VERSION_STRING; + // File format versions public static final String XML_FILE_FORMAT = "4.0"; public static final String GGB_XSD_FILENAME = "ggb.xsd"; // for ggb files public static final String GGT_XSD_FILENAME = "ggt.xsd"; // for macro files - public static final String I2G_FILE_FORMAT = "0.1.20080731"; - - // pre-releases and I2G - public static final boolean DISABLE_I2G = !IS_PRE_RELEASE; // URLs public final static String GEOGEBRA_ONLINE_ARCHIVE_BASE = "http://www.geogebra.org/webstart/" @@@ -53,11 -47,13 +49,13 @@@ // max possible heap space for applets in MB public final static int MAX_HEAP_SPACE = 512; + /** URL of GeoGebraWeb main js file*/ + public static final String GEOGEBRA_HTML5_BASE = "http://www.geogebra.org/web/4.2/web/web.nocache.js"; public static Frame splashFrame = null; - public static void main(String[] cmdArgs) { - CommandLineArguments args = new CommandLineArguments(cmdArgs); + public static void main(final String[] cmdArgs) { + final CommandLineArguments args = new CommandLineArguments(cmdArgs); boolean showSplash = true; if (!args.getBooleanValue("showSplash", true)) { @@@ -74,9 -70,11 +72,11 @@@ if (showSplash) { // Show splash screen - URL imageURL = GeoGebra.class.getResource("/geogebra/" + SPLASH_STRING); + final URL imageURL = GeoGebra.class.getResource("/geogebra/" + + SPLASH_STRING); if (imageURL != null) { - splashFrame = SplashWindow.splash(Toolkit.getDefaultToolkit().createImage(imageURL)); + splashFrame = SplashWindow.splash(Toolkit.getDefaultToolkit() + .createImage(imageURL)); } else { System.err.println("Splash image not found"); } @@@ -85,7 -83,7 +85,7 @@@ // Start GeoGebra try { startGeoGebra(args); - } catch (Throwable e) { + } catch (final Throwable e) { e.printStackTrace(); System.err.flush(); System.exit(10); @@@ -97,7 -95,7 +97,7 @@@ } } - private static void startGeoGebra(CommandLineArguments args) { + private static void startGeoGebra(final CommandLineArguments args) { // create and open first GeoGebra window geogebra.gui.app.GeoGebraFrame.main(args); } diff --combined geogebra/gui/app/GeoGebraFrame.java index ec0f215,ec4dda1..63d06b2 --- a/geogebra/gui/app/GeoGebraFrame.java +++ b/geogebra/gui/app/GeoGebraFrame.java @@@ -426,6 -426,9 +426,9 @@@ public class GeoGebraFrame extends JFra */ private void checkVersion() { + if (!Application.getVersionCheckAllowed()) + return; + String lastVersionCheck = GeoGebraPreferences.getPref() .loadPreference(GeoGebraPreferences.VERSION_LAST_CHECK, ""); Long nowL = new Date().getTime(); @@@ -467,9 -470,16 +470,9 @@@ String dl = app.getPlain("GoToDownloadPage"); Object[] options = { app.getMenu("Cancel"), dl }; Component comp = app.getMainComponent(); // store date of current check only when notification has been shown: GeoGebraPreferences.getPref().savePreference( GeoGebraPreferences.VERSION_LAST_CHECK, nowLS); - if (returnVal == 1) { - app.getGuiManager().showURLinBrowser(INSTALLERS_URL); - } } } catch (Exception ex) { System.err.println(ex); diff --combined geogebra/main/Application.java index bca00b5,fb2d7ec..a4c3890 --- a/geogebra/main/Application.java +++ b/geogebra/main/Application.java @@@ -24,11 -24,11 +24,11 @@@ import geogebra.euclidian.DrawEquation import geogebra.euclidian.EuclidianController; import geogebra.euclidian.EuclidianView; import geogebra.euclidian.EuclidianViewInterface; - import geogebra.export.GraphicExportDialog; import geogebra.export.WorksheetExportDialog; import geogebra.gui.GuiManager; import geogebra.gui.app.GeoGebraFrame; import geogebra.gui.inputbar.AlgebraInput; + import geogebra.gui.toolbar.Toolbar; import geogebra.gui.util.ImageSelection; import geogebra.gui.view.algebra.AlgebraView; import geogebra.io.MyXMLHandler; @@@ -176,6 -176,7 +176,7 @@@ public class Application implements Key supportedLocales.add(new Locale("sq")); // Albanian } + supportedLocales.add(new Locale("hy")); // Armenian supportedLocales.add(new Locale("ar")); // Arabic supportedLocales.add(new Locale("eu")); // Basque supportedLocales.add(new Locale("bs")); // Bosnian @@@ -311,9 -312,6 +312,6 @@@ // file extension string public static final String FILE_EXT_GEOGEBRA = "ggb"; - // Added for Intergeo File Format (Yves Kreis) --> - public static final String FILE_EXT_INTERGEO = "i2g"; - // <-- Added for Intergeo File Format (Yves Kreis) public static final String FILE_EXT_GEOGEBRA_TOOL = "ggt"; public static final String FILE_EXT_PNG = "png"; public static final String FILE_EXT_EPS = "eps"; @@@ -340,12 -338,6 +338,6 @@@ private static final String RB_SETTINGS = "/geogebra/export/settings"; private static final String RB_ALGO2COMMAND = "/geogebra/kernel/algo2command"; - // Added for Intergeo File Format (Yves Kreis) --> - private static final String RB_ALGO2INTERGEO = "/geogebra/kernel/algo2intergeo"; - // <-- Added for Intergeo File Format (Yves Kreis) - - // private static Color COLOR_STATUS_BACKGROUND = new Color(240, 240, 240); - private boolean hasGui = false; public static final int VIEW_NONE = 0; @@@ -556,20 -548,21 +548,21 @@@ // This is needed before handleFileArg because // we don't want to redefine the toolbar string from the file. boolean ggtloading = handleFileArgGGTMaybeLoaded(args); + + // init xml io for construction loading + myXMLio = new MyXMLio(kernel, kernel.getConstruction()); + + // init default preferences if necessary + if (!isApplet) { + GeoGebraPreferences.getPref().initDefaultXML(this); + } + if (ggtloading) { if (!isApplet) { GeoGebraPreferences.getPref().loadXMLPreferences(this); } } - // init default preferences if necessary - if (!isApplet) { - GeoGebraPreferences.getPref().initDefaultXML(this); - } - - // init xml io for construction loading - myXMLio = new MyXMLio(kernel, kernel.getConstruction()); - // open file given by startup parameter handleOptionArgsEarly(args); // for --regressionFile=... boolean fileLoaded = handleFileArg(args); @@@ -595,10 -588,15 +588,15 @@@ } } - if (useFullGui() && (tmpPerspectives != null) && !ggtloading) { + //TODO shall ggtLoading affect this test ? + if (useFullGui() && (tmpPerspectives != null)) { getGuiManager().getLayout().setPerspectives(tmpPerspectives); } + if(useFullGui() && ggtloading) { + getGuiManager().setToolBarDefinition(Toolbar.getAllTools(this)); + } + setUndoActive(undoActive); // applet/command line options like file loading on startup @@@ -649,12 -647,12 +647,13 @@@ + " --settingsFile=PATH|FILENAME\tload/save settings from/in a local file\n" + " --resetSettings\treset current settings\n" + " --antiAliasing=BOOLEAN\tturn anti-aliasing on/off\n" - + " --regressionFile=FILENAME\texport textual representations of dependent objects, then exit\n"); + + " --regressionFile=FILENAME\texport textual representations of dependent objects, then exit\n" + + " --versionCheckAllow=SETTING\tallow version check (on/off or true/false for single launch)\n"); System.exit(0); } // help debug applets - System.out.println("GeoGebra " + GeoGebra.VERSION_STRING + " " + System.out.println("GeoGebra " + GeoGebra.VERSION_STRING + " (Debian version " + + GeoGebra.DEBIAN_VERSION_STRING + ") " + GeoGebra.BUILD_DATE + " Java " + System.getProperty("java.version")); if (args.containsArg("v")) { @@@ -1080,6 -1078,9 +1079,9 @@@ private String regressionFileName = null; + private String versionCheckAllow = null; + private static boolean versionCheckAllowed = true; + public void createRegressionFile() throws IOException { if (regressionFileName == null) { return; @@@ -1265,6 -1266,64 +1267,64 @@@ this.getEuclidianView().setAntialiasing(antiAliasing); this.getEuclidianView2().setAntialiasing(antiAliasing); } + + versionCheckAllow = args.getStringValue("versionCheckAllow"); + setVersionCheckAllowed(); + } + + private void setVersionCheckAllowed() { + if (isApplet) { + versionCheckAllowed = false; + return; + } + if (versionCheckAllow != null) { + if (versionCheckAllow.equals("off")) { + GeoGebraPreferences.getPref().savePreference( + GeoGebraPortablePreferences.VERSION_CHECK_ALLOW, + "false"); + versionCheckAllowed = false; + return; + } + if (versionCheckAllow.equals("on")) { + GeoGebraPreferences + .getPref() + .savePreference( + GeoGebraPortablePreferences.VERSION_CHECK_ALLOW, + "true"); + versionCheckAllowed = true; + return; + } + if (versionCheckAllow.equals("false")) { + versionCheckAllowed = false; + return; + } + if (versionCheckAllow.equals("true")) { + versionCheckAllowed = true; + return; + } + // TODO: Throw a warning message here that the option is not + // recognized. + // Now everything is silently accepted. + } + + versionCheckAllowed = Boolean + .valueOf(GeoGebraPreferences.getPref().loadPreference( + GeoGebraPreferences.VERSION_CHECK_ALLOW, "true")); + } + + /** + * Reports if GeoGebra version check is allowed. The version_check_allowed + * preference is read to decide this, which can be set by the command line + * option --versionCheckAllow (off/on). For changing the behavior for a + * single run, the same command line option must be used with false/true + * parameters. + * + * @return if the check is allowed + * @author Zoltan Kovacs <zol...@geogebra.org> + */ + public static boolean getVersionCheckAllowed() { + return versionCheckAllowed; + } private void handleOptionArgsEarly(CommandLineArguments args) { @@@ -1334,8 -1393,9 +1394,9 @@@ if (success && !isMacroFile) { if (!useFullGui()) { - if (!isJustEuclidianVisible()) { - hasGui = true; + if (showConsProtNavigation + || !isJustEuclidianVisible()) { + hasGui = true; } } } @@@ -2218,13 -2278,6 +2279,6 @@@ return MyResourceBundle.loadSingleBundleFile(RB_ALGO2COMMAND); } - // Added for Intergeo File Format (Yves Kreis) --> - public ResourceBundle initAlgo2IntergeoBundle() { - return MyResourceBundle.loadSingleBundleFile(RB_ALGO2INTERGEO); - } - - // <-- Added for Intergeo File Format (Yves Kreis) - private void updateResourceBundles() { if (rbmenu != null) { rbmenu = MyResourceBundle.createBundle(RB_MENU, currentLocale); @@@ -5392,7 -5445,14 +5446,14 @@@ @Override public void run() { setWaitCursor(); - + + simpleExportToClipboard(ev); + + /* + * doesn't work in Win7, XP pasting into eg Paint + * pasting into eg Office 2010 is OK + * + * if (!WINDOWS_VISTA_OR_LATER) { // use other method for WinXP or earlier @@@ -5412,7 -5472,7 +5473,7 @@@ simpleExportToClipboard(ev); } - } + }*/ setDefaultCursor(); } @@@ -5427,8 -5487,8 +5488,8 @@@ // Windows XP clipboard has trouble with images larger than this // at double scale (with scale = 2d) - if (size > 750000) { - scale = 2.0 * Math.sqrt(750000 / size); + if (size > 500000) { + scale = 2.0 * Math.sqrt(500000 / size); } // copy drawing pad to the system clipboard @@@ -5729,7 -5789,7 +5790,7 @@@ return codeBaseFolder.substring(WINDOWS ? 6 : 5); } - public void exportToLMS() { + public void exportToLMS(boolean ggbWeb) { clearSelectedGeos(); WorksheetExportDialog d = new WorksheetExportDialog(this); @@@ -5747,7 -5807,7 +5808,7 @@@ clipboard.setContents( new StringSelection(d.getAppletTag(this, null, width, height, - false, true, false, false)), null); + false, true, ggbWeb, false)), null); d.setVisible(false); d.dispose(); @@@ -5856,6 -5916,10 +5917,10 @@@ * neccesary by checking for eg ^2, \frac */ public static boolean isLaTeXneeded(String latex) { + + // Unicode is fine to render these: + latex = latex.replace("\\leq", ""); + latex = latex.replace("\\geq", ""); for (int i = 0; i < latex.length(); i++) { char ch = latex.charAt(i); -- GeoGebra: Dynamic mathematics software for education _______________________________________________ pkg-java-commits mailing list pkg-java-comm...@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits