From 4394729cd410c79d05f401ecaa9e15cf7e0354a0 Mon Sep 17 00:00:00 2001 From: Vitaly Litvak Date: Wed, 20 May 2015 11:35:02 +0300 Subject: [PATCH] For #85 - display current marker with 'Select...' button in device dialog --- .../org/traccar/web/client/i18n/Messages.java | 2 ++ .../traccar/web/client/view/DeviceDialog.java | 7 ++++++ .../web/client/view/DeviceDialog.ui.xml | 24 ++++++++++++++++++- .../web/client/i18n/Messages.properties | 1 + .../web/client/i18n/Messages_ru.properties | 1 + 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/web/client/i18n/Messages.java b/src/main/java/org/traccar/web/client/i18n/Messages.java index 0ed2fafe..2e1fdf08 100644 --- a/src/main/java/org/traccar/web/client/i18n/Messages.java +++ b/src/main/java/org/traccar/web/client/i18n/Messages.java @@ -307,4 +307,6 @@ String defaultNotificationTemplate(@Select DeviceEventType type, @Optional String positionTime); String noMarkers(); + + String select(); } diff --git a/src/main/java/org/traccar/web/client/view/DeviceDialog.java b/src/main/java/org/traccar/web/client/view/DeviceDialog.java index 135e75fb..79f7cb27 100644 --- a/src/main/java/org/traccar/web/client/view/DeviceDialog.java +++ b/src/main/java/org/traccar/web/client/view/DeviceDialog.java @@ -16,6 +16,7 @@ package org.traccar.web.client.view; import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.VerticalPanel; import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.ToggleGroup; @@ -40,6 +41,7 @@ import com.sencha.gxt.widget.core.client.form.TextField; import org.traccar.web.shared.model.DeviceIconType; import org.traccar.web.shared.model.Position; +import org.traccar.web.shared.model.PositionIconType; public class DeviceDialog implements Editor { @@ -83,10 +85,15 @@ public interface DeviceHandler { @UiField NumberField idleSpeedThreshold; + @UiField(provided = true) + final Image markerImage; + ToggleGroup iconRadioGroup = new ToggleGroup(); public DeviceDialog(Device device, DeviceHandler deviceHandler) { this.deviceHandler = deviceHandler; + markerImage = new Image(device.getIconType().getPositionIconType(Position.Status.OFFLINE).getURL(false)); + uiBinder.createAndBindUi(this); timeout.addValidator(new MinNumberValidator(1)); diff --git a/src/main/java/org/traccar/web/client/view/DeviceDialog.ui.xml b/src/main/java/org/traccar/web/client/view/DeviceDialog.ui.xml index 299e63c8..4b229823 100644 --- a/src/main/java/org/traccar/web/client/view/DeviceDialog.ui.xml +++ b/src/main/java/org/traccar/web/client/view/DeviceDialog.ui.xml @@ -11,6 +11,14 @@ + + + + + + + + @@ -58,11 +66,25 @@ + + + + + + + + + + + + + + - + diff --git a/src/main/resources/org/traccar/web/client/i18n/Messages.properties b/src/main/resources/org/traccar/web/client/i18n/Messages.properties index 903a2dad..09debd48 100644 --- a/src/main/resources/org/traccar/web/client/i18n/Messages.properties +++ b/src/main/resources/org/traccar/web/client/i18n/Messages.properties @@ -51,6 +51,7 @@ power = Power uniqueIdentifier = Unique Identifier deviceTimeout = Timeout idleWhenSpeedIsLE = Idle when speed is <= +select = Select # device view objects = Objects devices = Devices diff --git a/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties b/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties index 6d274a94..5bb517a1 100644 --- a/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties +++ b/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties @@ -51,6 +51,7 @@ power=Заряд uniqueIdentifier = Уникальный Код deviceTimeout = Таймаут idleWhenSpeedIsLE = Стоит если скорость <= +select = Выбрать # device view objects = Объекты devices = Устройства