|
Lines 12-17
Link Here
|
| 12 |
import java.net.MalformedURLException; |
12 |
import java.net.MalformedURLException; |
| 13 |
import java.net.Proxy; |
13 |
import java.net.Proxy; |
| 14 |
import java.net.URL; |
14 |
import java.net.URL; |
|
|
15 |
import java.util.List; |
| 15 |
|
16 |
|
| 16 |
import org.eclipse.core.runtime.CoreException; |
17 |
import org.eclipse.core.runtime.CoreException; |
| 17 |
import org.eclipse.core.runtime.IProgressMonitor; |
18 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
Lines 35-40
Link Here
|
| 35 |
import org.eclipse.swt.events.SelectionAdapter; |
36 |
import org.eclipse.swt.events.SelectionAdapter; |
| 36 |
import org.eclipse.swt.events.SelectionEvent; |
37 |
import org.eclipse.swt.events.SelectionEvent; |
| 37 |
import org.eclipse.swt.events.SelectionListener; |
38 |
import org.eclipse.swt.events.SelectionListener; |
|
|
39 |
import org.eclipse.swt.layout.GridLayout; |
| 38 |
import org.eclipse.swt.widgets.Button; |
40 |
import org.eclipse.swt.widgets.Button; |
| 39 |
import org.eclipse.swt.widgets.Combo; |
41 |
import org.eclipse.swt.widgets.Combo; |
| 40 |
import org.eclipse.swt.widgets.Composite; |
42 |
import org.eclipse.swt.widgets.Composite; |
|
Lines 58-63
Link Here
|
| 58 |
|
60 |
|
| 59 |
protected Combo repositoryVersionCombo; |
61 |
protected Combo repositoryVersionCombo; |
| 60 |
|
62 |
|
|
|
63 |
protected Button defaults; |
| 64 |
|
| 65 |
protected Combo defaultPlatformCombo; |
| 66 |
|
| 67 |
protected Combo defaultOSCombo; |
| 68 |
|
| 61 |
private Button cleanQAContact; |
69 |
private Button cleanQAContact; |
| 62 |
|
70 |
|
| 63 |
private Button cachedConfigButton; |
71 |
private Button cachedConfigButton; |
|
Lines 145-150
Link Here
|
| 145 |
cachedConfigButton.setSelection(isCached); |
153 |
cachedConfigButton.setSelection(isCached); |
| 146 |
} |
154 |
} |
| 147 |
|
155 |
|
|
|
156 |
RepositoryConfiguration repositoryConfiguration = null; |
| 157 |
String platform = null; |
| 158 |
String os = null; |
| 159 |
try { |
| 160 |
if (null != repository) { |
| 161 |
repositoryConfiguration = |
| 162 |
BugzillaCorePlugin.getRepositoryConfiguration(repository, false); |
| 163 |
platform = |
| 164 |
repository.getProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM); |
| 165 |
os = |
| 166 |
repository.getProperty(IBugzillaConstants.BUGZILLA_DEF_OS); |
| 167 |
} |
| 168 |
} catch (CoreException e1) { |
| 169 |
// TODO Auto-generated catch block |
| 170 |
e1.printStackTrace(); |
| 171 |
} |
| 172 |
|
| 173 |
Label defaultPlatformLabel = new Label(parent, SWT.NONE); |
| 174 |
defaultPlatformLabel.setText("Default Platform/OS"); |
| 175 |
|
| 176 |
Composite platformOSContainer = new Composite(parent, SWT.NONE); |
| 177 |
GridLayout gridLayout = new GridLayout(3, false); |
| 178 |
gridLayout.marginWidth = 0; |
| 179 |
gridLayout.marginHeight = 0; |
| 180 |
platformOSContainer.setLayout(gridLayout); |
| 181 |
|
| 182 |
defaults = new Button(platformOSContainer, SWT.CHECK); |
| 183 |
defaults.addSelectionListener(new SelectionAdapter() { |
| 184 |
|
| 185 |
@Override |
| 186 |
public void widgetSelected(SelectionEvent e) { |
| 187 |
defaultPlatformCombo.setEnabled(defaults.getSelection()); |
| 188 |
defaultOSCombo.setEnabled(defaults.getSelection()); |
| 189 |
} |
| 190 |
|
| 191 |
}); |
| 192 |
defaults.setEnabled(null != repository); |
| 193 |
defaults.setSelection(null != platform && null != os); |
| 194 |
|
| 195 |
defaultPlatformCombo = new Combo(platformOSContainer, SWT.READ_ONLY); |
| 196 |
if (null != repositoryConfiguration) { |
| 197 |
List<String> optionValues = repositoryConfiguration.getPlatforms(); |
| 198 |
for (String option : optionValues) { |
| 199 |
defaultPlatformCombo.add(option.toString()); |
| 200 |
} |
| 201 |
if (null != platform && defaultPlatformCombo.indexOf(platform) >= 0) { |
| 202 |
defaultPlatformCombo.select(defaultPlatformCombo.indexOf(platform)); |
| 203 |
} else { |
| 204 |
defaultPlatformCombo.select(0); |
| 205 |
} |
| 206 |
} else { |
| 207 |
defaultPlatformCombo.add("All"); |
| 208 |
defaultPlatformCombo.select(0); |
| 209 |
} |
| 210 |
defaultPlatformCombo.setEnabled(defaults.getSelection()); |
| 211 |
|
| 212 |
defaultOSCombo = new Combo(platformOSContainer, SWT.READ_ONLY); |
| 213 |
if (null != repositoryConfiguration) { |
| 214 |
List<String> optionValues = repositoryConfiguration.getOSs(); |
| 215 |
for (String option : optionValues) { |
| 216 |
defaultOSCombo.add(option.toString()); |
| 217 |
} |
| 218 |
if (null != os && defaultOSCombo.indexOf(os) >= 0) { |
| 219 |
defaultOSCombo.select(defaultOSCombo.indexOf(os)); |
| 220 |
} else { |
| 221 |
defaultOSCombo.select(0); |
| 222 |
} |
| 223 |
} else { |
| 224 |
defaultOSCombo.add("All"); |
| 225 |
defaultOSCombo.select(0); // TODO bug 159397 choose first platform: All |
| 226 |
} |
| 227 |
defaultOSCombo.setEnabled(defaults.getSelection()); |
| 228 |
|
| 148 |
} |
229 |
} |
| 149 |
|
230 |
|
| 150 |
public void setBugzillaVersion(String version) { |
231 |
public void setBugzillaVersion(String version) { |
|
Lines 184-189
Link Here
|
| 184 |
repository.setProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP, |
265 |
repository.setProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP, |
| 185 |
IBugzillaConstants.TIMESTAMP_NOT_AVAILABLE); |
266 |
IBugzillaConstants.TIMESTAMP_NOT_AVAILABLE); |
| 186 |
} |
267 |
} |
|
|
268 |
// TODO save the selected default Platform and OS here bug 159397 |
| 269 |
if (defaults.getSelection()) { |
| 270 |
repository.setProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM, |
| 271 |
String.valueOf(defaultPlatformCombo.getItem(defaultPlatformCombo.getSelectionIndex()))); |
| 272 |
repository.setProperty(IBugzillaConstants.BUGZILLA_DEF_OS, |
| 273 |
String.valueOf(defaultOSCombo.getItem(defaultOSCombo.getSelectionIndex()))); |
| 274 |
} else { |
| 275 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM); |
| 276 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_OS); |
| 277 |
} |
| 187 |
} |
278 |
} |
| 188 |
|
279 |
|
| 189 |
@Override |
280 |
@Override |