mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
Merge pull request #3889 from deltachat/adb/issue-3688
avoid superfluous error message when user cancel configuration
This commit is contained in:
commit
700d11f600
3 changed files with 25 additions and 12 deletions
|
@ -5,6 +5,7 @@
|
||||||
* target Android 15
|
* target Android 15
|
||||||
* improve readability of info messages in dark mode
|
* improve readability of info messages in dark mode
|
||||||
* fix Direct Share shortcuts
|
* fix Direct Share shortcuts
|
||||||
|
* fix: don't show error message when cancelling profile creation
|
||||||
|
|
||||||
## v2.11.0
|
## v2.11.0
|
||||||
2025-08
|
2025-08
|
||||||
|
|
|
@ -87,7 +87,10 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||||
|
|
||||||
private AttachmentManager attachmentManager;
|
private AttachmentManager attachmentManager;
|
||||||
private Bitmap avatarBmp;
|
private Bitmap avatarBmp;
|
||||||
|
|
||||||
private @Nullable ProgressDialog progressDialog;
|
private @Nullable ProgressDialog progressDialog;
|
||||||
|
private boolean cancelled;
|
||||||
|
|
||||||
private DcContext dcContext;
|
private DcContext dcContext;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -433,7 +436,6 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void progressSuccess() {
|
private void progressSuccess() {
|
||||||
DcHelper.getEventCenter(this).endCaptureNextError();
|
|
||||||
if (progressDialog != null) {
|
if (progressDialog != null) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
@ -492,11 +494,14 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||||
progressDialog = null;
|
progressDialog = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cancelled = false;
|
||||||
|
|
||||||
progressDialog = new ProgressDialog(this);
|
progressDialog = new ProgressDialog(this);
|
||||||
progressDialog.setMessage(getResources().getString(R.string.one_moment));
|
progressDialog.setMessage(getResources().getString(R.string.one_moment));
|
||||||
progressDialog.setCanceledOnTouchOutside(false);
|
progressDialog.setCanceledOnTouchOutside(false);
|
||||||
progressDialog.setCancelable(false);
|
progressDialog.setCancelable(false);
|
||||||
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(android.R.string.cancel), (dialog, which) -> {
|
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(android.R.string.cancel), (dialog, which) -> {
|
||||||
|
cancelled = true;
|
||||||
dcContext.stopOngoingProcess();
|
dcContext.stopOngoingProcess();
|
||||||
});
|
});
|
||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
|
@ -507,10 +512,14 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||||
Rpc rpc = DcHelper.getRpc(this);
|
Rpc rpc = DcHelper.getRpc(this);
|
||||||
try {
|
try {
|
||||||
rpc.addTransportFromQr(dcContext.getAccountId(), qrCode);
|
rpc.addTransportFromQr(dcContext.getAccountId(), qrCode);
|
||||||
|
DcHelper.getEventCenter(this).endCaptureNextError();
|
||||||
progressSuccess();
|
progressSuccess();
|
||||||
} catch (RpcException e) {
|
} catch (RpcException e) {
|
||||||
|
DcHelper.getEventCenter(this).endCaptureNextError();
|
||||||
|
if (!cancelled) {
|
||||||
Util.runOnMain(() -> progressError(e.getMessage()));
|
Util.runOnMain(() -> progressError(e.getMessage()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
||||||
private Group advancedGroup;
|
private Group advancedGroup;
|
||||||
private ImageView advancedIcon;
|
private ImageView advancedIcon;
|
||||||
private ProgressDialog progressDialog;
|
private ProgressDialog progressDialog;
|
||||||
|
private boolean cancelled = false;
|
||||||
|
|
||||||
Spinner imapSecurity;
|
Spinner imapSecurity;
|
||||||
Spinner smtpSecurity;
|
Spinner smtpSecurity;
|
||||||
|
@ -563,6 +564,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cancelled = false;
|
||||||
setupConfig();
|
setupConfig();
|
||||||
|
|
||||||
if (progressDialog != null) {
|
if (progressDialog != null) {
|
||||||
|
@ -574,7 +576,10 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
||||||
progressDialog.setMessage(getString(R.string.one_moment));
|
progressDialog.setMessage(getString(R.string.one_moment));
|
||||||
progressDialog.setCanceledOnTouchOutside(false);
|
progressDialog.setCanceledOnTouchOutside(false);
|
||||||
progressDialog.setCancelable(false);
|
progressDialog.setCancelable(false);
|
||||||
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), (dialog, which) -> stopLoginProcess());
|
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), (dialog, which) -> {
|
||||||
|
cancelled = true;
|
||||||
|
DcHelper.getContext(this).stopOngoingProcess();
|
||||||
|
});
|
||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -613,12 +618,14 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
||||||
startActivity(conversationList);
|
startActivity(conversationList);
|
||||||
finish();
|
finish();
|
||||||
} catch (RpcException e) {
|
} catch (RpcException e) {
|
||||||
Util.runOnMain(() -> {
|
|
||||||
DcHelper.getEventCenter(this).endCaptureNextError();
|
DcHelper.getEventCenter(this).endCaptureNextError();
|
||||||
|
if (!cancelled) {
|
||||||
|
Util.runOnMain(() -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
WelcomeActivity.maybeShowConfigurationError(this, e.getMessage());
|
WelcomeActivity.maybeShowConfigurationError(this, e.getMessage());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,10 +638,6 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
||||||
return value.isEmpty()? null : value;
|
return value.isEmpty()? null : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopLoginProcess() {
|
|
||||||
DcHelper.getContext(this).stopOngoingProcess();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(@NonNull DcEvent event) {
|
public void handleEvent(@NonNull DcEvent event) {
|
||||||
if (event.getId()==DcContext.DC_EVENT_CONFIGURE_PROGRESS) {
|
if (event.getId()==DcContext.DC_EVENT_CONFIGURE_PROGRESS) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue