From 2192a439ff560e2828b2a4a390ee199e10d6ef8b Mon Sep 17 00:00:00 2001 From: Phenom Date: Mon, 3 Jul 2017 18:36:47 +0200 Subject: [PATCH] Add a warning to Direct download checkbox depends general setting. --- .../src/gui/connect/ConnectFriendWizard.cpp | 46 +++++-- .../src/gui/connect/ConnectFriendWizard.ui | 126 +++++++----------- .../src/gui/connect/PGPKeyDialog.cpp | 14 ++ 3 files changed, 95 insertions(+), 91 deletions(-) diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index f71d8f9c2..ad6c93a1e 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -19,13 +19,15 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ -#include -#include -#include +#include #include +#include #include -#include +#include +#include #include +#include +#include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include @@ -107,7 +109,7 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) : ui->foffRadioButton->hide(); ui->rsidRadioButton->hide(); - ui->fr_label->hide(); + ui->cp_Label->hide(); ui->requestinfolabel->hide(); connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->_options_GB,SLOT(setEnabled(bool))) ; @@ -135,7 +137,7 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) : else { ui->userFrame->hide(); // certificates page - top half with own cert and it's functions - ui->horizontalLayout_13->hide(); // Advanced options - key sign, whitelist, direct source ... + ui->cp_Frame->hide(); // Advanced options - key sign, whitelist, direct source ... AdvancedVisible=false; ui->trustLabel->hide(); ui->trustEdit->hide(); @@ -145,7 +147,25 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) : rsPeers->getPeerCount (&friendCount, &onlineCount, false); if(friendCount<30) ui->makefriend_infolabel->hide(); - + + //Add warning to direct source checkbox depends general setting. + switch (rsFiles->filePermDirectDL()) + { + case RS_FILE_PERM_DIRECT_DL_YES: + ui->_direct_transfer_CB->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui->_direct_transfer_CB->setToolTip(ui->_direct_transfer_CB->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to Yes."))); + ui->_direct_transfer_CB_2->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui->_direct_transfer_CB_2->setToolTip(ui->_direct_transfer_CB_2->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to Yes."))); + break ; + case RS_FILE_PERM_DIRECT_DL_NO: + ui->_direct_transfer_CB->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui->_direct_transfer_CB->setToolTip(ui->_direct_transfer_CB->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to No."))); + ui->_direct_transfer_CB_2->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui->_direct_transfer_CB_2->setToolTip(ui->_direct_transfer_CB_2->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to No."))); + break ; + + default: break ; + } updateStylesheet(); } @@ -279,7 +299,7 @@ void ConnectFriendWizard::setCertificate(const QString &certificate, bool friend //setStartId(friendRequest ? Page_FriendRequest : Page_Conclusion); setStartId(Page_Conclusion); if (friendRequest){ - ui->fr_label->show(); + ui->cp_Label->show(); ui->requestinfolabel->show(); setTitleText(ui->ConclusionPage, tr("Friend request")); ui->ConclusionPage->setSubTitle(tr("Details about the request")); @@ -305,7 +325,7 @@ void ConnectFriendWizard::setGpgId(const RsPgpId &gpgId, const RsPeerId &sslId, //setStartId(friendRequest ? Page_FriendRequest : Page_Conclusion); setStartId(Page_Conclusion); if (friendRequest){ - ui->fr_label->show(); + ui->cp_Label->show(); ui->requestinfolabel->show(); setTitleText(ui->ConclusionPage,tr("Friend request")); ui->ConclusionPage->setSubTitle(tr("Details about the request")); @@ -520,7 +540,7 @@ void ConnectFriendWizard::initializePage(int id) } } - ui->fr_label->setText(tr("You have a friend request from") + " " + QString::fromUtf8(peerDetails.name.c_str())); + ui->cp_Label->setText(tr("You have a friend request from") + " " + QString::fromUtf8(peerDetails.name.c_str())); ui->nameEdit->setText(QString::fromUtf8(peerDetails.name.c_str())); ui->trustEdit->setText(trustString); ui->emailEdit->setText(QString::fromUtf8(peerDetails.email.c_str())); @@ -619,7 +639,7 @@ void ConnectFriendWizard::initializePage(int id) ui->fr_nodeEdit->setText(loc); - ui->fr_label_3->setText(tr("You have a friend request from") + " " + QString::fromUtf8(peerDetails.name.c_str())); + ui->fr_InfoTopLabel->setText(tr("You have a friend request from") + " " + QString::fromUtf8(peerDetails.name.c_str())); fillGroups(this, ui->fr_groupComboBox, groupId); } @@ -1345,13 +1365,13 @@ void ConnectFriendWizard::toggleAdvanced() { if(AdvancedVisible) { - ui->horizontalLayout_13->hide(); + ui->cp_Frame->hide(); ui->toggleadvancedButton->setText("Show advanced options"); AdvancedVisible=false; } else { - ui->horizontalLayout_13->show(); + ui->cp_Frame->show(); ui->toggleadvancedButton->setText("Hide advanced options"); AdvancedVisible=true; } diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui index da92b3091..3df4cf673 100644 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui @@ -27,7 +27,7 @@ ConnectFriendWizard::Page_Intro - + @@ -90,12 +90,12 @@ ConnectFriendWizard::Page_Text - + - + - + @@ -235,7 +235,7 @@ - + Qt::Vertical @@ -396,7 +396,7 @@ ConnectFriendWizard::Page_Cert - + @@ -405,7 +405,7 @@ true - + @@ -434,7 +434,7 @@ - + @@ -459,9 +459,9 @@ ConnectFriendWizard::Page_Foff - + - + Show me: @@ -506,7 +506,7 @@ ConnectFriendWizard::Page_Rsid - + @@ -515,7 +515,7 @@ true - + @@ -534,7 +534,7 @@ - + RetroShare is better with Friends @@ -544,9 +544,9 @@ ConnectFriendWizard::Page_WebMail - + - + 9 @@ -560,7 +560,7 @@ 9 - + Qt::Horizontal @@ -693,7 +693,7 @@ - + Qt::Horizontal @@ -711,37 +711,7 @@ - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - + Qt::Vertical @@ -765,9 +735,9 @@ ConnectFriendWizard::Page_Email - + - + @@ -785,7 +755,7 @@ - + @@ -817,7 +787,7 @@ ConnectFriendWizard::Page_FriendRequest - + 6 @@ -825,10 +795,10 @@ 6 - - + + - + You have a friend request from @@ -857,7 +827,7 @@ Peer details - + QFormLayout::AllNonFixedFieldsGrow @@ -909,15 +879,15 @@ - + Options - + - + @@ -961,11 +931,11 @@ - + Options - + @@ -988,7 +958,7 @@ - + Qt::Vertical @@ -1009,14 +979,14 @@ - + To accept the Friend Request, click the Finish button. - + Qt::Vertical @@ -1040,7 +1010,7 @@ ConnectFriendWizard::Page_ErrorMessage - + @@ -1060,7 +1030,7 @@ ConnectFriendWizard::Page_Conclusion - + @@ -1143,7 +1113,7 @@ resources. - + @@ -1230,7 +1200,7 @@ resources. Peer details - + QFormLayout::AllNonFixedFieldsGrow @@ -1342,13 +1312,13 @@ resources. - - + + 6 - + @@ -1374,7 +1344,7 @@ resources. - + @@ -1388,7 +1358,7 @@ resources. - + @@ -1404,7 +1374,7 @@ resources. - + @@ -1445,7 +1415,7 @@ resources. - + Qt::Vertical @@ -1543,7 +1513,7 @@ resources. - + Qt::Vertical @@ -1567,9 +1537,9 @@ resources. ConnectFriendWizard::Page_FriendRecommendations - + - + diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index d99300706..3874de96a 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -152,6 +152,20 @@ void PGPKeyDialog::load() ui.pgpfingerprint_label->show(); ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ; + //Add warning to direct source checkbox depends general setting. + switch (rsFiles->filePermDirectDL()) + { + case RS_FILE_PERM_DIRECT_DL_YES: + ui._direct_transfer_CB->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui._direct_transfer_CB->setToolTip(ui._direct_transfer_CB->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to Yes."))); + break ; + case RS_FILE_PERM_DIRECT_DL_NO: + ui._direct_transfer_CB->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui._direct_transfer_CB->setToolTip(ui._direct_transfer_CB->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to No."))); + break ; + + default: break ; + } ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ; ui._require_WL_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_REQUIRE_WL) ;