aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/controller/SettingsController.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-02-20 23:58:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-02-20 23:58:19 +1300
commitb26e487f3c65808d349c7a53c0ea2a3981b61bac (patch)
tree57873f966be2953f3cb6b6f518cd44ea1adf720c /src/org/traccar/web/client/controller/SettingsController.java
parent6801698dfc9c99b34d7ed081ebcfbec4a8853868 (diff)
downloadtrackermap-web-b26e487f3c65808d349c7a53c0ea2a3981b61bac.tar.gz
trackermap-web-b26e487f3c65808d349c7a53c0ea2a3981b61bac.tar.bz2
trackermap-web-b26e487f3c65808d349c7a53c0ea2a3981b61bac.zip
Add user preferences
Diffstat (limited to 'src/org/traccar/web/client/controller/SettingsController.java')
-rw-r--r--src/org/traccar/web/client/controller/SettingsController.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/org/traccar/web/client/controller/SettingsController.java b/src/org/traccar/web/client/controller/SettingsController.java
index c369cbb1..a1892ae2 100644
--- a/src/org/traccar/web/client/controller/SettingsController.java
+++ b/src/org/traccar/web/client/controller/SettingsController.java
@@ -21,8 +21,10 @@ import org.traccar.web.client.model.BaseAsyncCallback;
import org.traccar.web.client.view.ApplicationSettingsDialog;
import org.traccar.web.client.view.DeviceView;
import org.traccar.web.client.view.UserDialog;
+import org.traccar.web.client.view.UserSettingsDialog;
import org.traccar.web.shared.model.ApplicationSettings;
import org.traccar.web.shared.model.User;
+import org.traccar.web.shared.model.UserSettings;
public class SettingsController implements DeviceView.SettingsHandler {
@@ -45,8 +47,21 @@ public class SettingsController implements DeviceView.SettingsHandler {
@Override
public void onPreferencesSelected() {
- // TODO Auto-generated method stub
-
+ new UserSettingsDialog(
+ ApplicationContext.getInstance().getUserSettings(),
+ new UserSettingsDialog.UserSettingsHandler() {
+ @Override
+ public void onSave(UserSettings userSettings) {
+ ApplicationContext.getInstance().setUserSettings(userSettings);
+ User user = ApplicationContext.getInstance().getUser();
+ Application.getDataService().updateUser(user, new BaseAsyncCallback<User>() {
+ @Override
+ public void onSuccess(User result) {
+ ApplicationContext.getInstance().setUser(result);
+ }
+ });
+ }
+ }).show();
}
@Override