]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/gui/mainwindow.cpp
implemented 'proxy settings' dialog
[toast/confclerk.git] / src / gui / mainwindow.cpp
index 8b650cc24d194f443466e111d695201be1e39045..15f507148a7e5a152f8bcf3fb3ad09d43b17fe87 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <QTreeView>
 #include <QFile>
+#include <QNetworkProxy>
 
 #include <sqlengine.h>
 
 #include "mapwindow.h"
 
 #include <tabcontainer.h>
+#include <appsettings.h>
+
+const QString PROXY_USERNAME;
+const QString PROXY_PASSWD;
 
 MainWindow::MainWindow(int aEventId, QWidget *aParent)
     : QMainWindow(aParent)
 {
     setupUi(this);
 
+    qDebug() << "Setting-up proxy: " << AppSettings::proxyAddress() << ":" << AppSettings::proxyPort();
+    QNetworkProxy proxy(
+            AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
+            AppSettings::proxyAddress(),
+            AppSettings::proxyPort(),
+            PROXY_USERNAME,
+            PROXY_PASSWD);
+    QNetworkProxy::setApplicationProxy(proxy);
+
     int confId = Conference::activeConference();
 
     connect(importScheduleWidget, SIGNAL(scheduleImported(int)), SLOT(scheduleImported(int)));