summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/DownloadFailedDialog.java
diff options
context:
space:
mode:
authorcyBerta <richy@cyborgsociety.org>2013-12-21 00:38:00 +0100
committercyBerta <richy@cyborgsociety.org>2013-12-21 00:38:00 +0100
commitb2efaf181fb7833206e97f64eb29400057a7d7ed (patch)
treee7a2715313e7a9b7786606280081f7dace026a5f /src/se/leap/bitmaskclient/DownloadFailedDialog.java
parent31e0ee7819ff6e852bc40f66858f0ac02659bf04 (diff)
parent16ac5c300e21ce4c8b380013735f2c17d2e34768 (diff)
Merge branch 'bug/more-detailed-response-to-CW-errors' into develop
Diffstat (limited to 'src/se/leap/bitmaskclient/DownloadFailedDialog.java')
-rw-r--r--src/se/leap/bitmaskclient/DownloadFailedDialog.java45
1 files changed, 40 insertions, 5 deletions
diff --git a/src/se/leap/bitmaskclient/DownloadFailedDialog.java b/src/se/leap/bitmaskclient/DownloadFailedDialog.java
index 3ce101a6..f78002b0 100644
--- a/src/se/leap/bitmaskclient/DownloadFailedDialog.java
+++ b/src/se/leap/bitmaskclient/DownloadFailedDialog.java
@@ -14,9 +14,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- package se.leap.bitmaskclient;
+package se.leap.bitmaskclient;
import se.leap.bitmaskclient.R;
+import se.leap.bitmaskclient.NewProviderDialog.NewProviderDialogInterface;
+import se.leap.bitmaskclient.ProviderListContent.ProviderItem;
+import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
@@ -42,18 +45,50 @@ public class DownloadFailedDialog extends DialogFragment {
return dialog_fragment;
}
- @Override
+ @Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-
+
builder.setMessage(reason_to_fail)
- .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
+ .setPositiveButton(R.string.retry, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ dismiss();
+ interface_with_ConfigurationWizard.retrySetUpProvider();
+ }
+ })
+ .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
+ interface_with_ConfigurationWizard.cancelSettingUpProvider();
dialog.dismiss();
}
});
-
+
// Create the AlertDialog object and return it
return builder.create();
}
+
+ public interface DownloadFailedDialogInterface {
+ public void retrySetUpProvider();
+ public void cancelSettingUpProvider();
+ }
+
+ DownloadFailedDialogInterface interface_with_ConfigurationWizard;
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ try {
+ interface_with_ConfigurationWizard = (DownloadFailedDialogInterface) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString()
+ + " must implement NoticeDialogListener");
+ }
+ }
+
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ interface_with_ConfigurationWizard.cancelSettingUpProvider();
+ dialog.dismiss();
+ }
+
}