mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-04 10:09:42 +00:00
fixed locale selection in autoplay mode
This commit is contained in:
1 parent
1d4a5a2dc0
commit
2632613c89
1 file changed
+7
-1
+7
-1
@@ -65,10 +65,16 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
eventSelectionBox = new ListBox(false);
|
||||
leaderboardSelectionBox = new ListBox(false);
|
||||
localeSelectionBox = new ListBox(false);
|
||||
LocaleInfo currentLocale = LocaleInfo.getCurrentLocale();
|
||||
int i = 0;
|
||||
for (String localeName : LocaleInfo.getAvailableLocaleNames()) {
|
||||
if(!localeName.equals("default")) {
|
||||
String displayName = LocaleInfo.getLocaleNativeDisplayName(localeName);
|
||||
localeSelectionBox.addItem(displayName);
|
||||
if(currentLocale.getLocaleName().equals(localeName)) {
|
||||
localeSelectionBox.setSelectedIndex(i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +161,7 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
private String getSelectedLocale() {
|
||||
String result = null;
|
||||
int selectedIndex = localeSelectionBox.getSelectedIndex();
|
||||
if(selectedIndex > 0) {
|
||||
if(selectedIndex >= 0) {
|
||||
String selectedLocale = localeSelectionBox.getItemText(selectedIndex);
|
||||
for (String localeName : LocaleInfo.getAvailableLocaleNames()) {
|
||||
if(!localeName.equals("default")) {
|
||||
|
||||
Reference in new issue
Block a user