mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 11:21:29 +00:00
Changed wifi/power preference names to be easier to understand.
This commit is contained in:
parent
a9f9ef4ff1
commit
4886bbe0d1
4 changed files with 19 additions and 18 deletions
|
@ -25,9 +25,9 @@ public class SettingsFragment extends PreferenceFragment
|
|||
|
||||
private static final String SYNCTHING_VERSION_KEY = "syncthing_version";
|
||||
|
||||
private CheckBoxPreference mStopNotCharging;
|
||||
private CheckBoxPreference mSyncOnlyCharging;
|
||||
|
||||
private CheckBoxPreference mStopMobileData;
|
||||
private CheckBoxPreference mSyncOnlyWifi;
|
||||
|
||||
private Preference mVersion;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class SettingsFragment extends PreferenceFragment
|
|||
|
||||
/**
|
||||
* Applies the given value to the preference.
|
||||
* <p/>
|
||||
*
|
||||
* If pref is an EditTextPreference, setText is used and the value shown as summary. If pref is
|
||||
* a CheckBoxPreference, setChecked is used (by parsing value as Boolean).
|
||||
*/
|
||||
|
@ -81,7 +81,7 @@ public class SettingsFragment extends PreferenceFragment
|
|||
|
||||
/**
|
||||
* Loads layout, sets version from Rest API.
|
||||
* <p/>
|
||||
*
|
||||
* Manual target API as we manually check if ActionBar is available (for ActionBar back button).
|
||||
*/
|
||||
@Override
|
||||
|
@ -92,10 +92,11 @@ public class SettingsFragment extends PreferenceFragment
|
|||
|
||||
addPreferencesFromResource(R.xml.app_settings);
|
||||
PreferenceScreen screen = getPreferenceScreen();
|
||||
mStopNotCharging = (CheckBoxPreference) findPreference("stop_sync_on_mobile_data");
|
||||
mStopNotCharging.setOnPreferenceChangeListener(this);
|
||||
mStopMobileData = (CheckBoxPreference) findPreference("stop_sync_while_not_charging");
|
||||
mStopMobileData.setOnPreferenceChangeListener(this);
|
||||
mSyncOnlyCharging = (CheckBoxPreference)
|
||||
findPreference(SyncthingService.PREF_SYNC_ONLY_CHARGING);
|
||||
mSyncOnlyCharging.setOnPreferenceChangeListener(this);
|
||||
mSyncOnlyWifi = (CheckBoxPreference) findPreference(SyncthingService.PREF_SYNC_ONLY_WIFI);
|
||||
mSyncOnlyWifi.setOnPreferenceChangeListener(this);
|
||||
mVersion = screen.findPreference(SYNCTHING_VERSION_KEY);
|
||||
mOptionsScreen = (PreferenceScreen) screen.findPreference(SYNCTHING_OPTIONS_KEY);
|
||||
mGuiScreen = (PreferenceScreen) screen.findPreference(SYNCTHING_GUI_KEY);
|
||||
|
@ -136,7 +137,7 @@ public class SettingsFragment extends PreferenceFragment
|
|||
}
|
||||
}
|
||||
|
||||
if (preference.equals(mStopNotCharging) || preference.equals(mStopMobileData)) {
|
||||
if (preference.equals(mSyncOnlyCharging) || preference.equals(mSyncOnlyWifi)) {
|
||||
mSyncthingService.updateState();
|
||||
} else if (mOptionsScreen.findPreference(preference.getKey()) != null) {
|
||||
mSyncthingService.getApi().setValue(RestApi.TYPE_OPTIONS, preference.getKey(), o,
|
||||
|
|
|
@ -54,9 +54,9 @@ public class SyncthingService extends Service {
|
|||
*/
|
||||
public static final String BINARY_NAME = "lib/libsyncthing.so";
|
||||
|
||||
public static final String PREF_SYNC_ONLY_WIFI = "stop_sync_on_mobile_data";
|
||||
public static final String PREF_SYNC_ONLY_WIFI = "sync_only_wifi";
|
||||
|
||||
public static final String PREF_SYNC_ONLY_CHARGING = "stop_sync_while_not_charging";
|
||||
public static final String PREF_SYNC_ONLY_CHARGING = "sync_only_charging";
|
||||
|
||||
private ConfigXml mConfig;
|
||||
|
||||
|
|
|
@ -190,9 +190,9 @@ Please report any problems you encounter via Github.</string>
|
|||
<!-- Activity title -->
|
||||
<string name="settings_title">Settings</string>
|
||||
|
||||
<string name="stop_sync_while_not_charging">Stop sync when not charging</string>
|
||||
<string name="sync_only_charging">Sync only when charging</string>
|
||||
|
||||
<string name="stop_sync_on_mobile_data">Stop sync on mobile data</string>
|
||||
<string name="sync_only_wifi">Sync only on wifi</string>
|
||||
|
||||
<!-- Settings item that opens issue tracker -->
|
||||
<string name="report_issue_title">Report Issue</string>
|
||||
|
@ -223,10 +223,10 @@ Please report any problems you encounter via Github.</string>
|
|||
|
||||
<!-- SyncthingService -->
|
||||
|
||||
|
||||
<!-- Title of the dialog shown when the syncthing binary returns an error -->
|
||||
<string name="binary_crashed_title">Syncthing Binary Crashed</string>
|
||||
|
||||
|
||||
<!-- Message of the dialog shown when the syncthing binary returns an error -->
|
||||
<string name="binary_crashed_message">The syncthing binary has exited with error code %1$d.\n\n
|
||||
If this error persists, try reinstalling the app and restarting your device.\n\n</string>
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="stop_sync_while_not_charging"
|
||||
android:title="@string/stop_sync_while_not_charging"
|
||||
android:key="sync_only_charging"
|
||||
android:title="@string/sync_only_charging"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="stop_sync_on_mobile_data"
|
||||
android:title="@string/stop_sync_on_mobile_data"
|
||||
android:key="sync_only_wifi"
|
||||
android:title="@string/sync_only_wifi"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<PreferenceScreen
|
||||
|
|
Loading…
Reference in a new issue