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"));
|
ui->headerFrame->setHeaderText(tr("Connection Assistant"));
|
||||||
|
|
||||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(stopAndClose()));
|
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(stopAndClose()));
|
||||||
|
|
||||||
|
mAmIHiddenNode = rsPeers->isHiddenNode(rsPeers->getOwnId()) ;
|
||||||
|
mIsPeerHiddenNode = rsPeers->isHiddenNode(id) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConnectProgressDialog::~ConnectProgressDialog()
|
ConnectProgressDialog::~ConnectProgressDialog()
|
||||||
@ -165,15 +168,35 @@ void ConnectProgressDialog::initDialog()
|
|||||||
ui->NetResult->setText(tr("N/A"));
|
ui->NetResult->setText(tr("N/A"));
|
||||||
ui->ContactResult->setText(tr("N/A"));
|
ui->ContactResult->setText(tr("N/A"));
|
||||||
|
|
||||||
|
#ifdef RS_USE_BITDHT
|
||||||
|
if(!mIsPeerHiddenNode && !mAmIHiddenNode)
|
||||||
|
{
|
||||||
ui->DhtResult->setText(tr("DHT Startup"));
|
ui->DhtResult->setText(tr("DHT Startup"));
|
||||||
ui->DhtProgressBar->setValue(0);
|
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->LookupResult->setText(tr("N/A"));
|
||||||
ui->LookupProgressBar->setValue(0);
|
ui->LookupProgressBar->setValue(0);
|
||||||
|
|
||||||
ui->UdpResult->setText(tr("N/A"));
|
|
||||||
ui->UdpProgressBar->setValue(0);
|
|
||||||
|
|
||||||
sayInProgress();
|
sayInProgress();
|
||||||
|
|
||||||
if (rsPeers->isFriend(mId))
|
if (rsPeers->isFriend(mId))
|
||||||
@ -219,7 +242,9 @@ void ConnectProgressDialog::updateStatus()
|
|||||||
|
|
||||||
updateNetworkStatus();
|
updateNetworkStatus();
|
||||||
updateContactStatus();
|
updateContactStatus();
|
||||||
|
#ifdef RS_USE_BITDHT
|
||||||
updateDhtStatus();
|
updateDhtStatus();
|
||||||
|
#endif
|
||||||
updateLookupStatus();
|
updateLookupStatus();
|
||||||
updateUdpStatus();
|
updateUdpStatus();
|
||||||
|
|
||||||
@ -443,6 +468,7 @@ void ConnectProgressDialog::updateLookupStatus()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef RS_USE_BITDHT
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
switch(mDhtStatus)
|
switch(mDhtStatus)
|
||||||
{
|
{
|
||||||
@ -484,7 +510,6 @@ void ConnectProgressDialog::updateLookupStatus()
|
|||||||
|
|
||||||
ui->LookupProgressBar->setValue(calcProgress(now, mLookupTS, CONNECT_LOOKUP_TYPICAL, CONNECT_LOOKUP_SLOW, CONNECT_LOOKUP_PERIOD));
|
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 */
|
/* now actually look at the DHT Details */
|
||||||
RsDhtNetPeer status;
|
RsDhtNetPeer status;
|
||||||
rsDht->getNetPeerStatus(mId, status);
|
rsDht->getNetPeerStatus(mId, status);
|
||||||
|
@ -97,6 +97,9 @@ private:
|
|||||||
time_t mUdpTS;
|
time_t mUdpTS;
|
||||||
uint32_t mUdpStatus;
|
uint32_t mUdpStatus;
|
||||||
|
|
||||||
|
bool mAmIHiddenNode ;
|
||||||
|
bool mIsPeerHiddenNode ;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::ConnectProgressDialog *ui;
|
Ui::ConnectProgressDialog *ui;
|
||||||
};
|
};
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>553</width>
|
<width>623</width>
|
||||||
<height>489</height>
|
<height>608</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -21,7 +21,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</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>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -97,7 +106,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="DhtLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
@ -117,7 +126,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="LookupLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
@ -137,7 +146,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="UdpLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<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">
|
<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">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
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;">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=" 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;">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>
|
<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>
|
</property>
|
||||||
@ -331,7 +340,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
<include location="../images.qrc"/>
|
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
Reference in New Issue
Block a user