diff options
-rw-r--r-- | .classpath | 2 | ||||
-rw-r--r-- | src/org/traccar/web/client/controller/DeviceController.java | 16 | ||||
-rw-r--r-- | src/org/traccar/web/client/controller/SettingsController.java | 15 |
3 files changed, 18 insertions, 15 deletions
@@ -3,7 +3,7 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="lib/gxt-3.0.1.jar"/> + <classpathentry kind="lib" path="lib/gxt.jar"/> <classpathentry kind="lib" path="lib/gwt-openlayers-client-0.9.jar"/> <classpathentry kind="lib" path="war/WEB-INF/lib/hibernate-core-4.1.10.Final.jar"/> <classpathentry kind="lib" path="war/WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/> diff --git a/src/org/traccar/web/client/controller/DeviceController.java b/src/org/traccar/web/client/controller/DeviceController.java index e9940aa2..69edfeec 100644 --- a/src/org/traccar/web/client/controller/DeviceController.java +++ b/src/org/traccar/web/client/controller/DeviceController.java @@ -23,6 +23,7 @@ import org.traccar.web.client.model.DeviceProperties; import org.traccar.web.client.view.DeviceDialog; import org.traccar.web.client.view.DeviceView; import org.traccar.web.shared.model.Device; +import org.traccar.web.shared.model.User; import com.google.gwt.core.client.GWT; import com.sencha.gxt.data.shared.ListStore; @@ -30,6 +31,7 @@ import com.sencha.gxt.widget.core.client.ContentPanel; import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton; import com.sencha.gxt.widget.core.client.box.AlertMessageBox; import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox; +import com.sencha.gxt.widget.core.client.event.DialogHideEvent; import com.sencha.gxt.widget.core.client.event.HideEvent; public class DeviceController implements ContentController, DeviceView.DeviceHandler { @@ -116,19 +118,19 @@ public class DeviceController implements ContentController, DeviceView.DeviceHan @Override public void onRemove(final Device device) { final ConfirmMessageBox dialog = new ConfirmMessageBox("Confirm", "Are you sure you want remove device?"); - dialog.addHideHandler(new HideEvent.HideHandler() { - @Override - public void onHide(HideEvent event) { - if (dialog.getHideButton() == dialog.getButtonById(PredefinedButton.YES.name())) { + dialog.addDialogHideHandler(new DialogHideEvent.DialogHideHandler() { + @Override + public void onDialogHide(DialogHideEvent event) { + if (event.getHideButton() == PredefinedButton.YES) { Application.getDataService().removeDevice(device, new BaseAsyncCallback<Device>() { @Override public void onSuccess(Device result) { deviceStore.remove(device); } }); - } - } - }); + } + } + }); dialog.show(); } diff --git a/src/org/traccar/web/client/controller/SettingsController.java b/src/org/traccar/web/client/controller/SettingsController.java index 44d48f3d..c0e89047 100644 --- a/src/org/traccar/web/client/controller/SettingsController.java +++ b/src/org/traccar/web/client/controller/SettingsController.java @@ -35,6 +35,7 @@ import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton; import com.sencha.gxt.widget.core.client.box.AlertMessageBox; import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox; +import com.sencha.gxt.widget.core.client.event.DialogHideEvent; import com.sencha.gxt.widget.core.client.event.HideEvent; public class SettingsController implements DeviceView.SettingsHandler { @@ -110,19 +111,19 @@ public class SettingsController implements DeviceView.SettingsHandler { @Override public void onRemove(final User user) { final ConfirmMessageBox dialog = new ConfirmMessageBox("Confirm", "Are you sure you want remove user?"); - dialog.addHideHandler(new HideEvent.HideHandler() { - @Override - public void onHide(HideEvent event) { - if (dialog.getHideButton() == dialog.getButtonById(PredefinedButton.YES.name())) { + dialog.addDialogHideHandler(new DialogHideEvent.DialogHideHandler() { + @Override + public void onDialogHide(DialogHideEvent event) { + if (event.getHideButton() == PredefinedButton.YES) { Application.getDataService().removeUser(user, new BaseAsyncCallback<User>() { @Override public void onSuccess(User result) { userStore.remove(user); } }); - } - } - }); + } + } + }); dialog.show(); } |