Fix loading of user repository and add refresh when adding/removing.
This commit is contained in:
@@ -93,7 +93,7 @@ public class RepoSources {
|
||||
int count = Integer.parseInt(props.getProperty(KEY_COUNT, "0"));
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
String url = props.getProperty(String.format("%s%02d", KEY_SRC, count)); //$NON-NLS-1$
|
||||
String url = props.getProperty(String.format("%s%02d", KEY_SRC, i)); //$NON-NLS-1$
|
||||
if (url != null) {
|
||||
mSources.add(new RepoSource(url, true /*userSource*/));
|
||||
}
|
||||
@@ -117,7 +117,6 @@ public class RepoSources {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -311,6 +311,7 @@ public class RemotePackagesPage extends Composite implements ISdkListener {
|
||||
if (dlg.open() == Window.OK) {
|
||||
String url = dlg.getValue();
|
||||
mUpdaterData.getSources().add(new RepoSource(url, true /*userSource*/));
|
||||
onRefreshSelected();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,6 +346,7 @@ public class RemotePackagesPage extends Composite implements ISdkListener {
|
||||
if (mUpdaterData != null) {
|
||||
mUpdaterData.refreshSources(false /*forceFetching*/);
|
||||
}
|
||||
mTreeViewerSources.refresh();
|
||||
updateButtonsState();
|
||||
}
|
||||
|
||||
|
||||
@@ -236,8 +236,8 @@ public final class AvdSelector {
|
||||
if (displayMode == DisplayMode.MANAGER) {
|
||||
mNewButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
|
||||
mNewButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
mNewButton.setText("Add...");
|
||||
mNewButton.setToolTipText("Adds a new AVD.");
|
||||
mNewButton.setText("New...");
|
||||
mNewButton.setToolTipText("Creates a new AVD.");
|
||||
mNewButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent arg0) {
|
||||
|
||||
Reference in New Issue
Block a user