mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed connectProgressDialog for hidden nodes
This commit is contained in:
parent
e28886fe79
commit
a69e068db3
@ -64,6 +64,9 @@ ConnectProgressDialog::ConnectProgressDialog(const RsPeerId& id, QWidget *parent
|
||||
ui->headerFrame->setHeaderText(tr("Connection Assistant"));
|
||||
|
||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(stopAndClose()));
|
||||
|
||||
mAmIHiddenNode = rsPeers->isHiddenNode(rsPeers->getOwnId()) ;
|
||||
mIsPeerHiddenNode = rsPeers->isHiddenNode(id) ;
|
||||
}
|
||||
|
||||
ConnectProgressDialog::~ConnectProgressDialog()
|
||||
@ -165,15 +168,35 @@ void ConnectProgressDialog::initDialog()
|
||||
ui->NetResult->setText(tr("N/A"));
|
||||
ui->ContactResult->setText(tr("N/A"));
|
||||
|
||||
#ifdef RS_USE_BITDHT
|
||||
if(!mIsPeerHiddenNode && !mAmIHiddenNode)
|
||||
{
|
||||
ui->DhtResult->setText(tr("DHT Startup"));
|
||||
ui->DhtProgressBar->setValue(0);
|
||||
}
|
||||
#else
|
||||
if(mIsPeerHiddenNode || mAmIHiddenNode)
|
||||
{
|
||||
ui->DhtResult->hide();
|
||||
ui->DhtLabel->hide();
|
||||
ui->DhtProgressBar->hide();
|
||||
}
|
||||
#endif
|
||||
if(mIsPeerHiddenNode || mAmIHiddenNode)
|
||||
{
|
||||
ui->UdpResult->hide();
|
||||
ui->UdpProgressBar->hide();
|
||||
ui->UdpLabel->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->UdpResult->setText(tr("N/A"));
|
||||
ui->UdpProgressBar->setValue(0);
|
||||
}
|
||||
|
||||
ui->LookupResult->setText(tr("N/A"));
|
||||
ui->LookupProgressBar->setValue(0);
|
||||
|
||||
ui->UdpResult->setText(tr("N/A"));
|
||||
ui->UdpProgressBar->setValue(0);
|
||||
|
||||
sayInProgress();
|
||||
|
||||
if (rsPeers->isFriend(mId))
|
||||
@ -219,7 +242,9 @@ void ConnectProgressDialog::updateStatus()
|
||||
|
||||
updateNetworkStatus();
|
||||
updateContactStatus();
|
||||
#ifdef RS_USE_BITDHT
|
||||
updateDhtStatus();
|
||||
#endif
|
||||
updateLookupStatus();
|
||||
updateUdpStatus();
|
||||
|
||||
@ -443,6 +468,7 @@ void ConnectProgressDialog::updateLookupStatus()
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef RS_USE_BITDHT
|
||||
time_t now = time(NULL);
|
||||
switch(mDhtStatus)
|
||||
{
|
||||
@ -484,7 +510,6 @@ void ConnectProgressDialog::updateLookupStatus()
|
||||
|
||||
ui->LookupProgressBar->setValue(calcProgress(now, mLookupTS, CONNECT_LOOKUP_TYPICAL, CONNECT_LOOKUP_SLOW, CONNECT_LOOKUP_PERIOD));
|
||||
|
||||
#ifdef RS_USE_BITDHT
|
||||
/* now actually look at the DHT Details */
|
||||
RsDhtNetPeer status;
|
||||
rsDht->getNetPeerStatus(mId, status);
|
||||
|
@ -97,6 +97,9 @@ private:
|
||||
time_t mUdpTS;
|
||||
uint32_t mUdpStatus;
|
||||
|
||||
bool mAmIHiddenNode ;
|
||||
bool mIsPeerHiddenNode ;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::ConnectProgressDialog *ui;
|
||||
};
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>553</width>
|
||||
<height>489</height>
|
||||
<width>623</width>
|
||||
<height>608</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -21,7 +21,16 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -97,7 +106,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="DhtLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
@ -117,7 +126,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<widget class="QLabel" name="LookupLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
@ -137,7 +146,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<widget class="QLabel" name="UdpLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
@ -283,10 +292,10 @@
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
</style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">This Widget shows the progress of your connection to your new peer.</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">It is helpful for problem-solving.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande'; font-size:13pt;"></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande'; font-size:13pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">If you are an expert RS user, or trust that RS will do the right thing</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">you can close it.</span></p></body></html></string>
|
||||
</property>
|
||||
@ -331,7 +340,6 @@ p, li { white-space: pre-wrap; }
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
Reference in New Issue
Block a user