mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Added option to limit query threads
This commit is contained in:
@@ -76,6 +76,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private SwitchCompat swUpdates;
|
||||
private SwitchCompat swExperiments;
|
||||
private TextView tvExperimentsHint;
|
||||
private SwitchCompat swQueries;
|
||||
private SwitchCompat swCrashReports;
|
||||
private TextView tvUuid;
|
||||
private SwitchCompat swDebug;
|
||||
@@ -98,7 +99,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"shortcuts", "fts", "english", "watchdog", "updates",
|
||||
"experiments", "crash_reports", "debug", "auth_sasl", "cleanup_attachments"
|
||||
"experiments", "query_threads", "crash_reports", "debug", "auth_sasl", "cleanup_attachments"
|
||||
};
|
||||
|
||||
private final static String[] RESET_QUESTIONS = new String[]{
|
||||
@@ -131,6 +132,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swUpdates = view.findViewById(R.id.swUpdates);
|
||||
swExperiments = view.findViewById(R.id.swExperiments);
|
||||
tvExperimentsHint = view.findViewById(R.id.tvExperimentsHint);
|
||||
swQueries = view.findViewById(R.id.swQueries);
|
||||
swCrashReports = view.findViewById(R.id.swCrashReports);
|
||||
tvUuid = view.findViewById(R.id.tvUuid);
|
||||
swDebug = view.findViewById(R.id.swDebug);
|
||||
@@ -259,6 +261,14 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swQueries.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putInt("query_threads", checked ? 2 : 4).commit(); // apply won't work here
|
||||
restart();
|
||||
}
|
||||
});
|
||||
|
||||
swCrashReports.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -536,6 +546,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
Helper.isPlayStoreInstall() || !Helper.hasValidFingerprint(getContext())
|
||||
? View.GONE : View.VISIBLE);
|
||||
swExperiments.setChecked(prefs.getBoolean("experiments", false));
|
||||
swQueries.setChecked(prefs.getInt("query_threads", 4) < 4);
|
||||
swCrashReports.setChecked(prefs.getBoolean("crash_reports", false));
|
||||
tvUuid.setText(prefs.getString("uuid", null));
|
||||
swDebug.setChecked(prefs.getBoolean("debug", false));
|
||||
|
||||
Reference in New Issue
Block a user