Révision 2332
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java (revision 2332) | ||
|---|---|---|
| 429 | 429 |
|
| 430 | 430 |
private static void showWorkspaceError(String message) {
|
| 431 | 431 |
MessageBox messageBox = new MessageBox(new Shell(), SWT.DIALOG_TRIM | SWT.ERROR); |
| 432 |
messageBox.setText("TXM start Error");
|
|
| 432 |
messageBox.setText("TXM starting error");
|
|
| 433 | 433 |
messageBox.setMessage(message); |
| 434 | 434 |
messageBox.open(); |
| 435 | 435 |
} |
| ... | ... | |
| 448 | 448 |
* Activates the proxy service and sets the network connection active provider as native. |
| 449 | 449 |
*/ |
| 450 | 450 |
private void activateProxyService() {
|
| 451 |
String sys_proxy_host = System.getProperty("http.proxyHost"); // must be called before IProxyService is used
|
|
| 451 |
String systemProxyHost = System.getProperty("http.proxyHost"); // must be called before IProxyService is used
|
|
| 452 | 452 |
|
| 453 | 453 |
Bundle bundle = Platform.getBundle("org.eclipse.ui.ide"); //$NON-NLS-1$
|
| 454 | 454 |
IProxyService proxyService = null; |
| ... | ... | |
| 462 | 462 |
} else {
|
| 463 | 463 |
//System.out.println("FIRST RUN TEST RESULT: "+ApplicationWorkbenchAdvisor.firstLaunchAfterInstallation());
|
| 464 | 464 |
// force active provider as "Manual" on Mac OS X |
| 465 |
if (Util.isMac() && sys_proxy_host != null && ApplicationWorkbenchAdvisor.testTXMHOMEPreferenceAndDirectory()) {
|
|
| 466 |
System.out.println("System proxy detected. Force network provider to manual with proxy_host="+sys_proxy_host);
|
|
| 465 |
if (Util.isMac() && systemProxyHost != null && ApplicationWorkbenchAdvisor.testTXMHOMEPreferenceAndDirectory()) {
|
|
| 466 |
System.out.println("System proxy detected. Force network provider to manual with proxy_host=" + systemProxyHost);
|
|
| 467 | 467 |
proxyService.setProxiesEnabled(true); |
| 468 | 468 |
} |
| 469 | 469 |
|
| 470 |
if (Util.isMac()) { // configure only for Mac OS X
|
|
| 471 |
// String proxy_conf = ""; |
|
| 472 |
// ProxyConf conf = new ProxyConf(this); |
|
| 473 |
// if (conf.mustSetProxyConfiguration()) { // there is a system proxy configured
|
|
| 474 |
// System.out.println(Messages.bind(Messages.Application_11, proxy_conf)); |
|
| 475 |
// proxyService.setProxiesEnabled(true); |
|
| 476 |
// //proxyService.setSystemProxiesEnabled(false); |
|
| 477 |
// |
|
| 478 |
// // prepare a new proxy configuration |
|
| 479 |
// boolean requiresAuthentication = conf.proxy_user != null && conf.proxy_user.length() > 0; |
|
| 480 |
// IProxyData[] proxies = new IProxyData[1]; |
|
| 481 |
// proxies[0] = new ProxyData(IProxyData.HTTP_PROXY_TYPE, conf.proxy_host, conf.proxy_port, requiresAuthentication, ""); |
|
| 482 |
// proxies[0].setPassword(conf.proxy_password); |
|
| 483 |
// proxies[0].setUserid(conf.proxy_user); |
|
| 484 |
// |
|
| 485 |
// try {
|
|
| 486 |
// proxyService.setProxyData(proxies); // apply the new proxy configuration |
|
| 487 |
// System.out.println("TXM proxy configuration set: "+Arrays.toString(proxies));
|
|
| 488 |
// } catch (Exception e) {
|
|
| 489 |
// System.out.println("Failed to set TXM proxy configuration: "+Arrays.toString(proxies));
|
|
| 490 |
// Log.printStackTrace(e); |
|
| 491 |
// } |
|
| 492 |
// } |
|
| 493 |
} |
|
| 470 |
// if (Util.isMac()) { // configure only for Mac OS X
|
|
| 471 |
// // String proxy_conf = "";
|
|
| 472 |
// // ProxyConf conf = new ProxyConf(this);
|
|
| 473 |
// // if (conf.mustSetProxyConfiguration()) { // there is a system proxy configured
|
|
| 474 |
// // System.out.println(Messages.bind(Messages.Application_11, proxy_conf));
|
|
| 475 |
// // proxyService.setProxiesEnabled(true);
|
|
| 476 |
// // //proxyService.setSystemProxiesEnabled(false);
|
|
| 477 |
// //
|
|
| 478 |
// // // prepare a new proxy configuration
|
|
| 479 |
// // boolean requiresAuthentication = conf.proxy_user != null && conf.proxy_user.length() > 0;
|
|
| 480 |
// // IProxyData[] proxies = new IProxyData[1];
|
|
| 481 |
// // proxies[0] = new ProxyData(IProxyData.HTTP_PROXY_TYPE, conf.proxy_host, conf.proxy_port, requiresAuthentication, "");
|
|
| 482 |
// // proxies[0].setPassword(conf.proxy_password);
|
|
| 483 |
// // proxies[0].setUserid(conf.proxy_user);
|
|
| 484 |
// //
|
|
| 485 |
// // try {
|
|
| 486 |
// // proxyService.setProxyData(proxies); // apply the new proxy configuration
|
|
| 487 |
// // System.out.println("TXM proxy configuration set: "+Arrays.toString(proxies));
|
|
| 488 |
// // } catch (Exception e) {
|
|
| 489 |
// // System.out.println("Failed to set TXM proxy configuration: "+Arrays.toString(proxies));
|
|
| 490 |
// // Log.printStackTrace(e);
|
|
| 491 |
// // }
|
|
| 492 |
// // }
|
|
| 493 |
// }
|
|
| 494 | 494 |
} |
| 495 | 495 |
} |
| 496 | 496 |
|
Formats disponibles : Unified diff