Fix #5900 - Use default profile instead of global

This commit is contained in:
Victor Shcherb 2018-10-16 22:05:52 +02:00
parent 19d801bb54
commit 35a30758ef
2 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<ListPreference android:summary="@string/settings_preset_descr" android:title="@string/settings_preset" android:key="application_mode"></ListPreference>
<ListPreference android:summary="@string/settings_preset_descr" android:title="@string/settings_preset" android:key="default_application_mode_string"></ListPreference>
<ListPreference android:key="rotate_map" android:title="@string/rotate_map_to_bearing" android:summary="@string/rotate_map_to_bearing_descr"></ListPreference>
<ListPreference android:key="map_screen_orientation" android:title="@string/map_screen_orientation" android:summary="@string/map_screen_orientation_descr"></ListPreference>
<PreferenceCategory android:title="@string/localization_pref_title" android:key="localization">

View file

@ -88,7 +88,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
for (int i = 0; i < entries.length; i++) {
entries[i] = appModes[i].toHumanString(getMyApplication());
}
registerListPreference(settings.APPLICATION_MODE, screen, entries, appModes);
registerListPreference(settings.DEFAULT_APPLICATION_MODE, screen, entries, appModes);
// List preferences
registerListPreference(settings.ROTATE_MAP, screen,
@ -105,7 +105,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
addProxyPrefs((PreferenceGroup) screen.findPreference("proxy"));
addMiscPreferences((PreferenceGroup) screen.findPreference("misc"));
applicationModePreference = (ListPreference) screen.findPreference(settings.APPLICATION_MODE.getId());
applicationModePreference = (ListPreference) screen.findPreference(settings.DEFAULT_APPLICATION_MODE.getId());
applicationModePreference.setOnPreferenceChangeListener(this);
}
@ -527,8 +527,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
}
} else if (preference == applicationDir) {
return false;
} else if (id.equals(settings.APPLICATION_MODE.getId())) {
settings.DEFAULT_APPLICATION_MODE.set(settings.APPLICATION_MODE.get());
} else if (id.equals(settings.DEFAULT_APPLICATION_MODE.getId())) {
settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get());
updateAllSettings();
} else if (id.equals(settings.PREFERRED_LOCALE.getId())) {
// restart application to update locale