diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java index 26f2c5bf..e524a741 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java @@ -157,16 +157,17 @@ public class SettingsFragment extends PreferenceFragment @Override public void onApiChange(SyncthingService.State currentState) { - boolean enabled = currentState == SyncthingService.State.ACTIVE; - if (!enabled || !mSyncthingService.getApi().isConfigLoaded()) { - PreferenceScreen ps = getPreferenceScreen(); - for (int i = 0; i < ps.getPreferenceCount(); i++) { - Preference p = ps.getPreference(i); - p.setEnabled("category_run_conditions".equals(p.getKey())); - } - return; + boolean syncthingActive = currentState == SyncthingService.State.ACTIVE; + boolean enableAllPrefs = syncthingActive && mSyncthingService.getApi().isConfigLoaded(); + PreferenceScreen ps = getPreferenceScreen(); + for (int i = 0; i < ps.getPreferenceCount(); i++) { + Preference p = ps.getPreference(i); + p.setEnabled(enableAllPrefs || "category_run_conditions".equals(p.getKey())); } + if (!enableAllPrefs) + return; + mApi = mSyncthingService.getApi(); mSyncthingVersion.setSummary(mApi.getVersion()); mOptions = mApi.getOptions();