Added synchronize on demand setting

This commit is contained in:
M66B
2019-02-17 18:29:00 +00:00
parent 3dda075978
commit d597366f17
12 changed files with 1569 additions and 12 deletions

View File

@@ -107,6 +107,7 @@ public class FragmentAccount extends FragmentBase {
private Button btnAdvanced;
private CheckBox cbSynchronize;
private CheckBox cbOnDemand;
private CheckBox cbPrimary;
private CheckBox cbNotify;
private CheckBox cbBrowse;
@@ -183,6 +184,7 @@ public class FragmentAccount extends FragmentBase {
btnAdvanced = view.findViewById(R.id.btnAdvanced);
cbSynchronize = view.findViewById(R.id.cbSynchronize);
cbOnDemand = view.findViewById(R.id.cbOnDemand);
cbPrimary = view.findViewById(R.id.cbPrimary);
cbNotify = view.findViewById(R.id.cbNotify);
cbBrowse = view.findViewById(R.id.cbBrowse);
@@ -746,6 +748,7 @@ public class FragmentAccount extends FragmentBase {
args.putInt("color", color);
args.putBoolean("synchronize", cbSynchronize.isChecked());
args.putBoolean("ondemand", cbOnDemand.isChecked());
args.putBoolean("primary", cbPrimary.isChecked());
args.putBoolean("notify", cbNotify.isChecked());
args.putBoolean("browse", cbBrowse.isChecked());
@@ -795,6 +798,7 @@ public class FragmentAccount extends FragmentBase {
Integer color = args.getInt("color");
boolean synchronize = args.getBoolean("synchronize");
boolean ondemand = args.getBoolean("ondemand");
boolean primary = args.getBoolean("primary");
boolean notify = args.getBoolean("notify");
boolean browse = args.getBoolean("browse");
@@ -844,6 +848,7 @@ public class FragmentAccount extends FragmentBase {
boolean reload = (check || account == null ||
(account.prefix == null ? prefix != null : !account.prefix.equals(prefix)) ||
account.synchronize != synchronize ||
account.ondemand != ondemand ||
!account.poll_interval.equals(Integer.parseInt(interval)));
Long last_connected = null;
@@ -920,6 +925,7 @@ public class FragmentAccount extends FragmentBase {
account.color = color;
account.synchronize = synchronize;
account.ondemand = ondemand;
account.primary = (account.synchronize && primary);
account.notify = notify;
account.browse = browse;
@@ -1142,6 +1148,7 @@ public class FragmentAccount extends FragmentBase {
cbNotify.setChecked(account == null ? false : account.notify);
cbSynchronize.setChecked(account == null ? true : account.synchronize);
cbOnDemand.setChecked(account == null ? false : account.ondemand);
cbPrimary.setChecked(account == null ? false : account.primary);
cbBrowse.setChecked(account == null ? true : account.browse);
etInterval.setText(account == null ? "" : Long.toString(account.poll_interval));