mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
Set Application Proxy from Operating System
Uses the QT proxy query and application wide proxy setting to allow users behind a corporate firewall to use network functions (maps, TP.com, ergDB etc). Fixes #27.
This commit is contained in:
@@ -134,6 +134,13 @@ MainWindow::MainWindow(const QDir &home) :
|
||||
|
||||
mainwindows.append(this); // add us to the list of open windows
|
||||
|
||||
// Network proxy
|
||||
QNetworkProxyQuery npq(QUrl("http://www.google.com"));
|
||||
QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::systemProxyForQuery(npq);
|
||||
if (listOfProxies.count() > 0) {
|
||||
QNetworkProxy::setApplicationProxy(listOfProxies.first());
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Basic GUI setup
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
@@ -27,7 +27,7 @@ ConfigurationPage::ConfigurationPage(MainWindow *main) : main(main)
|
||||
intervalMetrics = new IntervalMetricsPage;
|
||||
metadataPage = new MetadataPage(main);
|
||||
measuresPage = new MeasuresPage(main);
|
||||
proxyPage = new ProxyPage(this, main);
|
||||
//proxyPage = new ProxyPage(this, main); // we use system settings
|
||||
|
||||
tabs->addTab(config, tr("Settings"));
|
||||
tabs->addTab(colorsPage, tr("Appearance"));
|
||||
@@ -35,7 +35,7 @@ ConfigurationPage::ConfigurationPage(MainWindow *main) : main(main)
|
||||
tabs->addTab(intervalMetrics, tr("Interval Metrics"));
|
||||
tabs->addTab(metadataPage, tr("Ride Data"));
|
||||
tabs->addTab(measuresPage, tr("Athlete Data"));
|
||||
tabs->addTab(proxyPage, tr("Proxy"));
|
||||
//tabs->addTab(proxyPage, tr("Proxy")); // we use system settings
|
||||
|
||||
langLabel = new QLabel(tr("Language:"));
|
||||
|
||||
@@ -247,7 +247,7 @@ ConfigurationPage::saveClicked()
|
||||
intervalMetrics->saveClicked();
|
||||
metadataPage->saveClicked();
|
||||
measuresPage->saveClicked();
|
||||
proxyPage->saveClicked();
|
||||
//proxyPage->saveClicked(); // We use system settings
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user