From 755633af514c8f425f936bc5185815175397937c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Sat, 29 Jun 2013 12:54:15 +0200 Subject: Distinguish non LEAP provider and down provider. I've set ProviderAPI to show its own toast depending on the exception that getStringFromProvider issues. If the socket timeout reaches its end, a toast different from when an IOException or a MalformedException occur. --- src/se/leap/leapclient/ConfigurationWizard.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/se/leap/leapclient/ConfigurationWizard.java') diff --git a/src/se/leap/leapclient/ConfigurationWizard.java b/src/se/leap/leapclient/ConfigurationWizard.java index df7da8ff..840e4e6d 100644 --- a/src/se/leap/leapclient/ConfigurationWizard.java +++ b/src/se/leap/leapclient/ConfigurationWizard.java @@ -101,13 +101,12 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn e.printStackTrace(); mProgressDialog.dismiss(); - Toast.makeText(this, getResources().getString(R.string.config_error_parsing), Toast.LENGTH_LONG); + //Toast.makeText(this, getResources().getString(R.string.config_error_parsing), Toast.LENGTH_LONG); setResult(RESULT_CANCELED, mConfigState); } } else if(resultCode == ConfigHelper.INCORRECTLY_UPDATED_PROVIDER_DOT_JSON) { mProgressDialog.dismiss(); - Toast.makeText(getApplicationContext(), R.string.incorrectly_updated_provider_dot_json_message, Toast.LENGTH_LONG).show(); setResult(RESULT_CANCELED, mConfigState); } else if(resultCode == ConfigHelper.CORRECTLY_DOWNLOADED_JSON_FILES) { @@ -123,20 +122,16 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn } } else if(resultCode == ConfigHelper.INCORRECTLY_DOWNLOADED_JSON_FILES) { - Toast.makeText(getApplicationContext(), R.string.incorrectly_downloaded_json_files_message, Toast.LENGTH_LONG).show(); + //Toast.makeText(getApplicationContext(), R.string.incorrectly_downloaded_json_files_message, Toast.LENGTH_LONG).show(); setResult(RESULT_CANCELED, mConfigState); } else if(resultCode == ConfigHelper.CORRECTLY_DOWNLOADED_CERTIFICATE) { mProgressDialog.dismiss(); - //Toast.makeText(getApplicationContext(), R.string.correctly_downloaded_json_files_message, Toast.LENGTH_LONG).show(); - //Toast.makeText(getApplicationContext(), R.string.success, Toast.LENGTH_LONG).show(); - //mConfigState.putExtra(CERTIFICATE_RETRIEVED, true); // If this isn't the last step and finish() is moved... setResult(RESULT_OK); - //finish(); showProviderDetails(getCurrentFocus()); } else if(resultCode == ConfigHelper.INCORRECTLY_DOWNLOADED_CERTIFICATE) { mProgressDialog.dismiss(); - Toast.makeText(getApplicationContext(), R.string.incorrectly_downloaded_certificate_message, Toast.LENGTH_LONG).show(); + //Toast.makeText(getApplicationContext(), R.string.incorrectly_downloaded_certificate_message, Toast.LENGTH_LONG).show(); setResult(RESULT_CANCELED, mConfigState); } } -- cgit v1.2.3