diff options
author | Parménides GV <parmegv@sdf.org> | 2013-03-18 12:00:47 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-03-18 12:00:47 +0100 |
commit | 1fcb255170a2be35eecc5645a7b1757101b844f6 (patch) | |
tree | e63e2c2760b55a92676516a70aef066efc50f6fa /src/se/leap/leapclient/ConfigurationWizard.java | |
parent | f4f454d53b881563d82f392545fb17ef9283c5e3 (diff) |
Refactored ProviderAPI code.
ConfigurationWizard works without problem for both new and preseeded
providers. I've added flow control for the activity to finish when all
files have been downloaded, managing errors with
setResult(RESULT_CANCELED).
Diffstat (limited to 'src/se/leap/leapclient/ConfigurationWizard.java')
-rw-r--r-- | src/se/leap/leapclient/ConfigurationWizard.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/se/leap/leapclient/ConfigurationWizard.java b/src/se/leap/leapclient/ConfigurationWizard.java index 69e13f19..90e74e51 100644 --- a/src/se/leap/leapclient/ConfigurationWizard.java +++ b/src/se/leap/leapclient/ConfigurationWizard.java @@ -126,18 +126,12 @@ public class ConfigurationWizard extends Activity try {
saveProviderJson(current_provider_item);
downloadJSONFiles(current_provider_item);
-
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
-
- // FIXME!! We're going to have more Fragments and listeners, flow control?
- // TODO There is no testing done to know if we're okay...
- setResult(RESULT_OK);
- finish();
}
}
@@ -214,5 +208,13 @@ public class ConfigurationWizard extends Activity .replace(R.id.configuration_wizard_layout, providerList, "providerlist")
.commit();
}
+ else if(resultCode == ConfigHelper.CORRECTLY_DOWNLOADED_JSON_FILES) {
+ setResult(RESULT_OK);
+ finish();
+ }
+ else if(resultCode == ConfigHelper.INCORRECTLY_DOWNLOADED_JSON_FILES) {
+ setResult(RESULT_CANCELED);
+ finish();
+ }
}
}
|