mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-02-10 11:04:41 +00:00
* Add prefs: verbose_log, expert_mode * Update prefs in Constants * Add service.AppPrefs * Update fragments to read verbose log pref * Update classes with context or inject to read verbose log pref * Inherit ENABLE_VERBOSE_LOG from RestApi to Completion * Restart whole app if verbose log pref was changed * A line too much * Revert expert mode pref (DELTA REVERT) * Add expert mode pref (ref #256) * Make ignoreDelete an expert option * Make pullOrder and ignoreDelete expert options * Make deviceCompression an expert option * Import de translation
This commit is contained in:
parent
dbe7838266
commit
def8773dbb
6 changed files with 31 additions and 1 deletions
|
@ -276,6 +276,10 @@ public class DeviceActivity extends SyncthingActivity {
|
||||||
getWindow().setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
getWindow().setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
||||||
mNameView.requestFocus();
|
mNameView.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show expert options conditionally.
|
||||||
|
Boolean prefExpertMode = mPreferences.getBoolean(Constants.PREF_EXPERT_MODE, false);
|
||||||
|
mCompressionContainer.setVisibility(prefExpertMode ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restoreDialogStates(Bundle savedInstanceState) {
|
private void restoreDialogStates(Bundle savedInstanceState) {
|
||||||
|
|
|
@ -107,11 +107,13 @@ public class FolderActivity extends SyncthingActivity {
|
||||||
private SwitchCompat mCustomSyncConditionsSwitch;
|
private SwitchCompat mCustomSyncConditionsSwitch;
|
||||||
private TextView mCustomSyncConditionsDescription;
|
private TextView mCustomSyncConditionsDescription;
|
||||||
private TextView mCustomSyncConditionsDialog;
|
private TextView mCustomSyncConditionsDialog;
|
||||||
|
private ViewGroup mPullOrderContainer;
|
||||||
private TextView mPullOrderTypeView;
|
private TextView mPullOrderTypeView;
|
||||||
private TextView mPullOrderDescriptionView;
|
private TextView mPullOrderDescriptionView;
|
||||||
private TextView mVersioningDescriptionView;
|
private TextView mVersioningDescriptionView;
|
||||||
private TextView mVersioningTypeView;
|
private TextView mVersioningTypeView;
|
||||||
private SwitchCompat mVariableSizeBlocks;
|
private SwitchCompat mVariableSizeBlocks;
|
||||||
|
private ViewGroup mIgnoreDeleteContainer;
|
||||||
private SwitchCompat mIgnoreDelete;
|
private SwitchCompat mIgnoreDelete;
|
||||||
private TextView mEditIgnoreListTitle;
|
private TextView mEditIgnoreListTitle;
|
||||||
private EditText mEditIgnoreListContent;
|
private EditText mEditIgnoreListContent;
|
||||||
|
@ -208,11 +210,13 @@ public class FolderActivity extends SyncthingActivity {
|
||||||
mCustomSyncConditionsSwitch = findViewById(R.id.customSyncConditionsSwitch);
|
mCustomSyncConditionsSwitch = findViewById(R.id.customSyncConditionsSwitch);
|
||||||
mCustomSyncConditionsDescription = findViewById(R.id.customSyncConditionsDescription);
|
mCustomSyncConditionsDescription = findViewById(R.id.customSyncConditionsDescription);
|
||||||
mCustomSyncConditionsDialog = findViewById(R.id.customSyncConditionsDialog);
|
mCustomSyncConditionsDialog = findViewById(R.id.customSyncConditionsDialog);
|
||||||
|
mPullOrderContainer = findViewById(R.id.pullOrderContainer);
|
||||||
mPullOrderTypeView = findViewById(R.id.pullOrderType);
|
mPullOrderTypeView = findViewById(R.id.pullOrderType);
|
||||||
mPullOrderDescriptionView = findViewById(R.id.pullOrderDescription);
|
mPullOrderDescriptionView = findViewById(R.id.pullOrderDescription);
|
||||||
mVersioningDescriptionView = findViewById(R.id.versioningDescription);
|
mVersioningDescriptionView = findViewById(R.id.versioningDescription);
|
||||||
mVersioningTypeView = findViewById(R.id.versioningType);
|
mVersioningTypeView = findViewById(R.id.versioningType);
|
||||||
mVariableSizeBlocks = findViewById(R.id.variableSizeBlocks);
|
mVariableSizeBlocks = findViewById(R.id.variableSizeBlocks);
|
||||||
|
mIgnoreDeleteContainer = findViewById(R.id.ignoreDeleteContainer);
|
||||||
mIgnoreDelete = findViewById(R.id.ignoreDelete);
|
mIgnoreDelete = findViewById(R.id.ignoreDelete);
|
||||||
mDevicesContainer = findViewById(R.id.devicesContainer);
|
mDevicesContainer = findViewById(R.id.devicesContainer);
|
||||||
mEditIgnoreListTitle = findViewById(R.id.edit_ignore_list_title);
|
mEditIgnoreListTitle = findViewById(R.id.edit_ignore_list_title);
|
||||||
|
@ -222,7 +226,7 @@ public class FolderActivity extends SyncthingActivity {
|
||||||
mCustomSyncConditionsDialog.setOnClickListener(view -> onCustomSyncConditionsDialogClick());
|
mCustomSyncConditionsDialog.setOnClickListener(view -> onCustomSyncConditionsDialogClick());
|
||||||
|
|
||||||
findViewById(R.id.folderTypeContainer).setOnClickListener(v -> showFolderTypeDialog());
|
findViewById(R.id.folderTypeContainer).setOnClickListener(v -> showFolderTypeDialog());
|
||||||
findViewById(R.id.pullOrderContainer).setOnClickListener(v -> showPullOrderDialog());
|
mPullOrderContainer.setOnClickListener(v -> showPullOrderDialog());
|
||||||
findViewById(R.id.versioningContainer).setOnClickListener(v -> showVersioningDialog());
|
findViewById(R.id.versioningContainer).setOnClickListener(v -> showVersioningDialog());
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
|
@ -282,6 +286,11 @@ public class FolderActivity extends SyncthingActivity {
|
||||||
checkWriteAndUpdateUI();
|
checkWriteAndUpdateUI();
|
||||||
updateViewsAndSetListeners();
|
updateViewsAndSetListeners();
|
||||||
|
|
||||||
|
// Show expert options conditionally.
|
||||||
|
Boolean prefExpertMode = mPreferences.getBoolean(Constants.PREF_EXPERT_MODE, false);
|
||||||
|
mPullOrderContainer.setVisibility(prefExpertMode ? View.VISIBLE : View.GONE);
|
||||||
|
mIgnoreDeleteContainer.setVisibility(prefExpertMode ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
// Open keyboard on label view in edit mode.
|
// Open keyboard on label view in edit mode.
|
||||||
mLabelView.requestFocus();
|
mLabelView.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class Constants {
|
||||||
public static final String PREF_SUGGEST_NEW_FOLDER_ROOT_DATA = "external_android_data";
|
public static final String PREF_SUGGEST_NEW_FOLDER_ROOT_DATA = "external_android_data";
|
||||||
public static final String PREF_SUGGEST_NEW_FOLDER_ROOT_MEDIA = "external_android_media";
|
public static final String PREF_SUGGEST_NEW_FOLDER_ROOT_MEDIA = "external_android_media";
|
||||||
|
|
||||||
|
public static final String PREF_EXPERT_MODE = "expert_mode";
|
||||||
|
|
||||||
// Preferences - Troubleshooting
|
// Preferences - Troubleshooting
|
||||||
public static final String PREF_VERBOSE_LOG = "verbose_log";
|
public static final String PREF_VERBOSE_LOG = "verbose_log";
|
||||||
public static final String PREF_ENVIRONMENT_VARIABLES = "environment_variables";
|
public static final String PREF_ENVIRONMENT_VARIABLES = "environment_variables";
|
||||||
|
|
|
@ -465,6 +465,10 @@ Bitte melden Sie auftretende Probleme via GitHub.</string>
|
||||||
<item>[Ext_Speicher]/Android/media</item>
|
<item>[Ext_Speicher]/Android/media</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string name="expert_mode_title">Expertenmodus</string>
|
||||||
|
|
||||||
|
<string name="expert_mode_summary">Durch Aktivieren dieser Option werden erweiterte Konfigurationsoptionen angezeigt. Du solltest Dir zuerst die Syncthing-Dokumentation ansehen, um sicherzustellen, dass Du weißt, wie sie richtig verwendet werden. Falsche Einstellungen können zu hohem Batterieverbrauch, Erschöpfung der Systemressourcen oder unvollständiger Synchronisation führen.</string>
|
||||||
|
|
||||||
<string name="preference_language_title">Sprache</string>
|
<string name="preference_language_title">Sprache</string>
|
||||||
|
|
||||||
<string name="preference_language_summary">Anwendungssprache ändern</string>
|
<string name="preference_language_summary">Anwendungssprache ändern</string>
|
||||||
|
|
|
@ -468,6 +468,10 @@ Please report any problems you encounter via Github.</string>
|
||||||
<item>[external_storage]/Android/media</item>
|
<item>[external_storage]/Android/media</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string name="expert_mode_title">Expert mode</string>
|
||||||
|
|
||||||
|
<string name="expert_mode_summary">Enabling this option will show advanced configuration options. You should have a look at the Syncthing Docs first to make sure you know how to use them correctly. Incorrect settings may cause battery drain, system resource exhaust or incomplete synchronization.</string>
|
||||||
|
|
||||||
<string name="preference_language_title">Language</string>
|
<string name="preference_language_title">Language</string>
|
||||||
|
|
||||||
<string name="preference_language_summary">Change the app language</string>
|
<string name="preference_language_summary">Change the app language</string>
|
||||||
|
|
|
@ -100,6 +100,13 @@
|
||||||
android:summary="@null"
|
android:summary="@null"
|
||||||
android:defaultValue="external_android_data" />
|
android:defaultValue="external_android_data" />
|
||||||
|
|
||||||
|
<!-- Expert mode -->
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="expert_mode"
|
||||||
|
android:title="@string/expert_mode_title"
|
||||||
|
android:summary="@string/expert_mode_summary"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="pref_current_language"
|
android:key="pref_current_language"
|
||||||
android:title="@string/preference_language_title"
|
android:title="@string/preference_language_title"
|
||||||
|
|
Loading…
Reference in a new issue