mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Warn when enabling config "only_fetch_mvbox"
This commit is contained in:
@@ -600,7 +600,7 @@
|
||||
<string name="pref_background_btn_default">Use Default Image</string>
|
||||
<string name="pref_background_btn_gallery">Select From Gallery</string>
|
||||
<string name="pref_imap_folder_handling">IMAP Folder Handling</string>
|
||||
<string name="pref_imap_folder_warn_disable_defaults">If you disable this option, make sure, your server and your other clients are configured accordingly.\n\nOtherwise things may not work at all.</string>
|
||||
<string name="pref_imap_folder_warn_disable_defaults">If you change this option, make sure, your server and your other clients are configured accordingly.\n\nOtherwise things may not work at all.</string>
|
||||
<string name="pref_watch_inbox_folder">Watch Inbox Folder</string>
|
||||
<string name="pref_watch_sent_folder">Watch Sent Folder</string>
|
||||
<string name="pref_watch_mvbox_folder">Watch DeltaChat Folder</string>
|
||||
|
||||
@@ -92,11 +92,25 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
|
||||
onlyFetchMvboxCheckbox = this.findPreference("pref_only_fetch_mvbox");
|
||||
onlyFetchMvboxCheckbox.setOnPreferenceChangeListener(((preference, newValue) -> {
|
||||
boolean enabled = (Boolean) newValue;
|
||||
DcHelper.getAccounts(getContext()).stopIo();
|
||||
dcContext.setConfigInt(CONFIG_ONLY_FETCH_MVBOX, enabled? 1 : 0);
|
||||
DcHelper.getAccounts(getContext()).startIo();
|
||||
return true;
|
||||
final boolean enabled = (Boolean) newValue;
|
||||
if (enabled) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setMessage(R.string.pref_imap_folder_warn_disable_defaults)
|
||||
.setPositiveButton(R.string.ok, (dialogInterface, i) -> {
|
||||
DcHelper.getAccounts(getContext()).stopIo();
|
||||
dcContext.setConfigInt(CONFIG_ONLY_FETCH_MVBOX, 1);
|
||||
((CheckBoxPreference)preference).setChecked(true);
|
||||
DcHelper.getAccounts(getContext()).startIo();
|
||||
})
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.show();
|
||||
return false;
|
||||
} else {
|
||||
DcHelper.getAccounts(getContext()).stopIo();
|
||||
dcContext.setConfigInt(CONFIG_ONLY_FETCH_MVBOX, 0);
|
||||
DcHelper.getAccounts(getContext()).startIo();
|
||||
return true;
|
||||
}
|
||||
}));
|
||||
|
||||
Preference manageKeys = this.findPreference("pref_manage_keys");
|
||||
|
||||
Reference in New Issue
Block a user