mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
fixed loading of settings::Server page
This commit is contained in:
parent
27db797a9f
commit
0e57874ad3
3 changed files with 86 additions and 79 deletions
|
@ -214,7 +214,6 @@ int pqissllistenbase::setuplisten()
|
||||||
if (!mPeerMgr->isHidden()) std::cerr << "Zeroed tmpaddr: " << sockaddr_storage_tostring(tmpaddr) << std::endl;
|
if (!mPeerMgr->isHidden()) std::cerr << "Zeroed tmpaddr: " << sockaddr_storage_tostring(tmpaddr) << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit(1);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -70,19 +70,6 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
|
||||||
ui.whiteListIpsTable->setColumnHidden(COLUMN_STATUS,true) ;
|
ui.whiteListIpsTable->setColumnHidden(COLUMN_STATUS,true) ;
|
||||||
ui.whiteListIpsTable->verticalHeader()->hide() ;
|
ui.whiteListIpsTable->verticalHeader()->hide() ;
|
||||||
|
|
||||||
QObject::connect(ui.filteredIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipFilterContextMenu(const QPoint&))) ;
|
|
||||||
QObject::connect(ui.whiteListIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipWhiteListContextMenu(const QPoint&))) ;
|
|
||||||
QObject::connect(ui.denyAll_CB,SIGNAL(toggled(bool)),this,SLOT(toggleIpFiltering(bool)));
|
|
||||||
QObject::connect(ui.includeFromDHT_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeDHT(bool)));
|
|
||||||
QObject::connect(ui.includeFromFriends_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeFriends(bool)));
|
|
||||||
QObject::connect(ui.groupIPRanges_CB,SIGNAL(toggled(bool)),this,SLOT(toggleGroupIps(bool)));
|
|
||||||
QObject::connect(ui.groupIPRanges_SB,SIGNAL(valueChanged(int)),this,SLOT(setGroupIpLimit(int)));
|
|
||||||
QObject::connect(ui.ipInputAddBlackList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToBlackList()));
|
|
||||||
QObject::connect(ui.ipInputAddWhiteList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToWhiteList()));
|
|
||||||
QObject::connect(ui.ipInput_LE,SIGNAL(textChanged(const QString&)),this,SLOT(checkIpRange(const QString&)));
|
|
||||||
QObject::connect(ui.filteredIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedBlackListIP(int,int,int,int)));
|
|
||||||
QObject::connect(ui.whiteListIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedWhiteListIP(int,int,int,int)));
|
|
||||||
|
|
||||||
QTimer *timer = new QTimer(this);
|
QTimer *timer = new QTimer(this);
|
||||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||||
timer->start(1000);
|
timer->start(1000);
|
||||||
|
@ -102,6 +89,22 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
|
||||||
|
|
||||||
ui.hiddenpage_incoming->setVisible(false);
|
ui.hiddenpage_incoming->setVisible(false);
|
||||||
|
|
||||||
|
QObject::connect(ui.filteredIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipFilterContextMenu(const QPoint&))) ;
|
||||||
|
QObject::connect(ui.whiteListIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipWhiteListContextMenu(const QPoint&))) ;
|
||||||
|
QObject::connect(ui.denyAll_CB,SIGNAL(toggled(bool)),this,SLOT(toggleIpFiltering(bool)));
|
||||||
|
QObject::connect(ui.includeFromDHT_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeDHT(bool)));
|
||||||
|
QObject::connect(ui.includeFromFriends_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeFriends(bool)));
|
||||||
|
QObject::connect(ui.groupIPRanges_CB,SIGNAL(toggled(bool)),this,SLOT(toggleGroupIps(bool)));
|
||||||
|
QObject::connect(ui.groupIPRanges_SB,SIGNAL(valueChanged(int)),this,SLOT(setGroupIpLimit(int)));
|
||||||
|
QObject::connect(ui.ipInputAddBlackList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToBlackList()));
|
||||||
|
QObject::connect(ui.ipInputAddWhiteList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToWhiteList()));
|
||||||
|
QObject::connect(ui.ipInput_LE,SIGNAL(textChanged(const QString&)),this,SLOT(checkIpRange(const QString&)));
|
||||||
|
QObject::connect(ui.filteredIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedBlackListIP(int,int,int,int)));
|
||||||
|
QObject::connect(ui.whiteListIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedWhiteListIP(int,int,int,int)));
|
||||||
|
|
||||||
|
QObject::connect(ui.localPort,SIGNAL(valueChanged(int)),this,SLOT(saveAddresses()));
|
||||||
|
QObject::connect(ui.extPort,SIGNAL(valueChanged(int)),this,SLOT(saveAddresses()));
|
||||||
|
|
||||||
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
|
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
|
||||||
connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
|
connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
|
||||||
connect( ui.cleanKnownIPs_PB, SIGNAL( clicked( ) ), this, SLOT( clearKnownAddressList() ) );
|
connect( ui.cleanKnownIPs_PB, SIGNAL( clicked( ) ), this, SLOT( clearKnownAddressList() ) );
|
||||||
|
@ -225,20 +228,28 @@ void ServerPage::load()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadFilteredIps() ;
|
// (csoler) Disabling some signals in this block in order to avoid
|
||||||
|
// some nasty feedback.
|
||||||
ui.netModeComboBox->show() ;
|
|
||||||
ui.textlabel_upnp->show();
|
|
||||||
ui.iconlabel_upnp->show();
|
|
||||||
ui.label_nat->show();
|
|
||||||
|
|
||||||
ui.textlabel_hiddenMode->hide() ;
|
|
||||||
ui.iconlabel_hiddenMode->hide() ;
|
|
||||||
|
|
||||||
/* set net mode */
|
|
||||||
int netIndex = 0;
|
|
||||||
switch(detail.netMode)
|
|
||||||
{
|
{
|
||||||
|
ui.localPort->blockSignals(true);
|
||||||
|
ui.extPort->blockSignals(true);
|
||||||
|
ui.localAddress->blockSignals(true);
|
||||||
|
ui.extAddress->blockSignals(true);
|
||||||
|
|
||||||
|
loadFilteredIps() ;
|
||||||
|
|
||||||
|
ui.netModeComboBox->show() ;
|
||||||
|
ui.textlabel_upnp->show();
|
||||||
|
ui.iconlabel_upnp->show();
|
||||||
|
ui.label_nat->show();
|
||||||
|
|
||||||
|
ui.textlabel_hiddenMode->hide() ;
|
||||||
|
ui.iconlabel_hiddenMode->hide() ;
|
||||||
|
|
||||||
|
/* set net mode */
|
||||||
|
int netIndex = 0;
|
||||||
|
switch(detail.netMode)
|
||||||
|
{
|
||||||
case RS_NETMODE_EXT:
|
case RS_NETMODE_EXT:
|
||||||
netIndex = 2;
|
netIndex = 2;
|
||||||
break;
|
break;
|
||||||
|
@ -249,80 +260,77 @@ void ServerPage::load()
|
||||||
case RS_NETMODE_UPNP:
|
case RS_NETMODE_UPNP:
|
||||||
netIndex = 0;
|
netIndex = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ui.netModeComboBox->setCurrentIndex(netIndex);
|
ui.netModeComboBox->setCurrentIndex(netIndex);
|
||||||
|
|
||||||
/* DHT + Discovery: (public)
|
/* DHT + Discovery: (public)
|
||||||
* Discovery only: (private)
|
* Discovery only: (private)
|
||||||
* DHT only: (inverted)
|
* DHT only: (inverted)
|
||||||
* None: (dark net)
|
* None: (dark net)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
netIndex = 3; // NONE.
|
netIndex = 3; // NONE.
|
||||||
if (detail.vs_dht != RS_VS_DHT_OFF)
|
if (detail.vs_dht != RS_VS_DHT_OFF)
|
||||||
{
|
|
||||||
if (detail.vs_disc != RS_VS_DISC_OFF)
|
|
||||||
{
|
{
|
||||||
netIndex = 0; // PUBLIC
|
if (detail.vs_disc != RS_VS_DISC_OFF)
|
||||||
|
netIndex = 0; // PUBLIC
|
||||||
|
else
|
||||||
|
netIndex = 2; // INVERTED
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
netIndex = 2; // INVERTED
|
if (detail.vs_disc != RS_VS_DISC_OFF)
|
||||||
|
netIndex = 1; // PRIVATE
|
||||||
|
else
|
||||||
|
netIndex = 3; // NONE
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (detail.vs_disc != RS_VS_DISC_OFF)
|
|
||||||
{
|
|
||||||
netIndex = 1; // PRIVATE
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
netIndex = 3; // NONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.discComboBox->setCurrentIndex(netIndex);
|
ui.discComboBox->setCurrentIndex(netIndex);
|
||||||
|
|
||||||
int dlrate = 0;
|
int dlrate = 0;
|
||||||
int ulrate = 0;
|
int ulrate = 0;
|
||||||
rsConfig->GetMaxDataRates(dlrate, ulrate);
|
rsConfig->GetMaxDataRates(dlrate, ulrate);
|
||||||
ui.totalDownloadRate->setValue(dlrate);
|
ui.totalDownloadRate->setValue(dlrate);
|
||||||
ui.totalUploadRate->setValue(ulrate);
|
ui.totalUploadRate->setValue(ulrate);
|
||||||
|
|
||||||
toggleUPnP();
|
toggleUPnP();
|
||||||
|
|
||||||
|
/* Addresses must be set here - otherwise can't edit it */
|
||||||
/* Addresses must be set here - otherwise can't edit it */
|
|
||||||
/* set local address */
|
/* set local address */
|
||||||
ui.localAddress->setText(QString::fromStdString(detail.localAddr));
|
ui.localAddress->setText(QString::fromStdString(detail.localAddr));
|
||||||
ui.localPort -> setValue(detail.localPort);
|
ui.localPort -> setValue(detail.localPort);
|
||||||
/* set the server address */
|
/* set the server address */
|
||||||
ui.extAddress->setText(QString::fromStdString(detail.extAddr));
|
ui.extAddress->setText(QString::fromStdString(detail.extAddr));
|
||||||
ui.extPort -> setValue(detail.extPort);
|
ui.extPort -> setValue(detail.extPort);
|
||||||
/* set DynDNS */
|
/* set DynDNS */
|
||||||
ui.dynDNS -> setText(QString::fromStdString(detail.dyndns));
|
ui.dynDNS -> setText(QString::fromStdString(detail.dyndns));
|
||||||
|
|
||||||
ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC);
|
ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC);
|
||||||
|
|
||||||
ui.ipAddressList->clear();
|
ui.ipAddressList->clear();
|
||||||
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
|
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
|
||||||
ui.ipAddressList->addItem(QString::fromStdString(*it));
|
ui.ipAddressList->addItem(QString::fromStdString(*it));
|
||||||
|
|
||||||
/* HIDDEN PAGE SETTINGS - only Proxy (outgoing) */
|
/* HIDDEN PAGE SETTINGS - only Proxy (outgoing) */
|
||||||
std::string proxyaddr;
|
std::string proxyaddr;
|
||||||
uint16_t proxyport;
|
uint16_t proxyport;
|
||||||
uint32_t status ;
|
uint32_t status ;
|
||||||
// Tor
|
// Tor
|
||||||
rsPeers->getProxyServer(RS_HIDDEN_TYPE_TOR, proxyaddr, proxyport, status);
|
rsPeers->getProxyServer(RS_HIDDEN_TYPE_TOR, proxyaddr, proxyport, status);
|
||||||
ui.hiddenpage_proxyAddress_tor -> setText(QString::fromStdString(proxyaddr));
|
ui.hiddenpage_proxyAddress_tor -> setText(QString::fromStdString(proxyaddr));
|
||||||
ui.hiddenpage_proxyPort_tor -> setValue(proxyport);
|
ui.hiddenpage_proxyPort_tor -> setValue(proxyport);
|
||||||
// I2P
|
// I2P
|
||||||
rsPeers->getProxyServer(RS_HIDDEN_TYPE_I2P, proxyaddr, proxyport, status);
|
rsPeers->getProxyServer(RS_HIDDEN_TYPE_I2P, proxyaddr, proxyport, status);
|
||||||
ui.hiddenpage_proxyAddress_i2p -> setText(QString::fromStdString(proxyaddr));
|
ui.hiddenpage_proxyAddress_i2p -> setText(QString::fromStdString(proxyaddr));
|
||||||
ui.hiddenpage_proxyPort_i2p -> setValue(proxyport);
|
ui.hiddenpage_proxyPort_i2p -> setValue(proxyport);
|
||||||
|
|
||||||
updateOutProxyIndicator();
|
updateOutProxyIndicator();
|
||||||
|
|
||||||
|
ui.localPort->blockSignals(false);
|
||||||
|
ui.extPort->blockSignals(false);
|
||||||
|
ui.localAddress->blockSignals(false);
|
||||||
|
ui.extAddress->blockSignals(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerPage::toggleAutoIncludeFriends(bool b)
|
void ServerPage::toggleAutoIncludeFriends(bool b)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1220</width>
|
<width>1220</width>
|
||||||
<height>884</height>
|
<height>896</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="ServerPageVLayout">
|
<layout class="QVBoxLayout" name="ServerPageVLayout">
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabNetConf">
|
<widget class="QWidget" name="tabNetConf">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue