From: Randy Baumgarte Date: Tue, 28 Dec 2010 20:30:05 +0000 (-0500) Subject: Added startup commands to batch file. X-Git-Tag: version0.1.1~253 X-Git-Url: http://git.sourceforge.jp/view?p=neighbornote%2FNeighborNote.git;a=commitdiff_plain;h=6eaeae2d5778d3d1d4c3dd4c058baad83de42b15;hp=b4d7a9fbc8b648af2d38401bf2541aee70aa9fc2 Added startup commands to batch file. --- diff --git a/nevernote.bat b/nevernote.bat index 7383dab..84b5f5d 100644 --- a/nevernote.bat +++ b/nevernote.bat @@ -4,7 +4,6 @@ rem # Install variables # rem ##################### set NEVERNOTE=%~dp0 - rem ######################################## rem # Memory settings. These can be tuned # rem # to your specific needs. The greater # @@ -66,7 +65,9 @@ rem ################################################################# :Loop IF "%1"=="" GOTO Continue if "%1" == "NN_NAME" set NN_NAME=%2 -echo %NN_NAME% +if "%1" == "NN_HOME" set NN_HOME=%2 +if "%1" == "NN_GC_OPT" set NN_GC_OPT=%2 +if "%1" == "NN_DEBUG" set NN_DEBUG=%2 shift shift GOTO Loop diff --git a/src/cx/fbn/nevernote/NeverNote.java b/src/cx/fbn/nevernote/NeverNote.java index 3ab1cfb..1533417 100644 --- a/src/cx/fbn/nevernote/NeverNote.java +++ b/src/cx/fbn/nevernote/NeverNote.java @@ -699,76 +699,7 @@ public class NeverNote extends QMainWindow{ if (Global.checkVersionUpgrade()) checkForUpdates(); } - - public void checkForUpdates() { - // Send off thread to check for a new version - versionChecker = new QNetworkAccessManager(this); - versionChecker.finished.connect(this, "upgradeFileRead(QNetworkReply)"); - QNetworkRequest request = new QNetworkRequest(); - request.setUrl(new QUrl(Global.getUpdatesAvailableUrl())); - versionChecker.get(request); - } - private void upgradeFileRead(QNetworkReply reply) { - if (!reply.isReadable()) - return; - - String winVersion = Global.version; - String osxVersion = Global.version; - String linuxVersion = Global.version; - String linux64Version = Global.version; - String version = Global.version; - // Determine the versions available - QByteArray data = reply.readLine(); - while (data != null && !reply.atEnd()) { - String line = data.toString(); - String lineVersion; - if (line.contains(":")) - lineVersion = line.substring(line.indexOf(":")+1).replace(" ", "").replace("\n", ""); - else - lineVersion = ""; - if (line.toLowerCase().contains("windows")) - winVersion = lineVersion; - else if (line.toLowerCase().contains("os-x")) - osxVersion = lineVersion; - else if (line.toLowerCase().contains("linux amd64")) - linux64Version = lineVersion; - else if (line.toLowerCase().contains("linux i386")) - linuxVersion = lineVersion; - else if (line.toLowerCase().contains("default")) - version = lineVersion; - - // Read the next line - data = reply.readLine(); - } - - // Now we need to determine what system we are on. - if (System.getProperty("os.name").toLowerCase().contains("windows")) - version = winVersion; - if (System.getProperty("os.name").toLowerCase().contains("mac os")) - version = osxVersion; - if (System.getProperty("os.name").toLowerCase().contains("Linux")) { - if (System.getProperty("os.arch").contains("amd64") || - System.getProperty("os.arch").contains("x86_64") || - System.getProperty("os.arch").contains("i686")) - version = linux64Version; - else - version = linuxVersion; - } - - - if (Global.version.equals(version)) - return; - - UpgradeAvailableDialog dialog = new UpgradeAvailableDialog(); - dialog.exec(); - if (dialog.remindMe()) - Global.setCheckVersionUpgrade(true); - else - Global.setCheckVersionUpgrade(false); - } - - // Main entry point public static void main(String[] args) { log.setLevel(Level.FATAL); @@ -2564,7 +2495,75 @@ public class NeverNote extends QMainWindow{ Global.saveWindowVisible("leftPanel", hidden); } + public void checkForUpdates() { + // Send off thread to check for a new version + versionChecker = new QNetworkAccessManager(this); + versionChecker.finished.connect(this, "upgradeFileRead(QNetworkReply)"); + QNetworkRequest request = new QNetworkRequest(); + request.setUrl(new QUrl(Global.getUpdatesAvailableUrl())); + versionChecker.get(request); + } + @SuppressWarnings("unused") + private void upgradeFileRead(QNetworkReply reply) { + if (!reply.isReadable()) + return; + + String winVersion = Global.version; + String osxVersion = Global.version; + String linuxVersion = Global.version; + String linux64Version = Global.version; + String version = Global.version; + + // Determine the versions available + QByteArray data = reply.readLine(); + while (data != null && !reply.atEnd()) { + String line = data.toString(); + String lineVersion; + if (line.contains(":")) + lineVersion = line.substring(line.indexOf(":")+1).replace(" ", "").replace("\n", ""); + else + lineVersion = ""; + if (line.toLowerCase().contains("windows")) + winVersion = lineVersion; + else if (line.toLowerCase().contains("os-x")) + osxVersion = lineVersion; + else if (line.toLowerCase().contains("linux amd64")) + linux64Version = lineVersion; + else if (line.toLowerCase().contains("linux i386")) + linuxVersion = lineVersion; + else if (line.toLowerCase().contains("default")) + version = lineVersion; + // Read the next line + data = reply.readLine(); + } + + // Now we need to determine what system we are on. + if (System.getProperty("os.name").toLowerCase().contains("windows")) + version = winVersion; + if (System.getProperty("os.name").toLowerCase().contains("mac os")) + version = osxVersion; + if (System.getProperty("os.name").toLowerCase().contains("Linux")) { + if (System.getProperty("os.arch").contains("amd64") || + System.getProperty("os.arch").contains("x86_64") || + System.getProperty("os.arch").contains("i686")) + version = linux64Version; + else + version = linuxVersion; + } + + + if (Global.version.equals(version)) + return; + + UpgradeAvailableDialog dialog = new UpgradeAvailableDialog(); + dialog.exec(); + if (dialog.remindMe()) + Global.setCheckVersionUpgrade(true); + else + Global.setCheckVersionUpgrade(false); + } + //*************************************************************** //***************************************************************