[izpack-changes] r1486 - izpack-src/trunk/src/lib/com/izforge/izpack/installer

noreply at berlios.de noreply at berlios.de
Tue Jul 11 15:12:48 CEST 2006


Author: bartzkau
Date: 2006-07-11 15:12:47 +0200 (Tue, 11 Jul 2006)
New Revision: 1486

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/installer/GUIInstaller.java
   izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java
Log:
Alternative frame and quit dialog title and quit dialog message.


Modified: izpack-src/trunk/src/lib/com/izforge/izpack/installer/GUIInstaller.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/installer/GUIInstaller.java	2006-07-11 13:11:18 UTC (rev 1485)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/installer/GUIInstaller.java	2006-07-11 13:12:47 UTC (rev 1486)
@@ -1,4 +1,5 @@
 /*
+ * $Id:$
  * IzPack - Copyright 2001-2006 Julien Ponge, All Rights Reserved.
  * 
  * http://www.izforge.com/izpack/
@@ -68,6 +69,7 @@
 import com.izforge.izpack.gui.LabelFactory;
 import com.izforge.izpack.util.Debug;
 import com.izforge.izpack.util.OsVersion;
+import com.izforge.izpack.util.VariableSubstitutor;
 
 /**
  * The IzPack graphical installer class.
@@ -408,9 +410,20 @@
         UIManager.put("OptionPane.noButtonText", installdata.langpack.getString("installer.no"));
         UIManager.put("OptionPane.cancelButtonText", installdata.langpack
                 .getString("installer.cancel"));
-
-        String title = installdata.langpack.getString("installer.title")
-                + this.installdata.info.getAppName();
+        String title;
+        // Use a alternate message if defined.
+        final String key = "installer.reversetitle";
+        String message = installdata.langpack.getString(key);
+        // message equal to key -> no message defined.
+        if (message.indexOf(key) > -1)
+            title = installdata.langpack.getString("installer.title")
+                    + installdata.info.getAppName();
+        else
+        {   // Attention! The alternate message has to contain the hole message including
+            // $APP_NAME and may be $APP_VER.
+            VariableSubstitutor vs = new VariableSubstitutor(installdata.getVariables());
+            title = vs.substitute(message, null);
+        }
         new InstallerFrame(title, this.installdata);
     }
 

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java	2006-07-11 13:11:18 UTC (rev 1485)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java	2006-07-11 13:12:47 UTC (rev 1486)
@@ -96,6 +96,7 @@
 import com.izforge.izpack.util.Debug;
 import com.izforge.izpack.util.Housekeeper;
 import com.izforge.izpack.util.OsConstraint;
+import com.izforge.izpack.util.VariableSubstitutor;
 
 /**
  * The IzPack installer frame.
@@ -819,9 +820,21 @@
                 interruptCount++;
                 return;
             }
-            int res = JOptionPane.showConfirmDialog(this, langpack
-                    .getString("installer.quit.message"), langpack
-                    .getString("installer.quit.title"), JOptionPane.YES_NO_OPTION);
+            // Use a alternate message and title if defined.
+            final String mkey = "installer.quit.reversemessage";
+            final String tkey = "installer.quit.reversetitle";
+            String message = langpack.getString(mkey);
+            String title = langpack.getString(tkey);
+            // message equal to key -> no alternate message defined.
+            if (message.indexOf(mkey) > -1) message = langpack.getString("installer.quit.message");
+            // title equal to key -> no alternate title defined.
+            if (title.indexOf(tkey) > -1) title = langpack.getString("installer.quit.title");
+            // Now replace variables in message or title.
+            VariableSubstitutor vs = new VariableSubstitutor(installdata.getVariables());
+            message = vs.substitute(message, null);
+            title = vs.substitute(title, null);
+            int res = JOptionPane
+                    .showConfirmDialog(this, message, title, JOptionPane.YES_NO_OPTION);
             if (res == JOptionPane.YES_OPTION)
             {
                 wipeAborted();




More information about the izpack-changes mailing list