- case R.id.select_rate:
- // Set the TBT baud rate
-
- final String[] rates = {
- "38400",
- "9600",
- "2400",
- };
-
- AlertDialog.Builder builder_rate = new AlertDialog.Builder(this);
- builder_rate.setTitle("Pick a baud rate");
- builder_rate.setItems(rates,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int item) {
- setBaud(rates[item]);
- }
- });
- AlertDialog alert_rate = builder_rate.create();
- alert_rate.show();
- return true;
- case R.id.change_units:
- boolean imperial = AltosPreferences.imperial_units();
- AltosPreferences.set_imperial_units(!imperial);
- return true;
- case R.id.preload_maps:
- serverIntent = new Intent(this, PreloadMapActivity.class);
- startActivityForResult(serverIntent, REQUEST_PRELOAD_MAPS);
- return true;
- case R.id.map_type:
- serverIntent = new Intent(this, MapTypeActivity.class);
- startActivityForResult(serverIntent, REQUEST_MAP_TYPE);
- return true;
- case R.id.map_source:
- int source = AltosDroidPreferences.map_source();
- int new_source = source == AltosDroidPreferences.MAP_SOURCE_ONLINE ? AltosDroidPreferences.MAP_SOURCE_OFFLINE : AltosDroidPreferences.MAP_SOURCE_ONLINE;
- AltosDroidPreferences.set_map_source(new_source);
- set_map_source(new_source);
- return true;