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"));
|
int count = Integer.parseInt(props.getProperty(KEY_COUNT, "0"));
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
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) {
|
if (url != null) {
|
||||||
mSources.add(new RepoSource(url, true /*userSource*/));
|
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) {
|
if (dlg.open() == Window.OK) {
|
||||||
String url = dlg.getValue();
|
String url = dlg.getValue();
|
||||||
mUpdaterData.getSources().add(new RepoSource(url, true /*userSource*/));
|
mUpdaterData.getSources().add(new RepoSource(url, true /*userSource*/));
|
||||||
|
onRefreshSelected();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,6 +346,7 @@ public class RemotePackagesPage extends Composite implements ISdkListener {
|
|||||||
if (mUpdaterData != null) {
|
if (mUpdaterData != null) {
|
||||||
mUpdaterData.refreshSources(false /*forceFetching*/);
|
mUpdaterData.refreshSources(false /*forceFetching*/);
|
||||||
}
|
}
|
||||||
|
mTreeViewerSources.refresh();
|
||||||
updateButtonsState();
|
updateButtonsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -236,8 +236,8 @@ public final class AvdSelector {
|
|||||||
if (displayMode == DisplayMode.MANAGER) {
|
if (displayMode == DisplayMode.MANAGER) {
|
||||||
mNewButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
|
mNewButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
|
||||||
mNewButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
mNewButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
mNewButton.setText("Add...");
|
mNewButton.setText("New...");
|
||||||
mNewButton.setToolTipText("Adds a new AVD.");
|
mNewButton.setToolTipText("Creates a new AVD.");
|
||||||
mNewButton.addSelectionListener(new SelectionAdapter() {
|
mNewButton.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent arg0) {
|
public void widgetSelected(SelectionEvent arg0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user