[Dive4elements-commits] [PATCH] flys/client: Exception catched and replaced by friendly warning (MINFO Sohlhoehendifferenz) #967/flys
Wald Commits
scm-commit at wald.intevation.org
Sun Nov 18 01:19:11 CET 2012
# HG changeset patch
# User Christian Lins <christian.lins at intevation.de>
# Date 1353197947 -3600
# Node ID 5e6e89f19a37a033b89d3ff60d814c1e7719a980
# Parent 1784ef23e29e1e0caba58419bd0fe137e4d75441
flys/client: Exception catched and replaced by friendly warning (MINFO Sohlhoehendifferenz) #967/flys.
diff -r 1784ef23e29e -r 5e6e89f19a37 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Sun Nov 18 01:19:07 2012 +0100
@@ -668,6 +668,8 @@
String warning_use_first_feature();
+ String warning_select_two_values();
+
String error_no_valid_gfi_url();
String error_gfi_req_failed();
diff -r 1784ef23e29e -r 5e6e89f19a37 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Sun Nov 18 01:19:07 2012 +0100
@@ -360,6 +360,7 @@
warning_use_first_feature = You have more that one object selected. The first one is used.
warning_no_wsp_selected = No waterlevel selected!
warning_cannot_parse_date = Invalid date!
+warning_select_two_values = Please select two values!
## map related strings
digitize = images/digitize.png
diff -r 1784ef23e29e -r 5e6e89f19a37 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Sun Nov 18 01:19:07 2012 +0100
@@ -361,6 +361,7 @@
warning_use_first_feature = Sie haben mehr als ein Objekt ausgew\u00e4hlt. Das erste Objekt wird benutzt.
warning_no_wsp_selected = Kein Wasserstand ausgew\u00e4hlt!
warning_cannot_parse_date = Datum ist ung\u00fcltig!
+warning_select_two_values = Bitte zwei Werte w\u00e4hlen!
## map related strings
digitize = images/digitize.png
diff -r 1784ef23e29e -r 5e6e89f19a37 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Sun Nov 18 01:19:07 2012 +0100
@@ -361,6 +361,7 @@
warning_use_first_feature = You have more that one object selected. The first one is used.
warning_no_wsp_selected = No waterlevel selected!
warning_cannot_parse_date = Date is invalid!
+warning_select_two_values = Please select two values!
## map related strings
digitize = images/digitize.png
diff -r 1784ef23e29e -r 5e6e89f19a37 flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePairWidget.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePairWidget.java Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePairWidget.java Sun Nov 18 01:19:07 2012 +0100
@@ -2,21 +2,18 @@
import com.google.gwt.core.client.GWT;
+import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Button;
-
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.layout.HLayout;
-
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.ClickEvent;
-
-import com.smartgwt.client.widgets.grid.ListGrid;
-
-import de.intevation.flys.client.shared.model.Artifact;
-import de.intevation.flys.client.shared.model.User;
-import de.intevation.flys.client.shared.model.ToLoad;
import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.shared.model.Artifact;
+import de.intevation.flys.client.shared.model.ToLoad;
+import de.intevation.flys.client.shared.model.User;
/**
@@ -95,8 +92,10 @@
ToLoad toLoad1 = firstDatacageWidget.getSelection();
ToLoad toLoad2 = secondDatacageWidget.getSelection();
- // TODO further sanitize (toRecommendations.length)
- if (toLoad1 == null || toLoad2 == null) {
+ if (toLoad1 == null || toLoad2 == null ||
+ toLoad1.toRecommendations().isEmpty() ||
+ toLoad2.toRecommendations().isEmpty()) {
+ SC.say(MSG.warning_select_two_values());
return;
}
More information about the Dive4elements-commits
mailing list