GUI: remove i2p proxy port, there is none with SAM

This commit is contained in:
sehraf 2020-11-06 15:45:47 +01:00
parent eb0aa340e3
commit e4336a8a41
No known key found for this signature in database
GPG Key ID: DF09F6EAE356B2C6
6 changed files with 18 additions and 50 deletions

View File

@ -150,7 +150,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
connect(ui.node_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.reuse_existing_node_CB, SIGNAL(toggled(bool)), this, SLOT(updateCheckLabels()));
connect(ui.cbUseBob, SIGNAL(clicked(bool)), this, SLOT(useBobChecked(bool)));;
connect(ui.cbUseBob, SIGNAL(clicked(bool)), this, SLOT(useI2pChecked(bool)));;
entropy_timer = new QTimer ;
entropy_timer->start(20) ;
@ -341,9 +341,9 @@ void GenCertDialog::setupState()
ui.hiddenport_spinBox->setVisible(hidden_state && !tor_auto);
ui.cbUseBob->setVisible(hidden_state && !tor_auto);
#ifndef RS_USE_I2P_BOB
#ifndef RS_USE_I2P_SAM3
ui.cbUseBob->setDisabled(true);
ui.cbUseBob->setToolTip(tr("BOB support is not available"));
ui.cbUseBob->setToolTip(tr("SAMv3 support is not available"));
#endif
if(!mAllFieldsOk)
@ -440,10 +440,10 @@ void GenCertDialog::updateCheckLabels()
setupState();
}
void GenCertDialog::useBobChecked(bool checked)
void GenCertDialog::useI2pChecked(bool checked)
{
if (checked) {
ui.hiddenaddr_input->setPlaceholderText(tr("I2P instance address with BOB enabled"));
ui.hiddenaddr_input->setPlaceholderText(tr("I2P instance address with SAMv3 enabled"));
ui.hiddenaddr_label->setText(tr("I2P instance address"));
ui.hiddenport_spinBox->setEnabled(false);

View File

@ -44,7 +44,7 @@ private slots:
void switchReuseExistingNode();
void grabMouse();
void updateCheckLabels();
void useBobChecked(bool checked);
void useI2pChecked(bool checked);
private:
void initKeyList();

View File

@ -496,7 +496,7 @@
<item>
<widget class="QCheckBox" name="cbUseBob">
<property name="text">
<string>Use BOB</string>
<string>Use I2P</string>
</property>
</widget>
</item>
@ -764,8 +764,8 @@
<tabstop>importIdentity_PB</tabstop>
</tabstops>
<resources>
<include location="icons.qrc"/>
<include location="images.qrc"/>
<include location="icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -184,10 +184,6 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
QObject::connect(ui.sbBobVarianceIn, SIGNAL(valueChanged(int)), this, SLOT(tunnelSettingsChanged(int)));
QObject::connect(ui.sbBobVarianceOut, SIGNAL(valueChanged(int)), this, SLOT(tunnelSettingsChanged(int)));
// These two spin boxes are used for the same thing - keep them in sync!
QObject::connect(ui.hiddenpage_proxyPort_i2p, SIGNAL(valueChanged(int)), this, SLOT(syncI2PProxyPortNormal(int)));
QObject::connect(ui.hiddenpage_proxyPort_i2p_2, SIGNAL(valueChanged(int)), this, SLOT(syncI2PProxyPortSam(int)));
// These two line edits are used for the same thing - keep them in sync!
QObject::connect(ui.hiddenpage_proxyAddress_i2p, SIGNAL(textChanged(QString)), this, SLOT(syncI2PProxyAddrNormal(QString)));
QObject::connect(ui.hiddenpage_proxyAddress_i2p_2, SIGNAL(textChanged(QString)), this, SLOT(syncI2PProxyAddrSam(QString)));
@ -1528,20 +1524,6 @@ void ServerPage::toggleSamAdvancedSettings(bool checked)
}
}
void ServerPage::syncI2PProxyPortNormal(int i)
{
ui.hiddenpage_proxyPort_i2p_2->setValue(i);
}
void ServerPage::syncI2PProxyPortSam(int i)
{
ui.hiddenpage_proxyPort_i2p->setValue(i);
// update port, not necessary for same, we just want to keep it consistent
saveSam();
rsAutoProxyMonitor::taskSync(autoProxyType::I2PSAM3, autoProxyTask::reloadConfig);
}
void ServerPage::syncI2PProxyAddrNormal(QString t)
{
ui.hiddenpage_proxyAddress_i2p_2->setText(t);
@ -1639,7 +1621,6 @@ void ServerPage::loadCommon()
whileBlocking(ui.hiddenpage_proxyAddress_i2p) -> setText(QString::fromStdString(proxyaddr));
whileBlocking(ui.hiddenpage_proxyAddress_i2p_2)->setText(QString::fromStdString(proxyaddr)); // this one is for sam tab
whileBlocking(ui.hiddenpage_proxyPort_i2p) -> setValue(proxyport);
whileBlocking(ui.hiddenpage_proxyPort_i2p_2)->setValue(proxyport); // this one is for sam tab
// don't use whileBlocking here
ui.cb_enableBob->setChecked(mSamSettings.enable);
@ -1727,7 +1708,7 @@ void ServerPage::updateStatusSam()
QString bobSimpleText = QString();
bobSimpleText.append(tr("RetroShare uses SAMv3 to set up a %1 tunnel at %2:%3\n(id: %4)\n\n"
"When changing options (e.g. port) use the buttons at the bottom to restart SAMv3.\n\n").
"When changing options use the buttons at the bottom to restart SAMv3.\n\n").
arg(mSamSettings.address.privateKey.empty() ? tr("client") : tr("server"),
ui.hiddenpage_proxyAddress_i2p_2->text(),
"7656",

View File

@ -108,9 +108,6 @@ private slots:
void toggleSamAdvancedSettings(bool checked);
void syncI2PProxyPortNormal(int i);
void syncI2PProxyPortSam(int i);
void syncI2PProxyAddrNormal(QString);
void syncI2PProxyAddrSam(QString);

View File

@ -982,27 +982,17 @@ If you have issues connecting over Tor check the Tor logs too.</string>
</widget>
</item>
<item>
<widget class="QLabel" name="i2pProxyPortLabel">
<property name="text">
<string>I2P proxy port</string>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="hiddenpage_proxyPort_i2p_2">
<property name="enabled">
<bool>false</bool>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Not required for SAMv3</string>
</property>
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="bobAccHLayout">