diff --git a/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java b/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java index 252343e5..0211968e 100644 --- a/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java @@ -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) diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index f26383da..9e4036f1 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -100,6 +100,8 @@ Keep Versions + + Delete Repository @@ -120,6 +122,9 @@ The repository path must not be empty + + Please connect a node first. +