/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/StationList.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/StationList.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1447 by torben, Thu May 5 05:00:30 2011 UTC revision 1486 by torben, Sat May 28 17:39:31 2011 UTC
# Line 73  public class StationList extends ListAct Line 73  public class StationList extends ListAct
73    
74                    
75                    
76          public static final int OPTIONS_MAP = 1003;          public static final int OPTIONS_MAP = 103;
77          public static final int OPTIONS_GPSINFO = 1004;          public static final int OPTIONS_GPSINFO = 104;
78                    
79          public static final int DLG_PROGRESS = 3001;          public static final int DLG_PROGRESS = 3001;
80          public static final int DLG_STATIONNAME = 3002;          public static final int DLG_STATIONNAME = 3002;
# Line 231  public class StationList extends ListAct Line 231  public class StationList extends ListAct
231                  item.setIcon(android.R.drawable.ic_menu_mapmode);                  item.setIcon(android.R.drawable.ic_menu_mapmode);
232                                    
233                  item = menu.add(0, OPTIONS_GPSINFO, 0, getString(stationlist_gpsinfo));                  item = menu.add(0, OPTIONS_GPSINFO, 0, getString(stationlist_gpsinfo));
234                  item.setIcon(android.R.drawable.ic_menu_mapmode);                  item.setIcon(android.R.drawable.ic_menu_info_details);
235                  boolean hasLoc = (locationLookup.getLocation() != null);                  boolean hasLoc = (locationLookup.getLocation() != null);
236                  item.setEnabled(hasLoc);                  item.setEnabled(hasLoc);
237                                    
# Line 245  public class StationList extends ListAct Line 245  public class StationList extends ListAct
245          public boolean onOptionsItemSelected(MenuItem item) {          public boolean onOptionsItemSelected(MenuItem item) {
246                  boolean retval = true;                  boolean retval = true;
247    
248                  //TODO: Cleanup  
249                  switch (item.getItemId()) {                  switch (item.getItemId()) {
250                  case OPTIONS_MAP:                  case OPTIONS_MAP:
251                                                    
252                            if ( stations == null || stations.entries == null || stations.entries.size() == 0 ) {
253                                    Toast.makeText(this, "No stations to show on map", Toast.LENGTH_SHORT).show(); //TODO: Translate
254                                    return true;
255                            }
256                            
257                          Intent intent = new Intent(this,StationMapView.class);                          Intent intent = new Intent(this,StationMapView.class);
258                                                    
259                          ArrayList<GeoPair> stationPoints = new ArrayList<GeoPair>();                          ArrayList<GeoPair> stationPoints = new ArrayList<GeoPair>();

Legend:
Removed from v.1447  
changed lines
  Added in v.1486

  ViewVC Help
Powered by ViewVC 1.1.20