Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Prakash2013-01-30 20:20:03 -0500
committerWinston Prakash2013-01-30 20:20:03 -0500
commit961404fc4f7dfb4aa83c71bad4e813b88d32b5b0 (patch)
tree236d8a5b46b47c3f35dad2229958de882f6fb2d4
parent0e2f6942348326fb90ea777f76422f5b3dfe0414 (diff)
downloadorg.eclipse.hudson.core-961404fc4f7dfb4aa83c71bad4e813b88d32b5b0.tar.gz
org.eclipse.hudson.core-961404fc4f7dfb4aa83c71bad4e813b88d32b5b0.tar.xz
org.eclipse.hudson.core-961404fc4f7dfb4aa83c71bad4e813b88d32b5b0.zip
Fix: Bug 399218 - Use a green ball for successful job runs instead of a blue ball. I've provided an option in the global configuration to switch to the blue ball
-rw-r--r--hudson-core/src/main/java/hudson/model/BallColor.java21
-rw-r--r--hudson-core/src/main/java/hudson/model/Hudson.java16
-rw-r--r--hudson-core/src/main/java/hudson/model/Result.java6
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/graph/ColorPalette.java1
-rw-r--r--hudson-core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index.jelly10
-rw-r--r--hudson-core/src/main/resources/hudson/model/Executor/causeOfDeath.jelly11
-rw-r--r--hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly4
-rw-r--r--hudson-core/src/main/resources/hudson/model/Hudson/configure.properties3
-rw-r--r--hudson-core/src/main/resources/hudson/model/Hudson/legend.jelly19
-rw-r--r--hudson-core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Success/status.jelly11
-rw-r--r--hudson-war/src/main/webapp/help/system-config/use-blue-ball.html19
-rw-r--r--hudson-war/src/main/webapp/images/16x16/green_anime.gifbin0 -> 5384 bytes
-rw-r--r--hudson-war/src/main/webapp/images/24x24/green_anime.gifbin0 -> 6856 bytes
-rw-r--r--hudson-war/src/main/webapp/images/32x32/green_anime.gifbin0 -> 11748 bytes
-rw-r--r--hudson-war/src/main/webapp/images/48x48/green_anime.gifbin0 -> 17014 bytes
15 files changed, 101 insertions, 20 deletions
diff --git a/hudson-core/src/main/java/hudson/model/BallColor.java b/hudson-core/src/main/java/hudson/model/BallColor.java
index c086c03d..d2c2414b 100644
--- a/hudson-core/src/main/java/hudson/model/BallColor.java
+++ b/hudson-core/src/main/java/hudson/model/BallColor.java
@@ -9,7 +9,7 @@
*
* Contributors:
*
- * Kohsuke Kawaguchi, Simon Wiest
+ * Kohsuke Kawaguchi, Winston Prakash, Simon Wiest
*
*
*******************************************************************************/
@@ -48,6 +48,8 @@ public enum BallColor implements StatusIcon {
RED_ANIME("red_anime", Messages._BallColor_InProgress(), ColorPalette.RED),
YELLOW("yellow", Messages._BallColor_Unstable(), ColorPalette.YELLOW),
YELLOW_ANIME("yellow_anime", Messages._BallColor_InProgress(), ColorPalette.YELLOW),
+ GREEN("green", Messages._BallColor_Success(), ColorPalette.GREEN),
+ GREEN_ANIME("green_anime", Messages._BallColor_InProgress(), ColorPalette.GREEN),
BLUE("blue", Messages._BallColor_Success(), ColorPalette.BLUE),
BLUE_ANIME("blue_anime", Messages._BallColor_InProgress(), ColorPalette.BLUE),
// for historical reasons they are called grey.
@@ -61,6 +63,8 @@ public enum BallColor implements StatusIcon {
private final String image;
private final Color baseColor;
+ // Historically Hudson was using blue ball instead of green
+ // If user sets the option to use blue then blue ball is used instead of green
BallColor(String image, Localizable description, Color baseColor) {
this.baseColor = baseColor;
// name() is not usable in the constructor, so I have to repeat the name twice
@@ -73,11 +77,21 @@ public enum BallColor implements StatusIcon {
* String like "red.png" that represents the file name of the image.
*/
public String getImage() {
- return image;
+ if (Hudson.getInstance().useBlueBall()) {
+ return image.replaceAll("green", "blue");
+ } else {
+ return image;
+ }
}
+ @Override
public String getImageOf(String size) {
- return Stapler.getCurrentRequest().getContextPath() + Hudson.RESOURCE_PATH + "/images/" + size + '/' + image;
+ if (Hudson.getInstance().useBlueBall()) {
+ String blueImage = image.replaceAll("green", "blue");
+ return Stapler.getCurrentRequest().getContextPath() + Hudson.RESOURCE_PATH + "/images/" + size + '/' + blueImage;
+ } else {
+ return Stapler.getCurrentRequest().getContextPath() + Hudson.RESOURCE_PATH + "/images/" + size + '/' + image;
+ }
}
/**
@@ -85,6 +99,7 @@ public enum BallColor implements StatusIcon {
*
* @alt.
*/
+ @Override
public String getDescription() {
return description.toString(LocaleProvider.getLocale());
}
diff --git a/hudson-core/src/main/java/hudson/model/Hudson.java b/hudson-core/src/main/java/hudson/model/Hudson.java
index 8835cc9f..5de153ed 100644
--- a/hudson-core/src/main/java/hudson/model/Hudson.java
+++ b/hudson-core/src/main/java/hudson/model/Hudson.java
@@ -451,6 +451,12 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
* Widgets on Hudson.
*/
private transient final List<Widget> widgets = getExtensionList(Widget.class);
+
+ /**
+ * Use Blue ball instead of the default green ball
+ */
+ private Boolean useBlueBall = false;
+
/**
* {@link AdjunctManager}
*/
@@ -2388,6 +2394,14 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
}
return null;
}
+
+ /**
+ * Should Hudson use blue ball instead of default green ball for success
+ * @return
+ */
+ public boolean useBlueBall() {
+ return useBlueBall.booleanValue();
+ }
//
//
@@ -2425,6 +2439,8 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
primaryView = json.has("primaryView") ? json.getString("primaryView") : getViews().iterator().next().getViewName();
+ useBlueBall = json.has("useBlueBall") ? true : false;
+
noUsageStatistics = json.has("usageStatisticsCollected") ? null : true;
{
diff --git a/hudson-core/src/main/java/hudson/model/Result.java b/hudson-core/src/main/java/hudson/model/Result.java
index b328f025..f4f96976 100644
--- a/hudson-core/src/main/java/hudson/model/Result.java
+++ b/hudson-core/src/main/java/hudson/model/Result.java
@@ -33,14 +33,14 @@ import java.util.List;
/**
* The build outcome.
*
- * @author Kohsuke Kawaguchi
+ * @author Kohsuke Kawaguchi, Winston Prakash
*/
-public final class Result implements Serializable, CustomExportedBean {
+public class Result implements Serializable, CustomExportedBean {
/**
* The build had no errors.
*/
- public static final Result SUCCESS = new Result("SUCCESS", BallColor.BLUE, 0);
+ public static final Result SUCCESS = new Result("SUCCESS", BallColor.GREEN, 0);
/**
* The build had some errors but they were not fatal. For example, some
* tests failed.
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/graph/ColorPalette.java b/hudson-core/src/main/java/org/eclipse/hudson/graph/ColorPalette.java
index d494a8e1..70ff2efe 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/graph/ColorPalette.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/graph/ColorPalette.java
@@ -30,6 +30,7 @@ public class ColorPalette {
public static final Color RED = new Color(0xEF, 0x29, 0x29);
public static final Color YELLOW = new Color(0xFC, 0xE9, 0x4F);
+ public static final Color GREEN = Color.GREEN.darker();
public static final Color BLUE = new Color(0x72, 0x9F, 0xCF);
public static final Color GREY = new Color(0xAB, 0xAB, 0xAB);
/**
diff --git a/hudson-core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index.jelly b/hudson-core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index.jelly
index 092190e3..03229967 100644
--- a/hudson-core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index.jelly
+++ b/hudson-core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index.jelly
@@ -9,9 +9,8 @@
#
# Contributors:
#
-# Kohsuke Kawaguchi
+# Kohsuke Kawaguchi, Winston Prakash
#
-#
#************************************************************************** -->
@@ -44,7 +43,12 @@
<!-- already installed -->
<j:otherwise>
<h1>
- <img src="${imagesURL}/48x48/blue.png" alt=""/>
+ <j:if test="${app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/blue.png" alt=""/>
+ </j:if>
+ <j:if test="${!app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/green.png" alt=""/>
+ </j:if>
${%Installation Complete}
</h1>
diff --git a/hudson-core/src/main/resources/hudson/model/Executor/causeOfDeath.jelly b/hudson-core/src/main/resources/hudson/model/Executor/causeOfDeath.jelly
index 55a338a2..5dc10515 100644
--- a/hudson-core/src/main/resources/hudson/model/Executor/causeOfDeath.jelly
+++ b/hudson-core/src/main/resources/hudson/model/Executor/causeOfDeath.jelly
@@ -9,9 +9,8 @@
#
# Contributors:
#
-# Kohsuke Kawaguchi
+# Kohsuke Kawaguchi, Winston Prakash
#
-#
#************************************************************************** -->
@@ -28,7 +27,13 @@
<j:choose>
<j:when test="${it.alive}">
<h1>
- <img src="${imagesURL}/48x48/blue.png" width="48" height="48" alt=""/>
+ <j:if test="${app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/blue.png" width="48" height="48" alt=""/>
+ </j:if>
+ <j:if test="${!app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/green.png" width="48" height="48" alt=""/>
+ </j:if>
+
${%Thread is still alive}
</h1>
</j:when>
diff --git a/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly b/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly
index a0a92480..21d4f38d 100644
--- a/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly
+++ b/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly
@@ -111,6 +111,10 @@
<f:optionalBlock name="usageStatisticsCollected" checked="${it.usageStatisticsCollected}"
title="${%statsBlurb}"
help="/help/system-config/usage-statistics.html" />
+
+ <f:optionalBlock name="useBlueBall" checked="${it.useBlueBall()}"
+ title="${%useBlueBallBlurb}"
+ help="/help/system-config/use-blue-ball.html" />
<f:descriptorList title="${%Global properties}"
name="globalNodeProperties"
diff --git a/hudson-core/src/main/resources/hudson/model/Hudson/configure.properties b/hudson-core/src/main/resources/hudson/model/Hudson/configure.properties
index 710180b0..6ea5be86 100644
--- a/hudson-core/src/main/resources/hudson/model/Hudson/configure.properties
+++ b/hudson-core/src/main/resources/hudson/model/Hudson/configure.properties
@@ -18,6 +18,9 @@ slaves.description=\
List of slave nodes registered to this master Hudson. Jobs can be configured to \
execute on slave nodes to handle a large number of jobs.
+useBlueBallBlurb=\
+ Use blue ball as legend for success instead of green ball.
+
statsBlurb=\
Help make Hudson better by sending anonymous usage statistics and crash reports to the Hudson job.
diff --git a/hudson-core/src/main/resources/hudson/model/Hudson/legend.jelly b/hudson-core/src/main/resources/hudson/model/Hudson/legend.jelly
index 0809f13f..7270e254 100644
--- a/hudson-core/src/main/resources/hudson/model/Hudson/legend.jelly
+++ b/hudson-core/src/main/resources/hudson/model/Hudson/legend.jelly
@@ -9,9 +9,8 @@
#
# Contributors:
#
-# Kohsuke Kawaguchi, Seiji Sogabe,
+# Kohsuke Kawaguchi, Winston Prakash, Seiji Sogabe,
#
-#
#************************************************************************** -->
@@ -31,11 +30,21 @@
${%grey_anime}
</td></tr>
<tr><td>
- <img src="images/48x48/blue.png" alt=""/>
- ${%blue}
+ <j:if test="${app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/blue.png" alt=""/>
+ </j:if>
+ <j:if test="${!app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/green.png" alt=""/>
+ </j:if>
+ ${%blue}
</td></tr>
<tr><td>
- <img src="images/48x48/blue_anime.gif" alt=""/>
+ <j:if test="${app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/blue_anime.gif" alt=""/>
+ </j:if>
+ <j:if test="${!app.useBlueBall()}">
+ <img src="${imagesURL}/48x48/green_anime.gif" alt=""/>
+ </j:if>
${%blue_anime}
</td></tr>
<tr><td>
diff --git a/hudson-core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Success/status.jelly b/hudson-core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Success/status.jelly
index aa00ea83..d4017933 100644
--- a/hudson-core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Success/status.jelly
+++ b/hudson-core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Success/status.jelly
@@ -9,13 +9,18 @@
#
# Contributors:
#
-# Kohsuke Kawaguchi
+# Kohsuke Kawaguchi, Winston Prakash
#
-#
#************************************************************************** -->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
- <img src="${imagesURL}/24x24/blue.png" alt=""/> ${%Success}
+ <j:if test="${app.useBlueBall()}">
+ <img src="${imagesURL}/24x24/blue.png" alt=""/>
+ </j:if>
+ <j:if test="${!app.useBlueBall()}">
+ <img src="${imagesURL}/24x24/green.png" alt=""/>
+ </j:if>
+ ${%Success}
</j:jelly>
diff --git a/hudson-war/src/main/webapp/help/system-config/use-blue-ball.html b/hudson-war/src/main/webapp/help/system-config/use-blue-ball.html
new file mode 100644
index 00000000..62522d50
--- /dev/null
+++ b/hudson-war/src/main/webapp/help/system-config/use-blue-ball.html
@@ -0,0 +1,19 @@
+<!-- **************************************************************************
+#
+# Copyright (C) 2004-2009 Oracle Corporation
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Winston Prakash
+#
+#************************************************************************** -->
+
+<div>
+ By default Hudson uses green ball as a legend for build success etc.
+ Historically, Hudson was using Blue ball to denote success.
+ This options helps to restore to that historic blue ball for success.
+</div>
diff --git a/hudson-war/src/main/webapp/images/16x16/green_anime.gif b/hudson-war/src/main/webapp/images/16x16/green_anime.gif
new file mode 100644
index 00000000..a5fc96e4
--- /dev/null
+++ b/hudson-war/src/main/webapp/images/16x16/green_anime.gif
Binary files differ
diff --git a/hudson-war/src/main/webapp/images/24x24/green_anime.gif b/hudson-war/src/main/webapp/images/24x24/green_anime.gif
new file mode 100644
index 00000000..0f23c086
--- /dev/null
+++ b/hudson-war/src/main/webapp/images/24x24/green_anime.gif
Binary files differ
diff --git a/hudson-war/src/main/webapp/images/32x32/green_anime.gif b/hudson-war/src/main/webapp/images/32x32/green_anime.gif
new file mode 100644
index 00000000..62babbd2
--- /dev/null
+++ b/hudson-war/src/main/webapp/images/32x32/green_anime.gif
Binary files differ
diff --git a/hudson-war/src/main/webapp/images/48x48/green_anime.gif b/hudson-war/src/main/webapp/images/48x48/green_anime.gif
new file mode 100644
index 00000000..247f1c57
--- /dev/null
+++ b/hudson-war/src/main/webapp/images/48x48/green_anime.gif
Binary files differ

Back to the top