|
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 autodetectPlatformOS; |
| 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 |
StatusHandler.log(e1, "Error retrieving Repository Configuration Settings"); |
| 170 |
} |
| 171 |
|
| 172 |
Label defaultPlatformLabel = new Label(parent, SWT.NONE); |
| 173 |
defaultPlatformLabel.setText("Autodetect Platform and OS"); |
| 174 |
|
| 175 |
Composite platformOSContainer = new Composite(parent, SWT.NONE); |
| 176 |
GridLayout gridLayout = new GridLayout(3, false); |
| 177 |
gridLayout.marginWidth = 0; |
| 178 |
gridLayout.marginHeight = 0; |
| 179 |
platformOSContainer.setLayout(gridLayout); |
| 180 |
|
| 181 |
autodetectPlatformOS = new Button(platformOSContainer, SWT.CHECK); |
| 182 |
autodetectPlatformOS.addSelectionListener(new SelectionAdapter() { |
| 183 |
|
| 184 |
@Override |
| 185 |
public void widgetSelected(SelectionEvent e) { |
| 186 |
defaultPlatformCombo.setEnabled(!autodetectPlatformOS.getSelection()); |
| 187 |
defaultOSCombo.setEnabled(!autodetectPlatformOS.getSelection()); |
| 188 |
} |
| 189 |
|
| 190 |
}); |
| 191 |
autodetectPlatformOS.setEnabled(null != repository); |
| 192 |
if(null == repository) |
| 193 |
autodetectPlatformOS.setToolTipText( |
| 194 |
"This option will be enabled after the repository has been accessed."); |
| 195 |
else |
| 196 |
autodetectPlatformOS.setToolTipText( |
| 197 |
"Use these settings to override the auto guessing of Platform and OS."); |
| 198 |
autodetectPlatformOS.setSelection(null == platform && null == os); |
| 199 |
|
| 200 |
defaultPlatformCombo = new Combo(platformOSContainer, SWT.READ_ONLY); |
| 201 |
if (null != repositoryConfiguration) { |
| 202 |
List<String> optionValues = repositoryConfiguration.getPlatforms(); |
| 203 |
for (String option : optionValues) { |
| 204 |
defaultPlatformCombo.add(option.toString()); |
| 205 |
} |
| 206 |
if (null != platform && defaultPlatformCombo.indexOf(platform) >= 0) { |
| 207 |
defaultPlatformCombo.select(defaultPlatformCombo.indexOf(platform)); |
| 208 |
} else { |
| 209 |
// remove value if no longer exists and set to All! |
| 210 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM); |
| 211 |
defaultPlatformCombo.select(0); |
| 212 |
} |
| 213 |
} else { |
| 214 |
defaultPlatformCombo.add("All"); |
| 215 |
defaultPlatformCombo.select(0); |
| 216 |
} |
| 217 |
defaultPlatformCombo.setEnabled(!autodetectPlatformOS.getSelection()); |
| 218 |
|
| 219 |
defaultOSCombo = new Combo(platformOSContainer, SWT.READ_ONLY); |
| 220 |
if (null != repositoryConfiguration) { |
| 221 |
List<String> optionValues = repositoryConfiguration.getOSs(); |
| 222 |
for (String option : optionValues) { |
| 223 |
defaultOSCombo.add(option.toString()); |
| 224 |
} |
| 225 |
if (null != os && defaultOSCombo.indexOf(os) >= 0) { |
| 226 |
defaultOSCombo.select(defaultOSCombo.indexOf(os)); |
| 227 |
} else { |
| 228 |
// remove value if no longer exists and set to All! |
| 229 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_OS); |
| 230 |
defaultOSCombo.select(0); |
| 231 |
} |
| 232 |
} else { |
| 233 |
defaultOSCombo.add("All"); |
| 234 |
defaultOSCombo.select(0); |
| 235 |
} |
| 236 |
defaultOSCombo.setEnabled(!autodetectPlatformOS.getSelection()); |
| 237 |
|
| 148 |
} |
238 |
} |
| 149 |
|
239 |
|
| 150 |
public void setBugzillaVersion(String version) { |
240 |
public void setBugzillaVersion(String version) { |
|
Lines 184-189
Link Here
|
| 184 |
repository.setProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP, |
274 |
repository.setProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP, |
| 185 |
IBugzillaConstants.TIMESTAMP_NOT_AVAILABLE); |
275 |
IBugzillaConstants.TIMESTAMP_NOT_AVAILABLE); |
| 186 |
} |
276 |
} |
|
|
277 |
if (!autodetectPlatformOS.getSelection()) { |
| 278 |
repository.setProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM, |
| 279 |
String.valueOf(defaultPlatformCombo.getItem(defaultPlatformCombo.getSelectionIndex()))); |
| 280 |
repository.setProperty(IBugzillaConstants.BUGZILLA_DEF_OS, |
| 281 |
String.valueOf(defaultOSCombo.getItem(defaultOSCombo.getSelectionIndex()))); |
| 282 |
} else { |
| 283 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM); |
| 284 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_OS); |
| 285 |
} |
| 187 |
} |
286 |
} |
| 188 |
|
287 |
|
| 189 |
@Override |
288 |
@Override |