aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/view/DeviceView.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-02-25 21:06:38 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-02-25 21:06:38 +1300
commitebcedc38812405ba1cd03c518317bcf0cd52f925 (patch)
tree2df884c0127218b1205bb5861ff7a048d6a54bff /src/org/traccar/web/client/view/DeviceView.java
parentb26e487f3c65808d349c7a53c0ea2a3981b61bac (diff)
downloadtrackermap-web-ebcedc38812405ba1cd03c518317bcf0cd52f925.tar.gz
trackermap-web-ebcedc38812405ba1cd03c518317bcf0cd52f925.tar.bz2
trackermap-web-ebcedc38812405ba1cd03c518317bcf0cd52f925.zip
Added user management
Diffstat (limited to 'src/org/traccar/web/client/view/DeviceView.java')
-rw-r--r--src/org/traccar/web/client/view/DeviceView.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/org/traccar/web/client/view/DeviceView.java b/src/org/traccar/web/client/view/DeviceView.java
index 341b5083..21d906c8 100644
--- a/src/org/traccar/web/client/view/DeviceView.java
+++ b/src/org/traccar/web/client/view/DeviceView.java
@@ -19,6 +19,7 @@ import java.util.LinkedList;
import java.util.List;
import org.traccar.web.client.Application;
+import org.traccar.web.client.ApplicationContext;
import org.traccar.web.client.model.BaseAsyncCallback;
import org.traccar.web.client.model.DeviceProperties;
import org.traccar.web.shared.model.Device;
@@ -39,6 +40,7 @@ import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid;
import com.sencha.gxt.widget.core.client.menu.Item;
+import com.sencha.gxt.widget.core.client.menu.MenuItem;
import com.sencha.gxt.widget.core.client.selection.SelectionChangedEvent;
public class DeviceView implements SelectionChangedEvent.SelectionChangedHandler<Device> {
@@ -82,6 +84,12 @@ public class DeviceView implements SelectionChangedEvent.SelectionChangedHandler
@UiField
Grid<Device> grid;
+ @UiField
+ MenuItem settingsUsers;
+
+ @UiField
+ MenuItem settingsGlobal;
+
public DeviceView(DeviceHandler deviceHandler, SettingsHandler settingsHandler, ListStore<Device> deviceStore) {
this.deviceHandler = deviceHandler;
this.settingsHandler = settingsHandler;
@@ -98,6 +106,11 @@ public class DeviceView implements SelectionChangedEvent.SelectionChangedHandler
grid.getSelectionModel().addSelectionChangedHandler(this);
grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
+
+ if (ApplicationContext.getInstance().getUser().getAdmin()) {
+ settingsUsers.enable();
+ settingsGlobal.enable();
+ }
}
@Override
@@ -155,17 +168,17 @@ public class DeviceView implements SelectionChangedEvent.SelectionChangedHandler
settingsHandler.onAccountSelected();
}
- @UiHandler("preferencesAccount")
+ @UiHandler("settingsPreferences")
public void onSettingsPreferencesSelected(SelectionEvent<Item> event) {
settingsHandler.onPreferencesSelected();
}
- @UiHandler("usersAccount")
+ @UiHandler("settingsUsers")
public void onSettingsUsersSelected(SelectionEvent<Item> event) {
settingsHandler.onUsersSelected();
}
- @UiHandler("globalAccount")
+ @UiHandler("settingsGlobal")
public void onSettingsGlobalSelected(SelectionEvent<Item> event) {
settingsHandler.onApplicationSelected();
}