]> source.dussan.org Git - tigervnc.git/commitdiff
Pull version and build number from CMake build system; Change About dialog wording...
authorDRC <dcommander@users.sourceforge.net>
Thu, 6 Oct 2011 06:49:30 +0000 (06:49 +0000)
committerDRC <dcommander@users.sourceforge.net>
Thu, 6 Oct 2011 06:49:30 +0000 (06:49 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4713 3789f03b-4d11-0410-bbf8-ca57d06f2519

doc/dev/version_numbers
java/src/com/tigervnc/vncviewer/CConn.java
java/src/com/tigervnc/vncviewer/VncViewer.java
java/src/com/tigervnc/vncviewer/timestamp.in

index f635e891fff301f20ebe1b69b77497140368083d..e667837068cb46d1b90cad10785abf6faf1f7165 100644 (file)
@@ -2,5 +2,4 @@ Files written below contain release numbers which should be changed during
 release process.
 
 CMakeLists.txt
-java/src/com/tigervnc/vncviewer/VncViewer.java
 unix/xserver/hw/vnc/xvnc.cc
index 5dea315cb5ec4ec2d6474a5bd3e869fd9e4d3ae9..7d76beede6da6464d4a8bed015b3c5137cef8e9b 100644 (file)
@@ -666,7 +666,7 @@ public class CConn extends CConnection
       pkgTime = attributes.getValue("Package-Time");
     } catch (IOException e) { }
     JOptionPane.showMessageDialog((viewport != null ? viewport : null),
-      VncViewer.about1+"\n"
+      VncViewer.about1+" v"+VncViewer.version+" ("+VncViewer.build+")\n"
       +"Built on "+pkgDate+" at "+pkgTime+"\n"
       +VncViewer.about2+"\n"
       +VncViewer.about3,
index 95afacfc7cfc3de2fbb842e3562dd5760c516b8e..bea486b003903dc9cbfa75c40cbe4ad8343a8495 100644 (file)
@@ -33,6 +33,9 @@ import java.awt.Graphics;
 import java.awt.Image;
 import java.awt.image.*;
 import java.awt.Label;
+import java.io.InputStream;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
 import javax.swing.*;
 import java.net.URL;
 
@@ -42,12 +45,13 @@ import com.tigervnc.rfb.Exception;
 
 public class VncViewer extends java.applet.Applet implements Runnable
 {
-  public static final String version = "1.1.80";
-  public static final String about1 = "TigerVNC Viewer for Java "+version;
+  public static final String about1 = "TigerVNC Viewer for Java";
   public static final String about2 = "Copyright (C) 1998-2011 "+
-                                      "[many holders]";
-  public static final String about3 = "Visit www.tigervnc.org "+
+                                      "TigerVNC Team and many others (see README)";
+  public static final String about3 = "Visit http://www.tigervnc.org "+
                                       "for information on TigerVNC.";
+  public static String version = null;
+  public static String build = null;
 
   public static void main(String[] argv) {
     try {
@@ -150,6 +154,16 @@ public class VncViewer extends java.applet.Applet implements Runnable
 
   public void start() {
     vlog.debug("start called");
+    if (version == null || build == null) {
+      ClassLoader cl = this.getClass().getClassLoader();
+      InputStream stream = cl.getResourceAsStream("com/tigervnc/vncviewer/timestamp");
+      try {
+        Manifest manifest = new Manifest(stream);
+        Attributes attributes = manifest.getMainAttributes();
+        version = attributes.getValue("Version");
+        build = attributes.getValue("Build");
+      } catch (java.io.IOException e) { }
+    }
     nViewers++;
     if (firstApplet) {
       alwaysShowServerDialog.setParam(true);
@@ -169,7 +183,7 @@ public class VncViewer extends java.applet.Applet implements Runnable
   public void paint(Graphics g) {
     g.drawImage(logo, 0, 0, this);
     int h = logo.getHeight(this)+20;
-    g.drawString(about1, 0, h);
+    g.drawString(about1+" v"+version+" ("+build+")", 0, h);
     h += g.getFontMetrics().getHeight();
     g.drawString(about2, 0, h);
     h += g.getFontMetrics().getHeight();
index 5f6326aa65ae460c4ce3d7def0e56f18f70f7024..b666e7c0f65fbea08076de4c8b12b90dcdb99a96 100644 (file)
@@ -2,3 +2,5 @@ Manifest-Version: 1.0
 Main-Class: com.tigervnc.vncviewer.VncViewer
 Package-Date: @JAVA_DATE@
 Package-Time: @JAVA_TIME@
+Version: @VERSION@
+Build: @BUILD@