# HG changeset patch # User lbajardsilogic # Date 1178898153 0 # Node ID f1602cb4cd0b405b55ede368ebc313d7339fd55c # Parent 9e054206ed97c1e08d1c9a88ac5d2ee6ec412080 add connection setting information reading and saving diff -r 9e054206ed97 -r f1602cb4cd0b widgets/ConnectionSettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/ConnectionSettings.cpp Fri May 11 15:42:33 2007 +0000 @@ -0,0 +1,100 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* Sound Access + EASAIER client application. + Silogic 2007. Laure Bajard. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "ConnectionSettings.h" + +#include +#include +#include + +ConnectionSettings::ConnectionSettings(HttpClient * httpClient) : QDialog(), + m_httpClient(httpClient) +{ + m_proxyBox = new QGroupBox(tr("Use Proxy")); + m_proxyBox->setCheckable(true); + m_proxyBox->setChecked(m_httpClient->useProxy()); + + if (useProxy()) + { + m_proxy.setText(m_httpClient->getProxy()); + m_proxyPort.setText(QString::number(m_httpClient->getProxyPort())); + m_userProxyId.setText(m_httpClient->getUserProxyId()); + m_pwdProxyId.setText(m_httpClient->getPwdProxyId()); + } + + m_pwdProxyId.setEchoMode(QLineEdit::Password); + + QGroupBox *hostBox = new QGroupBox(tr("Database host")); + + m_host.setText(m_httpClient->getHost()); + m_hostPort.setText(QString::number(m_httpClient->getHostPort())); + + QPushButton* ok = new QPushButton(tr("Ok")); + QPushButton* cancel = new QPushButton(tr("Cancel")); + + QHBoxLayout *proxyLayout = new QHBoxLayout; + proxyLayout->addStretch(1); + proxyLayout->addWidget(new QLabel(tr("Proxy : "))); + proxyLayout->addWidget(&m_proxy); + proxyLayout->addWidget(new QLabel(tr("Port : "))); + proxyLayout->addWidget(&m_proxyPort); + + QHBoxLayout *userLayout = new QHBoxLayout; + userLayout->addWidget(new QLabel(tr("User name:"))); + userLayout->addWidget(&m_userProxyId); + + QHBoxLayout *pwdLayout = new QHBoxLayout; + pwdLayout->addWidget(new QLabel(tr("Password:"))); + pwdLayout->addWidget(&m_pwdProxyId); + + QVBoxLayout *proxyBoxLayout = new QVBoxLayout; + proxyBoxLayout->addLayout(proxyLayout); + proxyBoxLayout->addLayout(userLayout); + proxyBoxLayout->addLayout(pwdLayout); + m_proxyBox->setLayout(proxyBoxLayout); + + QHBoxLayout *hostLayout = new QHBoxLayout; + hostLayout->addWidget(new QLabel(tr("Host :"))); + hostLayout->addWidget(&m_host); + hostLayout->addWidget(new QLabel(tr("Port :"))); + hostLayout->addWidget(&m_hostPort); + hostBox->setLayout(hostLayout); + + QHBoxLayout *buttonLayout = new QHBoxLayout; + buttonLayout->addStretch(1); + buttonLayout->addWidget(ok); + buttonLayout->addWidget(cancel); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(m_proxyBox); + mainLayout->addSpacing(5); + mainLayout->addWidget(hostBox); + mainLayout->addLayout(buttonLayout); + setLayout(mainLayout); + + connect(ok, SIGNAL(clicked()), this, SLOT(valuesChanged())); + connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + + setWindowTitle(tr("Connection settings")); + show(); +} + +ConnectionSettings::~ConnectionSettings() { +} + +void ConnectionSettings::valuesChanged() +{ + m_httpClient->valuesChanged(this); + + close(); +} diff -r 9e054206ed97 -r f1602cb4cd0b widgets/ConnectionSettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/ConnectionSettings.h Fri May 11 15:42:33 2007 +0000 @@ -0,0 +1,60 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* Sound Access + EASAIER client application. + Silogic 2007. Laure Bajard. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef _CONNECTION_SETTINGS_H_ +#define _CONNECTION_SETTINGS_H_ + +#include +#include +#include + +#include "data/fileio/HttpClient.h" + +class HttpClient; + +class ConnectionSettings : public QDialog { + + Q_OBJECT + +public: + ConnectionSettings(HttpClient * httpClient); + virtual ~ConnectionSettings(); + + inline bool useProxy() const {return m_proxyBox->isChecked();} + inline QString getProxy() const {return m_proxy.text();} + inline QString getProxyPort() const {return m_proxyPort.text();} + inline QString getUserProxyId() const {return m_userProxyId.text();} + inline QString getPwdProxyId() const {return m_pwdProxyId.text();} + + inline QString getHost() const {return m_host.text();} + inline QString getHostPort() const {return m_hostPort.text();} + +public slots: + void valuesChanged(); + +protected: + + QGroupBox *m_proxyBox; + + QLineEdit m_proxy; + QLineEdit m_proxyPort; + QLineEdit m_userProxyId; + QLineEdit m_pwdProxyId; + + QLineEdit m_host; + QLineEdit m_hostPort; + + HttpClient *m_httpClient; +}; + +#endif \ No newline at end of file diff -r 9e054206ed97 -r f1602cb4cd0b widgets/svwidgets.vcproj --- a/widgets/svwidgets.vcproj Fri May 11 15:40:34 2007 +0000 +++ b/widgets/svwidgets.vcproj Fri May 11 15:42:33 2007 +0000 @@ -43,7 +43,7 @@ Name="VCCLCompilerTool" AdditionalOptions="-Zm200 -EHsc" Optimization="2" - AdditionalIncludeDirectories=""$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\QtXml";"$(QTDIR)\include";.;..;"$(QTDIR)\include\ActiveQt";tmp_moc;"$(QTDIR)\mkspecs\win32-msvc2005";"$(EASAIER_UTILS_DIR)\vamp-plugin-sdk\vamp-plugin-sdk-1.0";"$(EASAIER_UTILS_DIR)\fftw3\fftw3.1.2"" + AdditionalIncludeDirectories=""$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\QtXml";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include";.;..;"$(QTDIR)\include\ActiveQt";tmp_moc;"$(QTDIR)\mkspecs\win32-msvc2005";"$(EASAIER_UTILS_DIR)\vamp-plugin-sdk\vamp-plugin-sdk-1.0";"$(EASAIER_UTILS_DIR)\fftw3\fftw3.1.2"" PreprocessorDefinitions="NDEBUG;BUILD_RELEASE;UNICODE;_UNICODE;_WINDOWS;QT_LARGEFILE_SUPPORT;WIN32;HAVE_BZ2;HAVE_PORTAUDIO;HAVE_PORTAUDIO_V18;HAVE_OGGZ;HAVE_FISHSOUND;HAVE_FFTW3F;HAVE_VAMP;HAVE_VAMP_HOSTSDK;HAVE_SNDFILE;HAVE_SAMPLERATE;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG;QT_XML_LIB;QT_GUI_LIB;QT_CORE_LIB;USE_VC;_USE_MATH_DEFINES" GeneratePreprocessedFile="0" MinimalRebuild="false" @@ -119,7 +119,7 @@ Name="VCCLCompilerTool" AdditionalOptions="-Zm200 -EHsc" Optimization="0" - AdditionalIncludeDirectories=""$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\QtXml";"$(QTDIR)\include";.;..;..\sv;"$(QTDIR)\include\ActiveQt";tmp_moc;"$(QTDIR)\mkspecs\win32-msvc2005";"$(EASAIER_UTILS_DIR)\vamp-plugin-sdk\vamp-plugin-sdk-1.0";"$(EASAIER_UTILS_DIR)\fftw3\fftw3.1.2"" + AdditionalIncludeDirectories=""$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\QtXml";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include";.;..;..\sv;"$(QTDIR)\include\ActiveQt";tmp_moc;"$(QTDIR)\mkspecs\win32-msvc2005";"$(EASAIER_UTILS_DIR)\vamp-plugin-sdk\vamp-plugin-sdk-1.0";"$(EASAIER_UTILS_DIR)\fftw3\fftw3.1.2"" PreprocessorDefinitions="BUILD_DEBUG;UNICODE;_UNICODE;_WINDOWS;QT_LARGEFILE_SUPPORT;WIN32;HAVE_BZ2;HAVE_PORTAUDIO;HAVE_PORTAUDIO_V18;HAVE_OGGZ;HAVE_FISHSOUND;HAVE_FFTW3F;HAVE_VAMP;HAVE_VAMP_HOSTSDK;HAVE_SNDFILE;HAVE_SAMPLERATE;QT_THREAD_SUPPORT;QT_DLL;QT_XML_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_CORE_LIB;USE_VC;_USE_MATH_DEFINES" GeneratePreprocessedFile="0" MinimalRebuild="false" @@ -182,6 +182,10 @@ > + + @@ -298,7 +302,7 @@ @@ -309,7 +313,7 @@ @@ -342,7 +346,7 @@ + + + + + + + + @@ -413,7 +443,7 @@ @@ -766,7 +796,7 @@ @@ -777,7 +807,7 @@ @@ -818,7 +848,7 @@ @@ -829,7 +859,7 @@ @@ -922,7 +952,7 @@ @@ -933,7 +963,7 @@ @@ -1006,6 +1036,10 @@ > + + diff -r 9e054206ed97 -r f1602cb4cd0b widgets/widgets.pro --- a/widgets/widgets.pro Fri May 11 15:40:34 2007 +0000 +++ b/widgets/widgets.pro Fri May 11 15:42:33 2007 +0000 @@ -40,7 +40,8 @@ InfoWidget.h \ QueryResultsWidget.h \ SearchWidget.h \ - WidgetGallery.h + WidgetGallery.h \ + ConnectionSettings.h SOURCES += AudioDial.cpp \ Fader.cpp \ ItemEditDialog.cpp \ @@ -67,4 +68,5 @@ InfoWidget.cpp \ QueryResultsWidget.cpp \ SearchWidget.cpp \ - WidgetGallery.cpp + WidgetGallery.cpp \ + ConnectionSettings.cpp