From d342a418e71d243735e8458d8681f05b7070fffc Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 17 Apr 2012 15:53:27 +0200 Subject: [PATCH] Locales drop-down: Show that we use English by default. * src/main/java/org/glom/web/client/activity/TableSelectionActivity.java: fillView(): When we use English, just because that is the default, when no locale is specified, show that in the Locales drop-down instead of just showing the first item. --- ChangeLog | 9 +++++++++ .../glom/web/client/activity/TableSelectionActivity.java | 13 +++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c7dfe2..2a4aa7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2012-04-17 Murray Cumming + Locales drop-down: Show that we use English by default. + + * src/main/java/org/glom/web/client/activity/TableSelectionActivity.java: + fillView(): When we use English, just because that is the default, when + no locale is specified, show that in the Locales drop-down instead of + just showing the first item. + +2012-04-17 Murray Cumming + Unselect the Report/Locale/Table combo item when appropriate. * src/main/java/org/glom/web/client/activity/TableSelectionActivity.java: diff --git a/src/main/java/org/glom/web/client/activity/TableSelectionActivity.java b/src/main/java/org/glom/web/client/activity/TableSelectionActivity.java index c06f528..d32767c 100644 --- a/src/main/java/org/glom/web/client/activity/TableSelectionActivity.java +++ b/src/main/java/org/glom/web/client/activity/TableSelectionActivity.java @@ -169,14 +169,23 @@ public class TableSelectionActivity extends AbstractActivity implements View.Pre tableSelectionView.setLocaleList(result.getLocaleIDs(), result.getLocaleTitles()); - final String localeID = Utils.getCurrentLocaleID(); - tableSelectionView.setSelectedLocale(localeID); + //Show what locale is currently being used: + String localeIDForCombo = Utils.getCurrentLocaleID(); + + //Indicate that we use English if no other locale has been specified by either + //the URL or the configuration. + //Alternatively we could also show the locale in the URL, even if it is en. + if(StringUtils.isEmpty(localeIDForCombo)) { + localeIDForCombo = "en"; + } + tableSelectionView.setSelectedLocale(localeIDForCombo); documentTitle = result.getTitle(); tableSelectionView.setDocumentTitle(documentTitle); Window.setTitle(documentTitle + ": " + tableSelectionView.getSelectedTableTitle()); } }; + final String localeID = Utils.getCurrentLocaleID(); OnlineGlomServiceAsync.Util.getInstance().getDocumentInfo(documentID, localeID, callback); -- 2.1.4