1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-29 07:41:17 +00:00

Show toast when trying to access nodes screen in repo settings if no nodes exist.

This commit is contained in:
Felix Ableitner 2014-06-30 02:19:58 +02:00
parent 0a4121e6cf
commit 52f84e0ec0
2 changed files with 9 additions and 0 deletions

View file

@ -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)

View file

@ -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 -->