Fix loading of user repository and add refresh when adding/removing.

This commit is contained in:
Xavier Ducrohet
2009-07-23 14:43:49 -07:00
parent d74be2a969
commit ecc85daf7b
3 changed files with 5 additions and 4 deletions

View File

@@ -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 {
} }
} }
} }
} }
/** /**

View File

@@ -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();
} }

View File

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