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

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

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

revision 560 by torben, Tue Oct 6 09:42:10 2009 UTC revision 561 by torben, Thu Jan 28 08:55:19 2010 UTC
# Line 17  import android.widget.TextView; Line 17  import android.widget.TextView;
17  import dk.thoerup.traininfo.provider.ProviderFactory;  import dk.thoerup.traininfo.provider.ProviderFactory;
18  import dk.thoerup.traininfo.provider.TimetableProvider;  import dk.thoerup.traininfo.provider.TimetableProvider;
19  import dk.thoerup.traininfo.util.MessageBox;  import dk.thoerup.traininfo.util.MessageBox;
20    import static dk.thoerup.traininfo.R.string.*;
21    
22  public class TimetableList extends Activity {  public class TimetableList extends Activity {
23                    
# Line 97  public class TimetableList extends Activ Line 98  public class TimetableList extends Activ
98          protected Dialog onCreateDialog(int id) {          protected Dialog onCreateDialog(int id) {
99                  switch (id) {                  switch (id) {
100                  case DLG_PROGRESS:                  case DLG_PROGRESS:
101                          ProgressDialog dlg = new ProgressDialog(this);                          ProgressDialog dlg = new ProgressDialog(this);                  
102                          dlg.setMessage("Fetch timetable data");                          dlg.setMessage( getString(timetablelist_fetchdata) );
103                          dlg.setCancelable(true);                          dlg.setCancelable(true);
104                          return dlg;                                              return dlg;                    
105                  default:                  default:
# Line 125  public class TimetableList extends Activ Line 126  public class TimetableList extends Activ
126                          if (success) {                          if (success) {
127                                  adapter.setTimetable(timetables);                                  adapter.setTimetable(timetables);
128                                  if (timetables.size() == 0) {                                  if (timetables.size() == 0) {
129                                          MessageBox.showMessage(TimetableList.this, "No timetable found");                                          MessageBox.showMessage(TimetableList.this, getString(timetablelist_nodata));
130                                  }                                  }
131                          } else { // communication or parse error                          } else { // communication or parse error
132                                  AlertDialog.Builder builder = new AlertDialog.Builder(TimetableList.this);                                                                                AlertDialog.Builder builder = new AlertDialog.Builder(TimetableList.this);                                              
133                                  builder.setMessage("Error finding departures");                                  builder.setMessage(getString(timetablelist_fetcherror));
134                                  builder.setCancelable(true);                                  builder.setCancelable(true);
135                                  builder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {                                  builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() {
136                                          public void onClick(DialogInterface dialog, int id) {                                          public void onClick(DialogInterface dialog, int id) {
137                                                  dialog.dismiss();                                                  dialog.dismiss();
138                                                  startTimetableFetcher();                                                  startTimetableFetcher();
139                                                                                                    
140                                          }                                          }
141                                  });                                  });
142                                  builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {                                  builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {
143                                          public void onClick(DialogInterface dialog, int id) {                                          public void onClick(DialogInterface dialog, int id) {
144                                                  dialog.dismiss();                                                  dialog.dismiss();
145                                          }                                                                                                }                                                      

Legend:
Removed from v.560  
changed lines
  Added in v.561

  ViewVC Help
Powered by ViewVC 1.1.20