diff options
author | Parménides GV <parmegv@sdf.org> | 2013-11-07 10:43:03 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-12-10 18:16:07 +0100 |
commit | 0bcf72490f726825121e355afbeaf5b14636eb4d (patch) | |
tree | 26ede1c88c45a60a8b36c44b745649edd077f1d0 /src/se/leap/bitmaskclient/ConfigurationWizard.java | |
parent | e89dc12bb93da0a638d9a199af4d91a54aa3556e (diff) |
Retry button on failed downloads.
Next step: remove the provider from the list (big security hole, since all providers present on the list are assumed to be secure).
Diffstat (limited to 'src/se/leap/bitmaskclient/ConfigurationWizard.java')
-rw-r--r-- | src/se/leap/bitmaskclient/ConfigurationWizard.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/se/leap/bitmaskclient/ConfigurationWizard.java b/src/se/leap/bitmaskclient/ConfigurationWizard.java index 0cdd4561..f4409056 100644 --- a/src/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/src/se/leap/bitmaskclient/ConfigurationWizard.java @@ -25,6 +25,11 @@ import org.json.JSONObject; import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.ProviderAPIResultReceiver.Receiver;
import se.leap.bitmaskclient.ProviderListContent.ProviderItem;
+ +import se.leap.bitmaskclient.DownloadFailedDialog.DownloadFailedDialogInterface; +import se.leap.bitmaskclient.NewProviderDialog.NewProviderDialogInterface; +import se.leap.bitmaskclient.ProviderDetailFragment.ProviderDetailFragmentInterface; + import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
@@ -61,7 +66,7 @@ import android.widget.TextView; *
*/
public class ConfigurationWizard extends Activity
-implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogInterface, ProviderDetailFragment.ProviderDetailFragmentInterface, Receiver {
+implements ProviderListFragment.Callbacks, NewProviderDialogInterface, ProviderDetailFragmentInterface, DownloadFailedDialogInterface, Receiver {
private ProgressBar mProgressBar;
private TextView progressbar_description;
@@ -192,7 +197,11 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn startProgressBar(provider_index+1); provider_list_fragment.hideAllBut(provider_index); - setUpProvider(selected_provider.providerMainUrl(), true); + + boolean danger_on = true; + if(ConfigHelper.sharedPrefContainsKey(ProviderItem.DANGER_ON)) + danger_on = ConfigHelper.getBoolFromSharedPref(ProviderItem.DANGER_ON); + setUpProvider(selected_provider.providerMainUrl(), danger_on); }
@Override
@@ -394,6 +403,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn }
private void autoSelectProvider(String provider_main_url, boolean danger_on) {
+ ConfigHelper.saveSharedPref(ProviderItem.DANGER_ON, danger_on);
onItemSelected(getId(provider_main_url));
}
@@ -415,7 +425,16 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn startService(provider_API_command);
}
-
+ + public void retrySetUpProvider() { + Intent provider_API_command = new Intent(this, ProviderAPI.class); + + provider_API_command.setAction(ProviderAPI.SET_UP_PROVIDER); + provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver); + + startService(provider_API_command); + } + @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.configuration_wizard_activity, menu);
|