fixed connectProgressDialog for hidden nodes

This commit is contained in:
csoler 2018-01-15 21:41:19 +01:00
parent e28886fe79
commit a69e068db3
3 changed files with 49 additions and 13 deletions

View File

@ -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);

View File

@ -97,6 +97,9 @@ private:
time_t mUdpTS;
uint32_t mUdpStatus;
bool mAmIHiddenNode ;
bool mIsPeerHiddenNode ;
/** Qt Designer generated object */
Ui::ConnectProgressDialog *ui;
};

View File

@ -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>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;This Widget shows the progress of your connection to your new peer.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;It is helpful for problem-solving.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;If you are an expert RS user, or trust that RS will do the right thing&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;you can close it.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>