From fc89ba0fb74819d0089e63a26cddf09a6f4ddaa7 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Feb 2022 15:40:01 +0100 Subject: [PATCH] fixed calling onion address testing only when editing is done, and updating of DNS in certificate --- libretroshare | 2 +- retroshare-gui/src/gui/FriendServerControl.cpp | 4 ++-- retroshare-gui/src/gui/FriendServerControl.h | 2 +- retroshare-gui/src/gui/FriendsDialog.cpp | 13 +++---------- retroshare-gui/src/gui/HomePage.cpp | 3 ++- retroshare-gui/src/gui/settings/ServerPage.cpp | 6 +++--- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/libretroshare b/libretroshare index 05963ad04..b86968cd1 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 05963ad041430bee30c1418de19aadc5320ad42c +Subproject commit b86968cd178c06680a1d39375be4afc3e69874bf diff --git a/retroshare-gui/src/gui/FriendServerControl.cpp b/retroshare-gui/src/gui/FriendServerControl.cpp index 219a1e375..5842516ed 100644 --- a/retroshare-gui/src/gui/FriendServerControl.cpp +++ b/retroshare-gui/src/gui/FriendServerControl.cpp @@ -80,7 +80,7 @@ FriendServerControl::FriendServerControl(QWidget *parent) QObject::connect(friendServerOnOff_CB,SIGNAL(toggled(bool)),this,SLOT(onOnOffClick(bool))); QObject::connect(torServerFriendsToRequest_SB,SIGNAL(valueChanged(int)),this,SLOT(onFriendsToRequestChanged(int))); - QObject::connect(torServerAddress_LE,SIGNAL(textChanged(const QString&)),this,SLOT(onOnionAddressEdit(const QString&))); + QObject::connect(torServerAddress_LE,SIGNAL(editingFinished()),this,SLOT(onOnionAddressEdit())); QObject::connect(torServerPort_SB,SIGNAL(valueChanged(int)),this,SLOT(onOnionPortEdit(int))); QObject::connect(mConnectionCheckTimer,SIGNAL(timeout()),this,SLOT(checkServerAddress())); @@ -130,7 +130,7 @@ void FriendServerControl::onOnionPortEdit(int) } } -void FriendServerControl::onOnionAddressEdit(const QString&) +void FriendServerControl::onOnionAddressEdit() { // Setup timer to auto-check the friend server address mConnectionCheckTimer->stop(); diff --git a/retroshare-gui/src/gui/FriendServerControl.h b/retroshare-gui/src/gui/FriendServerControl.h index 465c5d1ec..832c67f39 100644 --- a/retroshare-gui/src/gui/FriendServerControl.h +++ b/retroshare-gui/src/gui/FriendServerControl.h @@ -35,7 +35,7 @@ public: protected slots: void onOnOffClick(bool b); - void onOnionAddressEdit(const QString&); + void onOnionAddressEdit(); void onOnionPortEdit(int); void onNbFriendsToRequestsChanged(int n); void checkServerAddress(); diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index dcf287f51..532a87f4a 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -125,9 +125,8 @@ FriendsDialog::FriendsDialog(QWidget *parent) : MainPage(parent) // add self nick and Avatar to Friends. RsPeerDetails pd ; - if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) { + if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) ui.nicknameLabel->setText(QString::fromUtf8(pd.name.c_str()) + " (" + QString::fromUtf8(pd.location.c_str())+")"); - } int H = misc::getFontSizeFactor("HelpButton").height(); QString hlp_str = tr( @@ -260,13 +259,9 @@ void FriendsDialog::loadmypersonalstatus() QString statustring = QString::fromUtf8(rsMsgs->getCustomStateString().c_str()); if (statustring.isEmpty()) - { ui.mypersonalstatusLabel->setText(tr("Set your status message here.")); - } else - { ui.mypersonalstatusLabel->setText(statustring); - } } void FriendsDialog::clearChatNotify() @@ -283,13 +278,11 @@ void FriendsDialog::statusmessage() /*static*/ bool FriendsDialog::isGroupChatActive() { FriendsDialog *friendsDialog = dynamic_cast(MainWindow::getPage(MainWindow::Friends)); - if (!friendsDialog) { + if (!friendsDialog) return false; - } - if (friendsDialog->ui.tabWidget->currentWidget() == friendsDialog->ui.groupChatTab) { + if (friendsDialog->ui.tabWidget->currentWidget() == friendsDialog->ui.groupChatTab) return true; - } return false; } diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp index ef6982e22..327c8e44f 100644 --- a/retroshare-gui/src/gui/HomePage.cpp +++ b/retroshare-gui/src/gui/HomePage.cpp @@ -136,6 +136,7 @@ void HomePage::handleEvent(std::shared_ptr e) { case RsNetworkEventCode::LOCAL_IP_UPDATED: // [fallthrough] case RsNetworkEventCode::EXTERNAL_IP_UPDATED: // [fallthrough] + case RsNetworkEventCode::DNS_UPDATED: // [fallthrough] RsQThreadUtils::postToObject( [=]() { updateCertificate(); @@ -213,7 +214,7 @@ void HomePage::updateOwnCert() } QString invite ; - RetroshareInviteFlags invite_flags = RetroshareInviteFlags::CURRENT_IP; + RetroshareInviteFlags invite_flags = RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::DNS; if(mIncludeAllIPs) invite_flags |= RetroshareInviteFlags::FULL_IP_HISTORY; diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index 8addc4349..f840f90a6 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -205,9 +205,9 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.discComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(saveAddresses())); connect(ui.netModeComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(saveAddresses())); - connect(ui.localAddress, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses())); - connect(ui.extAddress, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses())); - connect(ui.dynDNS, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses())); + connect(ui.localAddress, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); + connect(ui.extAddress, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); + connect(ui.dynDNS, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int))); connect(ui.hiddenpage_proxyAddress_tor, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));