Added a button to the error dialog that allows to view the log file

This commit is contained in:
Tobias Brunner
2012-08-13 11:28:08 +02:00
parent fbacc6506c
commit 1fcaa71291
@@ -341,16 +341,31 @@ public class VpnStateFragment extends Fragment implements VpnStateListener
mErrorDialog = new AlertDialog.Builder(getActivity()) mErrorDialog = new AlertDialog.Builder(getActivity())
.setMessage(getString(R.string.error_introduction) + " " + getString(textid)) .setMessage(getString(R.string.error_introduction) + " " + getString(textid))
.setCancelable(false) .setCancelable(false)
.setNeutralButton(R.string.show_log, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which)
{
dialog.dismiss();
Intent logIntent = new Intent(getActivity(), LogActivity.class);
startActivity(logIntent);
}
})
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int id) public void onClick(DialogInterface dialog, int id)
{ /* clear the error */ {
mError = ErrorState.NO_ERROR;
mErrorDialog = null;
updateView();
dialog.dismiss(); dialog.dismiss();
} }
}).create(); }).create();
mErrorDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog)
{ /* clear the error */
mError = ErrorState.NO_ERROR;
mErrorDialog = null;
updateView();
}
});
mErrorDialog.show(); mErrorDialog.show();
} }
} }