From d76f709f8cd5f816ce8ff90cefa6e9b7fcf3ad49 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 04 Sep 2009 12:31:26 +0000
Subject: [PATCH] Use a different message for the license acceptance in CLI and GUI mode. In CLI mode the license appears above and in GUI mode below the message.
---
opends/src/server/org/opends/server/tools/InstallDS.java | 10 +++++++---
opends/src/messages/messages/quicksetup.properties | 5 +++--
opends/src/quicksetup/org/opends/quicksetup/installer/ui/InstallLicensePanel.java | 21 ++-------------------
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 2 +-
4 files changed, 13 insertions(+), 25 deletions(-)
diff --git a/opends/src/messages/messages/quicksetup.properties b/opends/src/messages/messages/quicksetup.properties
index b27eff9..ae03df1 100644
--- a/opends/src/messages/messages/quicksetup.properties
+++ b/opends/src/messages/messages/quicksetup.properties
@@ -1319,14 +1319,15 @@
href="https://www.opends.org/wiki/page/OverviewOfTheQuickSetupTool"> OpenDS \
documentation wiki</a>.
INFO_WELCOME_STEP=Welcome
-INFO_LICENSE_PANEL_OFFLINE_INSTRUCTIONS=Please read the following important \
- information before continuing.
INFO_LICENSE_PANEL_TITLE=License
INFO_LICENSE_PANEL_WEBSTART_INSTRUCTIONS=bla bla
INFO_LICENSE_STEP=License
INFO_LICENSE_DETAILS_LABEL=<html>Please read the following License Agreement.\
<br>You must accept the terms of the agreement before continuing with the \
installation.
+INFO_LICENSE_DETAILS_CLI_LABEL=Please read the License Agreement above.%n\
+ You must accept the terms of the agreement before continuing with the \
+ installation.
INFO_LICENSE_CLICK_LABEL=Click to accept
INFO_LICENSE_CLI_ACCEPT_QUESTION=Accept the license (%s/%s) [%s]:
INFO_LICENSE_CLI_ACCEPT_YES=Yes
diff --git a/opends/src/quicksetup/org/opends/quicksetup/installer/ui/InstallLicensePanel.java b/opends/src/quicksetup/org/opends/quicksetup/installer/ui/InstallLicensePanel.java
index 5f939bc..6804efc 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/installer/ui/InstallLicensePanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/installer/ui/InstallLicensePanel.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Copyright 2006-2008 Sun Microsystems, Inc.
+ * Copyright 2006-2009 Sun Microsystems, Inc.
*/
package org.opends.quicksetup.installer.ui;
@@ -39,8 +39,6 @@
import org.opends.quicksetup.ui.GuiApplication;
import org.opends.quicksetup.ui.QuickSetupStepPanel;
import org.opends.quicksetup.ui.UIFactory;
-import org.opends.quicksetup.util.Utils;
-import org.opends.quicksetup.Installation;
import org.opends.quicksetup.LicenseFile;
import org.opends.quicksetup.ButtonName;
@@ -74,22 +72,7 @@
*/
protected Message getInstructions()
{
- /*
- * We can use org.opends.server.util.DynamicConstants without problems as it
- * has been added to quicksetup.jar during build time.
- */
- Message message;
- if (Utils.isWebStart())
- {
- String cmd = Utils.isWindows()? Installation.WINDOWS_SETUP_FILE_NAME:
- Installation.UNIX_SETUP_FILE_NAME;
- message = INFO_LICENSE_PANEL_WEBSTART_INSTRUCTIONS.get();
- }
- else
- {
- message = INFO_LICENSE_PANEL_OFFLINE_INSTRUCTIONS.get();
- }
- return message;
+ return null;
}
private TextArea detailsTextArea;
diff --git a/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index d5a2231..22dfe21 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -836,7 +836,7 @@
// and force to accept it.
String yes = INFO_LICENSE_CLI_ACCEPT_YES.get().toString();
String no = INFO_LICENSE_CLI_ACCEPT_NO.get().toString();
- System.out.println(INFO_LICENSE_DETAILS_LABEL.get().toString());
+ System.out.println(INFO_LICENSE_DETAILS_CLI_LABEL.get().toString());
BufferedReader in = new BufferedReader(new InputStreamReader(
System.in));
diff --git a/opends/src/server/org/opends/server/tools/InstallDS.java b/opends/src/server/org/opends/server/tools/InstallDS.java
index 0d34fd4..86a5a19 100644
--- a/opends/src/server/org/opends/server/tools/InstallDS.java
+++ b/opends/src/server/org/opends/server/tools/InstallDS.java
@@ -432,7 +432,9 @@
// and force to accept it.
String yes = INFO_LICENSE_CLI_ACCEPT_YES.get().toString();
String no = INFO_LICENSE_CLI_ACCEPT_NO.get().toString();
- println(INFO_LICENSE_DETAILS_LABEL.get());
+ String yesShort = INFO_PROMPT_YES_FIRST_LETTER_ANSWER.get().toString();
+ String noShort = INFO_PROMPT_NO_FIRST_LETTER_ANSWER.get().toString();
+ println(INFO_LICENSE_DETAILS_CLI_LABEL.get());
BufferedReader in = getInputStream();
while (true)
@@ -442,13 +444,15 @@
{
String response = in.readLine();
if ((response == null)
- || (response.toLowerCase().equals(no.toLowerCase()))
+ || (response.equalsIgnoreCase(no))
+ || (response.equalsIgnoreCase(noShort))
|| (response.length() == 0))
{
return ErrorReturnCode.ERROR_LICENSE_NOT_ACCEPTED.getReturnCode();
}
else
- if (response.toLowerCase().equals(yes.toLowerCase()))
+ if (response.equalsIgnoreCase(yes)
+ || response.equalsIgnoreCase(yesShort))
{
LicenseFile.setApproval(true);
break ;
--
Gitblit v1.10.0