mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-25 09:17:58 +00:00
Confirm resetting questions
This commit is contained in:
parent
ef8e6d6094
commit
aeeeb98e86
1 changed files with 19 additions and 9 deletions
|
@ -838,16 +838,26 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onResetQuestions() {
|
private void onResetQuestions() {
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
final Context context = getContext();
|
||||||
SharedPreferences.Editor editor = prefs.edit();
|
new AlertDialog.Builder(context)
|
||||||
for (String option : RESET_QUESTIONS)
|
.setTitle(R.string.title_setup_reset_questions)
|
||||||
editor.remove(option);
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
for (String key : prefs.getAll().keySet())
|
@Override
|
||||||
if (key.endsWith(".show_full") || key.endsWith(".show_images") || key.endsWith(".confirm_link"))
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
editor.remove(key);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
editor.apply();
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
for (String option : RESET_QUESTIONS)
|
||||||
|
editor.remove(option);
|
||||||
|
for (String key : prefs.getAll().keySet())
|
||||||
|
if (key.endsWith(".show_full") || key.endsWith(".show_images") || key.endsWith(".confirm_link"))
|
||||||
|
editor.remove(key);
|
||||||
|
editor.apply();
|
||||||
|
|
||||||
ToastEx.makeText(getContext(), R.string.title_setup_done, Toast.LENGTH_LONG).show();
|
ToastEx.makeText(context, R.string.title_setup_done, Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCleanup() {
|
private void onCleanup() {
|
||||||
|
|
Loading…
Reference in a new issue