mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-26 12:51:28 +00:00
Show toast when trying to access nodes screen in repo settings if no nodes exist.
This commit is contained in:
parent
0a4121e6cf
commit
52f84e0ec0
2 changed files with 9 additions and 0 deletions
|
@ -99,6 +99,7 @@ public class RepoSettingsActivity extends PreferenceActivity
|
|||
mRepoMaster = (CheckBoxPreference) findPreference("repo_master");
|
||||
mRepoMaster.setOnPreferenceChangeListener(this);
|
||||
mNodes = (PreferenceScreen) findPreference("nodes");
|
||||
mNodes.setOnPreferenceClickListener(this);
|
||||
mVersioning = (CheckBoxPreference) findPreference("versioning");
|
||||
mVersioning.setOnPreferenceChangeListener(this);
|
||||
mVersioningKeep = (EditTextPreference) findPreference("versioning_keep");
|
||||
|
@ -278,6 +279,9 @@ public class RepoSettingsActivity extends PreferenceActivity
|
|||
: Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
startActivityForResult(intent, DIRECTORY_REQUEST_CODE);
|
||||
}
|
||||
else if (preference.equals(mNodes) && mSyncthingService.getApi().getNodes().isEmpty()) {
|
||||
Toast.makeText(this, R.string.no_nodes, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else if (preference.equals(mDelete)) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage(R.string.delete_repo_confirm)
|
||||
|
|
|
@ -100,6 +100,8 @@
|
|||
|
||||
<!-- Setting title -->
|
||||
<string name="keep_versions">Keep Versions</string>
|
||||
|
||||
<!-- Setting title -->
|
||||
<string name="delete_repo">Delete Repository</string>
|
||||
|
||||
<!-- Title for RepoSettingsActivity in create mode -->
|
||||
|
@ -120,6 +122,9 @@
|
|||
<!-- Toast shown when trying to create a repository with an empty path -->
|
||||
<string name="repo_path_required">The repository path must not be empty</string>
|
||||
|
||||
<!-- Toast shown when selecting 'nodes' if no nodes have been added -->
|
||||
<string name="no_nodes">Please connect a node first.</string>
|
||||
|
||||
<!-- NodeSettingsActivity -->
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue