Revision: 5942
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5942&view=rev
Author: manningr
Date: 2010-10-30 18:04:09 +0000 (Sat, 30 Oct 2010)
Log Message:
-----------
Determine forward or backward path slashes not based on OS, but rather on the script name (On Windows, we fix both types of scripts now).
Modified Paths:
--------------
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/update/gui/installer/SplashScreenFixer.java
Modified: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/update/gui/installer/SplashScreenFixer.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/update/gui/installer/SplashScreenFixer.java 2010-10-30 18:02:59 UTC (rev 5941)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/update/gui/installer/SplashScreenFixer.java 2010-10-30 18:04:09 UTC (rev 5942)
@@ -1,8 +1,5 @@
package net.sourceforge.squirrel_sql.client.update.gui.installer;
-import net.sourceforge.squirrel_sql.fw.util.ScriptLineFixer;
-
-
/*
* Copyright (C) 2010 Rob Manning
* man...@us...
@@ -22,6 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+import net.sourceforge.squirrel_sql.fw.util.ScriptLineFixer;
/**
* A line fixer implementation that adds the splash screen icon to the line that launches the SQuirreL
@@ -33,7 +31,7 @@
public static final String CLIENT_MAIN_CLASS = "net.sourceforge.squirrel_sql.client.Main";
/** The splash setting */
- public static final String SPLASH_ICON_ARGUMENT = "-splash:icons/splash.jpg";
+ public static final String SPLASH_ICON = "splash.jpg";
/** A regex pattern version of the main class */
private static final String MAIN_CLASS_PATTERN = "net\\.sourceforge\\.squirrel_sql\\.client\\.Main";
@@ -45,16 +43,24 @@
* @see net.sourceforge.squirrel_sql.fw.util.ScriptLineFixer#fixLine(java.lang.String)
*/
@Override
- public String fixLine(String line) {
+ public String fixLine(String scriptFileName, String line) {
String result = line;
+
+ String splashIconArgument = "-splash:" + SPLASH_ICON;
+ if (scriptFileName.toLowerCase().endsWith(".bat")) {
+ splashIconArgument = "-splash:\"%SQUIRREL_SQL_HOME%\\icons\\"+SPLASH_ICON+"\"";
+ } else {
+ splashIconArgument = "-splash:\"$SQUIRREL_SQL_HOME/icons/"+SPLASH_ICON+"\"";
+ }
+
if (line.contains(CLIENT_MAIN_CLASS)) {
- if (!line.contains(SPLASH_ICON_ARGUMENT)) {
+ if (!line.contains(SPLASH_ICON)) {
String[] parts = line.split(MAIN_CLASS_PATTERN);
if (parts.length == 2) {
StringBuilder newline = new StringBuilder();
newline.append(parts[0]);
newline.append(" ");
- newline.append(SPLASH_ICON_ARGUMENT);
+ newline.append(splashIconArgument);
newline.append(" ");
newline.append(CLIENT_MAIN_CLASS);
newline.append(" ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|