local_index_mi_delete (3)

This commit is contained in:
sonora 2015-03-08 17:03:22 +01:00
parent 6b673c431f
commit 7d30b00a77
3 changed files with 9 additions and 10 deletions

View file

@ -1636,7 +1636,6 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="local_index_descr_title">Manage map files</string> <string name="local_index_descr_title">Manage map files</string>
<string name="local_index_mi_restore">Activate</string> <string name="local_index_mi_restore">Activate</string>
<string name="local_index_mi_backup">Deactivate</string> <string name="local_index_mi_backup">Deactivate</string>
<string name="local_index_mi_delete">Delete</string>
<string name="local_index_mi_reload">Reload from sdcard</string> <string name="local_index_mi_reload">Reload from sdcard</string>
<string name="local_index_download">Download</string> <string name="local_index_download">Download</string>
<string name="local_index_poi_data">POI data</string> <string name="local_index_poi_data">POI data</string>

View file

@ -202,7 +202,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
adapter.item(R.string.local_index_mi_restore).listen(listener).position(2).reg(); adapter.item(R.string.local_index_mi_restore).listen(listener).position(2).reg();
} }
adapter.item(R.string.shared_string_rename).listen(listener).position(3).reg(); adapter.item(R.string.shared_string_rename).listen(listener).position(3).reg();
adapter.item(R.string.local_index_mi_delete).listen(listener).position(4).reg(); adapter.item(R.string.shared_string_delete).listen(listener).position(4).reg();
} }
private boolean performBasicOperation(int resId, final LocalIndexInfo info) { private boolean performBasicOperation(int resId, final LocalIndexInfo info) {
@ -216,7 +216,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
}); });
} else if (resId == R.string.local_index_mi_restore) { } else if (resId == R.string.local_index_mi_restore) {
new LocalIndexOperationTask(RESTORE_OPERATION).execute(info); new LocalIndexOperationTask(RESTORE_OPERATION).execute(info);
} else if (resId == R.string.local_index_mi_delete) { } else if (resId == R.string.shared_string_delete) {
Builder confirm = new Builder(getActivity()); Builder confirm = new Builder(getActivity());
confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() { confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override @Override
@ -506,7 +506,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
optionsMenuAdapter.item(R.string.local_index_mi_reload) optionsMenuAdapter.item(R.string.local_index_mi_reload)
.icon(R.drawable.ic_action_refresh_dark) .icon(R.drawable.ic_action_refresh_dark)
.listen(listener).position(1).reg(); .listen(listener).position(1).reg();
optionsMenuAdapter.item(R.string.local_index_mi_delete) optionsMenuAdapter.item(R.string.shared_string_delete)
.icon(R.drawable.ic_action_delete_dark) .icon(R.drawable.ic_action_delete_dark)
.listen(listener).position(2).reg(); .listen(listener).position(2).reg();
optionsMenuAdapter.item(R.string.local_index_mi_backup) optionsMenuAdapter.item(R.string.local_index_mi_backup)
@ -560,7 +560,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
public void doAction(int actionResId){ public void doAction(int actionResId){
if(actionResId == R.string.local_index_mi_backup){ if(actionResId == R.string.local_index_mi_backup){
operationTask = new LocalIndexOperationTask(BACKUP_OPERATION); operationTask = new LocalIndexOperationTask(BACKUP_OPERATION);
} else if(actionResId == R.string.local_index_mi_delete){ } else if(actionResId == R.string.shared_string_delete){
operationTask = new LocalIndexOperationTask(DELETE_OPERATION); operationTask = new LocalIndexOperationTask(DELETE_OPERATION);
} else if(actionResId == R.string.local_index_mi_restore){ } else if(actionResId == R.string.local_index_mi_restore){
operationTask = new LocalIndexOperationTask(RESTORE_OPERATION); operationTask = new LocalIndexOperationTask(RESTORE_OPERATION);
@ -673,7 +673,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
public void localOptionsMenu(final int itemId) { public void localOptionsMenu(final int itemId) {
if (itemId == R.string.local_index_mi_reload) { if (itemId == R.string.local_index_mi_reload) {
reloadIndexes(); reloadIndexes();
} else if (itemId == R.string.local_index_mi_delete) { } else if (itemId == R.string.shared_string_delete) {
openSelectionMode(itemId, R.drawable.ic_action_delete_dark, openSelectionMode(itemId, R.drawable.ic_action_delete_dark,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@ -1144,7 +1144,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
performBasicOperation(R.string.local_index_mi_delete, info); performBasicOperation(R.string.shared_string_delete, info);
return true; return true;
} }
}); });

View file

@ -331,7 +331,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
asyncLoader.execute(getActivity()); asyncLoader.execute(getActivity());
} else if (itemId == R.string.show_gpx_route) { } else if (itemId == R.string.show_gpx_route) {
openShowOnMapMode(); openShowOnMapMode();
} else if (itemId == R.string.local_index_mi_delete) { } else if (itemId == R.string.shared_string_delete) {
openSelectionMode(itemId, R.drawable.ic_action_delete_dark, R.drawable.ic_action_delete_dark, openSelectionMode(itemId, R.drawable.ic_action_delete_dark, R.drawable.ic_action_delete_dark,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@ -346,7 +346,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}; };
optionsMenuAdapter.item(R.string.show_gpx_route).icons(R.drawable.ic_show_on_map, R.drawable.ic_show_on_map) optionsMenuAdapter.item(R.string.show_gpx_route).icons(R.drawable.ic_show_on_map, R.drawable.ic_show_on_map)
.listen(listener).reg(); .listen(listener).reg();
optionsMenuAdapter.item(R.string.local_index_mi_delete) optionsMenuAdapter.item(R.string.shared_string_delete)
.icons(R.drawable.ic_action_delete_dark, R.drawable.ic_action_delete_dark).listen(listener).reg(); .icons(R.drawable.ic_action_delete_dark, R.drawable.ic_action_delete_dark).listen(listener).reg();
optionsMenuAdapter.item(R.string.local_index_mi_reload) optionsMenuAdapter.item(R.string.local_index_mi_reload)
.icons(R.drawable.ic_action_refresh_dark, R.drawable.ic_action_refresh_dark).listen(listener).reg(); .icons(R.drawable.ic_action_refresh_dark, R.drawable.ic_action_refresh_dark).listen(listener).reg();
@ -372,7 +372,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
} }
public void doAction(int actionResId) { public void doAction(int actionResId) {
if (actionResId == R.string.local_index_mi_delete) { if (actionResId == R.string.shared_string_delete) {
operationTask = new DeleteGpxTask(); operationTask = new DeleteGpxTask();
operationTask.execute(selectedItems.toArray(new GpxInfo[selectedItems.size()])); operationTask.execute(selectedItems.toArray(new GpxInfo[selectedItems.size()]));
} else { } else {