Browse Source

Merge pull request #61 from nonlin-lin-chaos-order-etc-etal/patch3

fixed #40
pull/63/head
R4SAS 2 years ago committed by GitHub
parent
commit
49a2e3afa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/ServerTunnelPane.cpp
  2. 8
      src/ServerTunnelPane.h

5
src/ServerTunnelPane.cpp

@ -31,8 +31,8 @@ int ServerTunnelPane::appendServerTunnelForm(
gridLayoutWidget_2->setGeometry(QRect(0, 0, 561, h)); gridLayoutWidget_2->setGeometry(QRect(0, 0, 561, h));
serverTunnelNameGroupBox->setGeometry(QRect(0, 0, 561, h)); serverTunnelNameGroupBox->setGeometry(QRect(0, 0, 561, h));
{
const QString& type = tunnelConfig->getType(); const QString& type = tunnelConfig->getType();
{
int index=0; int index=0;
if(type==i2p::client::I2P_TUNNELS_SECTION_TYPE_SERVER)tunnelTypeComboBox->setCurrentIndex(index); if(type==i2p::client::I2P_TUNNELS_SECTION_TYPE_SERVER)tunnelTypeComboBox->setCurrentIndex(index);
++index; ++index;
@ -137,6 +137,7 @@ int ServerTunnelPane::appendServerTunnelForm(
horizontalLayout_2->addItem(horizontalSpacer); horizontalLayout_2->addItem(horizontalSpacer);
tunnelGridLayout->addLayout(horizontalLayout_2); tunnelGridLayout->addLayout(horizontalLayout_2);
} }
{ {
std::string hostOverride = tunnelConfig->gethostOverride(); std::string hostOverride = tunnelConfig->gethostOverride();
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout(); QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
@ -144,12 +145,14 @@ int ServerTunnelPane::appendServerTunnelForm(
ui.hostOverrideLabel = new QLabel(gridLayoutWidget_2); ui.hostOverrideLabel = new QLabel(gridLayoutWidget_2);
hostOverrideLabel->setObjectName(QStringLiteral("hostOverrideLabel")); hostOverrideLabel->setObjectName(QStringLiteral("hostOverrideLabel"));
horizontalLayout_2->addWidget(hostOverrideLabel); horizontalLayout_2->addWidget(hostOverrideLabel);
hostOverrideLabel->setEnabled(type==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP);
ui.hostOverrideLineEdit = new QLineEdit(gridLayoutWidget_2); ui.hostOverrideLineEdit = new QLineEdit(gridLayoutWidget_2);
hostOverrideLineEdit->setObjectName(QStringLiteral("hostOverrideLineEdit")); hostOverrideLineEdit->setObjectName(QStringLiteral("hostOverrideLineEdit"));
hostOverrideLineEdit->setText(hostOverride.c_str()); hostOverrideLineEdit->setText(hostOverride.c_str());
QObject::connect(hostOverrideLineEdit, SIGNAL(textChanged(const QString &)), QObject::connect(hostOverrideLineEdit, SIGNAL(textChanged(const QString &)),
this, SLOT(updated())); this, SLOT(updated()));
horizontalLayout_2->addWidget(hostOverrideLineEdit); horizontalLayout_2->addWidget(hostOverrideLineEdit);
hostOverrideLineEdit->setEnabled(type==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP);
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer); horizontalLayout_2->addItem(horizontalSpacer);
tunnelGridLayout->addLayout(horizontalLayout_2); tunnelGridLayout->addLayout(horizontalLayout_2);

8
src/ServerTunnelPane.h

@ -131,7 +131,9 @@ protected:
if(!isValidSingleLine(keysLineEdit))return false; if(!isValidSingleLine(keysLineEdit))return false;
if(!isValidSingleLine(inPortLineEdit))return false; if(!isValidSingleLine(inPortLineEdit))return false;
if(!isValidSingleLine(accessListLineEdit))return false; if(!isValidSingleLine(accessListLineEdit))return false;
if(stc->getType()==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP) {
if(!isValidSingleLine(hostOverrideLineEdit))return false; if(!isValidSingleLine(hostOverrideLineEdit))return false;
}
if(!isValidSingleLine(webIRCPassLineEdit))return false; if(!isValidSingleLine(webIRCPassLineEdit))return false;
if(!isValidSingleLine(addressLineEdit))return false; if(!isValidSingleLine(addressLineEdit))return false;
@ -165,7 +167,9 @@ protected:
stc->setaccessList(accessListLineEdit->text().toStdString()); stc->setaccessList(accessListLineEdit->text().toStdString());
if(stc->getType()==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP) {
stc->sethostOverride(hostOverrideLineEdit->text().toStdString()); stc->sethostOverride(hostOverrideLineEdit->text().toStdString());
}
stc->setwebircpass(webIRCPassLineEdit->text().toStdString()); stc->setwebircpass(webIRCPassLineEdit->text().toStdString());
@ -176,6 +180,10 @@ protected:
stc->setisUniqueLocal(isUniqueLocalCheckBox->isChecked()); stc->setisUniqueLocal(isUniqueLocalCheckBox->isChecked());
stc->setsigType(readSigTypeComboboxUI(sigTypeComboBox)); stc->setsigType(readSigTypeComboboxUI(sigTypeComboBox));
hostOverrideLabel->setEnabled(stc->getType()==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP);
hostOverrideLineEdit->setEnabled(stc->getType()==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP);
return true; return true;
} }
}; };

Loading…
Cancel
Save