mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #1435 from deltachat/watch-restart-io
restart-io when watch-settings are changed
This commit is contained in:
@@ -101,15 +101,19 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
private boolean handleImapCheck(Preference preference, Object newValue, String dc_config_name) {
|
||||
final boolean newEnabled = (Boolean) newValue;
|
||||
if(newEnabled) {
|
||||
dcContext.stopIo();
|
||||
dcContext.setConfigInt(dc_config_name, 1);
|
||||
dcContext.maybeStartIo();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setMessage(R.string.pref_imap_folder_warn_disable_defaults)
|
||||
.setPositiveButton(R.string.ok, (dialogInterface, i) -> {
|
||||
dcContext.stopIo();
|
||||
dcContext.setConfigInt(dc_config_name, 0);
|
||||
((CheckBoxPreference)preference).setChecked(false);
|
||||
dcContext.maybeStartIo();
|
||||
})
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.show();
|
||||
|
||||
Reference in New Issue
Block a user