source: src/gui/proxysettingsdialog.cpp @ a023fd2

qt5
Last change on this file since a023fd2 was a023fd2, checked in by pavelpa <pavelpa@…>, 12 years ago

implemented 'proxy settings' dialog

  • user can secify proxy for network communication
  • Property mode set to 100644
File size: 985 bytes
Line 
1#include "proxysettingsdialog.h"
2
3#include <appsettings.h>
4#include <QDebug>
5
6ProxySettingsDialog::ProxySettingsDialog(QWidget *aParent)
7    : QDialog(aParent)
8{
9    setupUi(this);
10
11    // deserialize dialog data
12    address->setText(AppSettings::proxyAddress());
13    port->setValue(AppSettings::proxyPort());
14    directConnection->setChecked(AppSettings::isDirectConnection());
15
16    connect(okButton, SIGNAL(clicked()), SLOT(saveDialogData()));
17    connect(directConnection, SIGNAL(clicked(bool)), SLOT(connectionTypeChanged(bool)));
18
19    if(directConnection->isChecked())
20        proxyWidget->hide();
21}
22
23void ProxySettingsDialog::connectionTypeChanged(bool aState)
24{
25    aState ? proxyWidget->hide() : proxyWidget->show();
26}
27
28void ProxySettingsDialog::saveDialogData()
29{
30    // serialize dialog data
31    AppSettings::setProxyAddress(address->text());
32    AppSettings::setProxyPort(port->value());
33    AppSettings::setDirectConnection(directConnection->isChecked());
34
35    close();
36}
37
Note: See TracBrowser for help on using the repository browser.