From 58e3c04801b877e27da7783b496cfd2fd65f3025 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 4 Feb 2022 14:49:39 +0100 Subject: [PATCH 1/5] disable friend server on non tor node --- retroshare-gui/src/gui/FriendsDialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index e3f74fcfd..dbff08418 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -27,6 +27,7 @@ #include #include +#include #include "chat/ChatUserNotify.h" #include "connect/ConnectFriendWizard.h" @@ -92,7 +93,8 @@ FriendsDialog::FriendsDialog(QWidget *parent) : MainPage(parent) ui.tabWidget->setTabPosition(QTabWidget::North); #ifdef RS_EMBEDED_FRIEND_SERVER - ui.tabWidget->addTab(friendServerControl = new FriendServerControl(),QIcon(IMAGE_PEERS), tr("Friend Server")); + if(RsAccounts::isTorAuto()) + ui.tabWidget->addTab(friendServerControl = new FriendServerControl(),QIcon(IMAGE_PEERS), tr("Friend Server")); #endif ui.tabWidget->addTab(networkView = new NetworkView(),QIcon(IMAGE_NETWORK2), tr("Network graph")); ui.tabWidget->addTab(networkDialog = new NetworkDialog(),QIcon(IMAGE_PEERS), tr("Keyring")); From e2cda9fded1a55de1a1151bf4e7ab6ca03df002b Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 4 Feb 2022 15:12:13 +0100 Subject: [PATCH 2/5] improved UI for FS --- libretroshare | 2 +- .../src/gui/FriendServerControl.cpp | 6 + retroshare-gui/src/gui/FriendServerControl.ui | 174 +++++++++--------- 3 files changed, 96 insertions(+), 86 deletions(-) diff --git a/libretroshare b/libretroshare index 55efaf9c7..68864cbd7 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 55efaf9c730859ef3fc5c6f6049595c1225f9204 +Subproject commit 68864cbd7086dfe9346b2fb2d50b78e382a4e221 diff --git a/retroshare-gui/src/gui/FriendServerControl.cpp b/retroshare-gui/src/gui/FriendServerControl.cpp index 3cc029ecd..219a1e375 100644 --- a/retroshare-gui/src/gui/FriendServerControl.cpp +++ b/retroshare-gui/src/gui/FriendServerControl.cpp @@ -44,6 +44,8 @@ FriendServerControl::FriendServerControl(QWidget *parent) /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + friendServerOnOff_CB->setEnabled(false); // until FS is connected. + if(!rsFriendServer) { setEnabled(false); @@ -170,11 +172,15 @@ void FriendServerControl::updateFriendServerStatusIcon(bool ok) { torServerStatus_LB->setToolTip(tr("Friend server is currently reachable.")) ; mCheckingServerMovie->setFileName(ICON_STATUS_OK); + friendServerOnOff_CB->setEnabled(true); } else { + rsFriendServer->stopServer(); torServerStatus_LB->setToolTip(tr("The proxy is not enabled or broken.\nAre all services up and running fine??\nAlso check your ports!")) ; mCheckingServerMovie->setFileName(ICON_STATUS_UNKNOWN); + friendServerOnOff_CB->setChecked(false); + friendServerOnOff_CB->setEnabled(false); } mCheckingServerMovie->start(); } diff --git a/retroshare-gui/src/gui/FriendServerControl.ui b/retroshare-gui/src/gui/FriendServerControl.ui index 2ac69969b..e51b85220 100644 --- a/retroshare-gui/src/gui/FriendServerControl.ui +++ b/retroshare-gui/src/gui/FriendServerControl.ui @@ -11,89 +11,8 @@ - - - - - - On/Off - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::NoFocus - - - - :/icons/help_64.png:/icons/help_64.png - - - true - - - false - - - true - - - - - - - - - Friends to request: - - - - - - - 1 - - - 15 - - - 5 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - @@ -112,9 +31,6 @@ <html><head/><body><p>Enter here the onion address of the Friend Server that was given to you. The address will be automatically checked after you enter it and a green bullet will appear if the server is online.</p></body></html> - - .onion - Onion address of the friend server @@ -150,8 +66,44 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::NoFocus + + + + :/icons/help_64.png:/icons/help_64.png + + + true + + + false + + + true + + + + + + @@ -195,6 +147,58 @@ + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + On/Off + + + + + + + Qt::Horizontal + + + + 302 + 26 + + + + + + + + Friends to request: + + + + + + + 1 + + + 15 + + + 5 + + + + + + @@ -211,7 +215,7 @@ - + From a1502c2742a84fd9e69a58608c0870de628bbaba Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Feb 2022 13:55:59 +0100 Subject: [PATCH 3/5] added missing spacer --- libretroshare | 2 +- retroshare-gui/src/gui/FriendServerControl.ui | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/libretroshare b/libretroshare index 68864cbd7..05963ad04 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 68864cbd7086dfe9346b2fb2d50b78e382a4e221 +Subproject commit 05963ad041430bee30c1418de19aadc5320ad42c diff --git a/retroshare-gui/src/gui/FriendServerControl.ui b/retroshare-gui/src/gui/FriendServerControl.ui index e51b85220..4eed774ad 100644 --- a/retroshare-gui/src/gui/FriendServerControl.ui +++ b/retroshare-gui/src/gui/FriendServerControl.ui @@ -71,6 +71,9 @@ Qt::Horizontal + + QSizePolicy::Maximum + 40 @@ -132,19 +135,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - From fc89ba0fb74819d0089e63a26cddf09a6f4ddaa7 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Feb 2022 15:40:01 +0100 Subject: [PATCH 4/5] 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())); From e86e0ac05a851f3386ee57411ad4ae7580aa0914 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Feb 2022 22:16:02 +0100 Subject: [PATCH 5/5] merged --- build_scripts/Windows/build/clean.bat | 2 +- libretroshare | 2 +- retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp | 2 +- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 4 ++++ retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui | 5 +++++ retroshare-gui/src/gui/qss/stylesheet/default.qss | 2 +- 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build_scripts/Windows/build/clean.bat b/build_scripts/Windows/build/clean.bat index e8d5aa7b8..4ab752d4d 100644 --- a/build_scripts/Windows/build/clean.bat +++ b/build_scripts/Windows/build/clean.bat @@ -8,7 +8,7 @@ if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -call "%~dp0env.bat" %* +call "%~dp0env.bat" clean %* if errorlevel 2 exit /B 2 if errorlevel 1 goto error_env diff --git a/libretroshare b/libretroshare index b86968cd1..5a6f09ee1 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit b86968cd178c06680a1d39375be4afc3e69874bf +Subproject commit 5a6f09ee11a34f1c52b5be3f0a440f185b9b2a89 diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 15456bbd5..ca56e06aa 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -599,7 +599,7 @@ void ConnectFriendWizard::initializePage(int id) if(mIsShortInvite) { if(ui->nameEdit->text().isEmpty()) - ui->nameEdit->setText(tr("[Unknown]")); + ui->nameEdit->setText(QString::fromUtf8(peerDetails.name.c_str())); ui->addKeyToKeyring_CB->setChecked(false); ui->addKeyToKeyring_CB->setEnabled(false); ui->signersEdit->hide(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index fb962ca5c..19c408336 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -321,6 +321,10 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget float f = QFontMetricsF(font()).height()/14.0f ; + QFontMetricsF fontMetrics(ui->threadTreeWidget->font()); + int iconHeight = fontMetrics.height() * 1.4; + ui->threadTreeWidget->setIconSize(QSize(iconHeight, iconHeight)); + /* Set header resize modes and initial section sizes */ QHeaderView * ttheader = ui->threadTreeWidget->header () ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index b27354e8b..c74ea5ebb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -233,6 +233,11 @@ + + + 10 + + Qt::CustomContextMenu diff --git a/retroshare-gui/src/gui/qss/stylesheet/default.qss b/retroshare-gui/src/gui/qss/stylesheet/default.qss index d1730bfef..607c371ff 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/default.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/default.qss @@ -311,7 +311,7 @@ BoardPostDisplayWidget_compact QToolButton#voteDownButton:disabled { ForumsDialog, GxsForumThreadWidget { - qproperty-textColorRead: darkgray; + qproperty-textColorRead: black; qproperty-textColorUnread: black; qproperty-textColorUnreadChildren: darkgray; qproperty-textColorNotSubscribed: black;