Fix launcher messages and application name change. Reported by Pavel Tankov.

cusax-fix
Damian Minkov 15 years ago
parent 4d6b5e76a0
commit ac8a0298cd

@ -476,7 +476,7 @@
<sip-communicator-version property="sip-communicator.version" /> <sip-communicator-version property="sip-communicator.version" />
<echo message="SIP Communicator version ${sip-communicator.version}" /> <echo message="Jitsi version ${sip-communicator.version}" />
</target> </target>
<!--INIT--> <!--INIT-->
@ -1021,12 +1021,18 @@
</jar> </jar>
</target> </target>
<!--BUNDLE-UTIL--> <!--BUNDLE-UTIL
<target name="bundle-util" depends="version"> load-properties target is from resources/install/build.xml
loads the application name from the install settings.
-->
<target name="bundle-util" depends="version,load-properties">
<!-- Create a properties file that the arg handler could use <!-- Create a properties file that the arg handler could use
to determine SC's version --> to determine SC's version -->
<echo file="${dest}/net/java/sip/communicator/util/launchutils/version.properties" <echo file="${dest}/net/java/sip/communicator/util/launchutils/version.properties"
message="APPLICATION_NAME=SIP Communicator${line.separator}" /> message="APPLICATION_NAME=${application.name}${line.separator}" />
<echo file="${dest}/net/java/sip/communicator/util/launchutils/version.properties"
message="PACKAGE_NAME=${package.name}${line.separator}"
append="true"/>
<echo file="${dest}/net/java/sip/communicator/util/launchutils/version.properties" <echo file="${dest}/net/java/sip/communicator/util/launchutils/version.properties"
message="APPLICATION_VERSION=${sip-communicator.version}${line.separator}" message="APPLICATION_VERSION=${sip-communicator.version}${line.separator}"
append="true"/> append="true"/>

@ -96,6 +96,11 @@ public class LaunchArgHandler
*/ */
private static final String PNAME_APPLICATION_NAME = "APPLICATION_NAME"; private static final String PNAME_APPLICATION_NAME = "APPLICATION_NAME";
/**
* The package name of the applications (e.g. jitsi).
*/
private static final String PNAME_PACKAGE_NAME = "PACKAGE_NAME";
/** /**
* The property name containing the current version. * The property name containing the current version.
*/ */
@ -393,7 +398,7 @@ private void handleVersionArg()
if (name == null || name.trim().length() == 0) if (name == null || name.trim().length() == 0)
{ {
name = "SIP Communicator"; name = "Jitsi";
} }
if (version == null || version.trim().length() == 0) if (version == null || version.trim().length() == 0)
@ -421,7 +426,7 @@ private String getVersion()
} }
/** /**
* Returns the name of the application. That should be SIP Communicator * Returns the name of the application. That should be Jitsi
* most of the time but who knows .. * most of the time but who knows ..
* *
* @return the name of the application (i.e. SIP Communicator until we * @return the name of the application (i.e. SIP Communicator until we
@ -432,9 +437,25 @@ private String getApplicationName()
String name = versionProperties.getProperty(PNAME_APPLICATION_NAME); String name = versionProperties.getProperty(PNAME_APPLICATION_NAME);
return name == null return name == null
? "SIP Communicator" ? "Jitsi"
: name;
}
/**
* Returns the package name of the application. That should be jitsi
* most of the time but who knows ..
*
* @return the package name of the application.
*/
private String getPackageName()
{
String name = versionProperties.getProperty(PNAME_PACKAGE_NAME);
return name == null
? "jitsi"
: name; : name;
} }
/** /**
* Prints an error message and then prints the help message. * Prints an error message and then prints the help message.
* *
@ -448,13 +469,13 @@ public void handleUnknownArg(String arg)
/** /**
* Prints a help message containing usage instructions and descriptions of * Prints a help message containing usage instructions and descriptions of
* all options currently supported by SIP Communicator. * all options currently supported by Jitsi.
*/ */
public void handleHelpArg() public void handleHelpArg()
{ {
handleVersionArg(); handleVersionArg();
System.out.println("Usage: sip-communicator [OPTIONS] [uri-to-call]"); System.out.println("Usage: " + getPackageName() + " [OPTIONS] [uri-to-call]");
System.out.println(""); System.out.println("");
System.out.println(" -c, --config=DIR use DIR for config files"); System.out.println(" -c, --config=DIR use DIR for config files");
System.out.println(" -d, --debug print debugging messages to stdout"); System.out.println(" -d, --debug print debugging messages to stdout");

Loading…
Cancel
Save