1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-22 12:21:15 +00:00

Rename "repository" to "repo" in code, missing strings from last commit.

This commit is contained in:
Felix Ableitner 2014-06-25 20:43:43 +02:00
parent c42f8c4ccb
commit f5249f8918
8 changed files with 47 additions and 45 deletions

View file

@ -266,7 +266,7 @@ public class MainActivity extends ActionBarActivity
}
switch (item.getItemId()) {
case R.id.add_repository:
case R.id.add_repo:
Intent intent = new Intent(this, RepoSettingsActivity.class);
intent.setAction(RepoSettingsActivity.ACTION_CREATE);
startActivity(intent);

View file

@ -37,7 +37,7 @@ public class RepoSettingsActivity extends PreferenceActivity
public static final String ACTION_EDIT = "edit";
public static final String KEY_REPO_ID = "repository_id";
public static final String KEY_REPO_ID = "repo_id";
private static final String KEY_NODE_SHARED = "node_shared";
@ -56,13 +56,13 @@ public class RepoSettingsActivity extends PreferenceActivity
}
};
private RestApi.Repository mRepo;
private RestApi.Repo mRepo;
private EditTextPreference mRepositoryId;
private EditTextPreference mRepoId;
private EditTextPreference mDirectory;
private CheckBoxPreference mRepositoryMaster;
private CheckBoxPreference mRepoMaster;
private PreferenceScreen mNodes;
@ -83,12 +83,12 @@ public class RepoSettingsActivity extends PreferenceActivity
addPreferencesFromResource(R.xml.repo_settings_edit);
}
mRepositoryId = (EditTextPreference) findPreference("repository_id");
mRepositoryId.setOnPreferenceChangeListener(this);
mRepoId = (EditTextPreference) findPreference("repo_id");
mRepoId.setOnPreferenceChangeListener(this);
mDirectory = (EditTextPreference) findPreference("directory");
mDirectory.setOnPreferenceChangeListener(this);
mRepositoryMaster = (CheckBoxPreference) findPreference("repository_master");
mRepositoryMaster.setOnPreferenceChangeListener(this);
mRepoMaster = (CheckBoxPreference) findPreference("repo_master");
mRepoMaster.setOnPreferenceChangeListener(this);
mNodes = (PreferenceScreen) findPreference("nodes");
mVersioning = (CheckBoxPreference) findPreference("versioning");
mVersioning.setOnPreferenceChangeListener(this);
@ -112,7 +112,7 @@ public class RepoSettingsActivity extends PreferenceActivity
if (getIntent().getAction().equals(ACTION_CREATE)) {
setTitle(R.string.create_repo);
mRepo = new RestApi.Repository();
mRepo = new RestApi.Repo();
mRepo.ID = "";
mRepo.Directory = "";
mRepo.Nodes = new ArrayList<RestApi.Node>();
@ -120,7 +120,7 @@ public class RepoSettingsActivity extends PreferenceActivity
}
else if (getIntent().getAction().equals(ACTION_EDIT)) {
setTitle(R.string.edit_repo);
List<RestApi.Repository> repos = mSyncthingService.getApi().getRepos();
List<RestApi.Repo> repos = mSyncthingService.getApi().getRepos();
for (int i = 0; i < repos.size(); i++) {
if (repos.get(i).ID.equals(getIntent().getStringExtra(KEY_REPO_ID))) {
mRepo = repos.get(i);
@ -129,11 +129,11 @@ public class RepoSettingsActivity extends PreferenceActivity
}
}
mRepositoryId.setText(mRepo.ID);
mRepositoryId.setSummary(mRepo.ID);
mRepoId.setText(mRepo.ID);
mRepoId.setSummary(mRepo.ID);
mDirectory.setText(mRepo.Directory);
mDirectory.setSummary(mRepo.Directory);
mRepositoryMaster.setChecked(mRepo.ReadOnly);
mRepoMaster.setChecked(mRepo.ReadOnly);
List<RestApi.Node> nodesList = mSyncthingService.getApi().getNodes();
for (RestApi.Node n : nodesList) {
ExtendedCheckBoxPreference cbp =
@ -204,19 +204,19 @@ public class RepoSettingsActivity extends PreferenceActivity
pref.setSummary((String) o);
}
if (preference.equals(mRepositoryId)) {
if (preference.equals(mRepoId)) {
mRepo.ID = (String) o;
repositoryUpdated();
repoUpdated();
return true;
}
else if (preference.equals(mDirectory)) {
mRepo.Directory = (String) o;
repositoryUpdated();
repoUpdated();
return true;
}
else if (preference.equals(mRepositoryMaster)) {
else if (preference.equals(mRepoMaster)) {
mRepo.ReadOnly = (Boolean) o;
repositoryUpdated();
repoUpdated();
return true;
}
else if (preference.getKey().equals(KEY_NODE_SHARED)) {
@ -232,7 +232,7 @@ public class RepoSettingsActivity extends PreferenceActivity
}
}
}
repositoryUpdated();
repoUpdated();
return true;
}
else if (preference.equals(mVersioning)) {
@ -247,13 +247,13 @@ public class RepoSettingsActivity extends PreferenceActivity
else {
mRepo.Versioning = new RestApi.Versioning();
}
repositoryUpdated();
repoUpdated();
return true;
}
else if (preference.equals(mVersioningKeep)) {
((RestApi.SimpleVersioning) mRepo.Versioning)
.setParams(Integer.parseInt((String) o));
repositoryUpdated();
repoUpdated();
return true;
}
@ -279,7 +279,7 @@ public class RepoSettingsActivity extends PreferenceActivity
return false;
}
private void repositoryUpdated() {
private void repoUpdated() {
if (getIntent().getAction().equals(ACTION_EDIT)) {
mSyncthingService.getApi().editRepo(mRepo, false);
}

View file

@ -59,7 +59,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener {
public long sys;
}
public static class Repository {
public static class Repo {
public String Directory;
public String ID;
public String Invalid;
@ -384,17 +384,17 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener {
/**
* Returns a list of all existing repositores.
*/
public List<Repository> getRepos() {
public List<Repo> getRepos() {
if (mConfig == null)
return new ArrayList<Repository>();
return new ArrayList<Repo>();
List<Repository> ret = null;
List<Repo> ret = null;
try {
JSONArray repos = mConfig.getJSONArray("Repositories");
ret = new ArrayList<Repository>(repos.length());
ret = new ArrayList<Repo>(repos.length());
for (int i = 0; i < repos.length(); i++) {
JSONObject json = repos.getJSONObject(i);
Repository r = new Repository();
Repo r = new Repo();
r.Directory = json.getString("Directory");
r.ID = json.getString("ID");
r.Invalid = json.getString("Invalid");
@ -608,7 +608,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener {
/**
* Updates or creates the given node.
*/
public void editRepo(Repository repo, boolean create) {
public void editRepo(Repo repo, boolean create) {
try {
JSONArray repos = mConfig.getJSONArray("Repositories");
JSONObject r = null;
@ -656,7 +656,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener {
/**
* Deletes the given repository from syncthing.
*/
public void deleteRepo(Repository repo) {
public void deleteRepo(Repo repo) {
try {
JSONArray repos = mConfig.getJSONArray("Repositories");

View file

@ -17,7 +17,7 @@ import java.util.List;
/**
* Generates item views for repository items.
*/
public class ReposAdapter extends ArrayAdapter<RestApi.Repository>
public class ReposAdapter extends ArrayAdapter<RestApi.Repo>
implements RestApi.OnReceiveModelListener {
private HashMap<String, RestApi.Model> mModels = new HashMap<String, RestApi.Model>();
@ -67,8 +67,8 @@ public class ReposAdapter extends ArrayAdapter<RestApi.Repository>
/**
* Replacement for addAll, which is not implemented on lower API levels.
*/
public void add(List<RestApi.Repository> nodes) {
for (RestApi.Repository r : nodes) {
public void add(List<RestApi.Repo> nodes) {
for (RestApi.Repo r : nodes) {
add(r);
}
}

View file

@ -10,7 +10,7 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/add_repository"
android:id="@+id/add_repo"
android:title="@string/add_repo"
app:showAsAction="ifRoom" />

View file

@ -98,6 +98,8 @@
<!-- Setting title -->
<string name="keep_versions">Keep Versions</string>
<string name="delete_repo">Delete Repository</string>
<!-- Title for RepoSettingsActivity in create mode -->
<string name="create_repo">Create Repository</string>

View file

@ -3,7 +3,7 @@
android:persistent="false" >
<EditTextPreference
android:key="repository_id"
android:key="repo_id"
android:title="@string/repo_id" />
<EditTextPreference
@ -11,7 +11,7 @@
android:title="@string/directory" />
<CheckBoxPreference
android:key="repository_master"
android:key="repo_master"
android:title="@string/repo_master" />
<PreferenceScreen

View file

@ -3,22 +3,22 @@
android:persistent="false" >
<EditTextPreference
android:key="repository_id"
android:title="Repository ID"
android:key="repo_id"
android:title="@string/repo_id"
android:enabled="false"
style="?android:preferenceInformationStyle" />
<EditTextPreference
android:key="directory"
android:title="Directory" />
android:title="@string/directory" />
<CheckBoxPreference
android:key="repository_master"
android:title="Repository Master" />
android:key="repo_master"
android:title="@string/repo_master" />
<PreferenceScreen
android:key="nodes"
android:title="Nodes" />
android:title="@string/nodes" />
<CheckBoxPreference
android:key="versioning"
@ -26,11 +26,11 @@
<EditTextPreference
android:key="versioning_keep"
android:title="Keep Versions"
android:title="@string/keep_versions"
android:inputType="numberDecimal" />
<Preference
android:key="delete"
android:title="Delete Repository" />
android:title="@string/delete_repo" />
</PreferenceScreen>