Browse Source

fixed

pull/61/head
Gitea 2 years ago
parent
commit
6ee6d92a96
  1. 4
      src/ServerTunnelPane.cpp
  2. 7
      src/ServerTunnelPane.h

4
src/ServerTunnelPane.cpp

@ -138,19 +138,21 @@ int ServerTunnelPane::appendServerTunnelForm(
tunnelGridLayout->addLayout(horizontalLayout_2); tunnelGridLayout->addLayout(horizontalLayout_2);
} }
if(type==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP) { {
std::string hostOverride = tunnelConfig->gethostOverride(); std::string hostOverride = tunnelConfig->gethostOverride();
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout(); QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
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);

7
src/ServerTunnelPane.h

@ -107,8 +107,7 @@ private:
inPortLabel->setText(QApplication::translate("srvTunForm", "InPort:", 0)); inPortLabel->setText(QApplication::translate("srvTunForm", "InPort:", 0));
cryptoTypeLabel->setText(QApplication::translate("srvTunForm", "Crypto type:", 0)); cryptoTypeLabel->setText(QApplication::translate("srvTunForm", "Crypto type:", 0));
accessListLabel->setText(QApplication::translate("srvTunForm", "Access list:", 0)); accessListLabel->setText(QApplication::translate("srvTunForm", "Access list:", 0));
if(tunnelConfig->getType()==i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTP) hostOverrideLabel->setText(QApplication::translate("srvTunForm", "Host override:", 0));
hostOverrideLabel->setText(QApplication::translate("srvTunForm", "Host override:", 0));
webIRCPassLabel->setText(QApplication::translate("srvTunForm", "WebIRC password:", 0)); webIRCPassLabel->setText(QApplication::translate("srvTunForm", "WebIRC password:", 0));
addressLabel->setText(QApplication::translate("srvTunForm", "Address:", 0)); addressLabel->setText(QApplication::translate("srvTunForm", "Address:", 0));
@ -181,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