diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index 52a5628a9..dfc73ca6b 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -45,8 +45,8 @@ #include "util/DateTime.h" #include "util/misc.h" -static QMap instances_ssl; -static QMap instances_pgp; +QMap ConfCertDialog::instances_ssl; +QMap ConfCertDialog::instances_pgp; ConfCertDialog *ConfCertDialog::instance(const RsPeerId& peer_id) { @@ -128,184 +128,173 @@ void ConfCertDialog::loadAll() void ConfCertDialog::load() { - RsPeerDetails detail; + RsPeerDetails detail; - if(!rsPeers->getPeerDetails(peerId, detail)) - { - QMessageBox::information(this, - tr("RetroShare"), - tr("Error : cannot get peer details.")); - close(); - return; - } + if(!rsPeers->getPeerDetails(peerId, detail)) + { + QMessageBox::information(this, + tr("RetroShare"), + tr("Error : cannot get peer details.")); + close(); + return; + } - //ui.pgpfingerprint->setText(QString::fromUtf8(detail.name.c_str())); - ui.peerid->setText(QString::fromStdString(detail.id.toStdString())); - - nameAndLocation = QString("%1 (%2)").arg(QString::fromUtf8(detail.name.c_str())).arg(QString::fromUtf8(detail.location.c_str())); + //ui.pgpfingerprint->setText(QString::fromUtf8(detail.name.c_str())); + ui.peerid->setText(QString::fromStdString(detail.id.toStdString())); - ui.headerFrame->setHeaderText(nameAndLocation); + nameAndLocation = QString("%1 (%2)").arg(QString::fromUtf8(detail.name.c_str()), QString::fromUtf8(detail.location.c_str())); + + ui.headerFrame->setHeaderText(nameAndLocation); RetroShareLink link = RetroShareLink::createPerson(detail.gpg_id); ui.pgpfingerprint->setText(link.toHtml()); ui.pgpfingerprint->setToolTip(link.title()); - ui.avatar->setId(ChatId(peerId)); + ui.avatar->setId(ChatId(peerId)); - ui.loc->setText(QString::fromUtf8(detail.location.c_str())); - // Dont Show a timestamp in RS calculate the day - ui.lastcontact->setText(DateTime::formatLongDateTime(detail.lastConnect)); + ui.loc->setText(QString::fromUtf8(detail.location.c_str())); + // Dont Show a timestamp in RS calculate the day + ui.lastcontact->setText(DateTime::formatLongDateTime(detail.lastConnect)); - /* set retroshare version */ - std::string version; - rsDisc->getPeerVersion(detail.id, version); - ui.version->setText(QString::fromStdString(version)); - - /* Custom state string */ - QString statustring = QString::fromUtf8(rsMsgs->getCustomStateString(detail.id).c_str()); - ui.statusmessage->setText(statustring); + /* set retroshare version */ + std::string version; + rsDisc->getPeerVersion(detail.id, version); + ui.version->setText(QString::fromStdString(version)); + + /* Custom state string */ + QString statustring = QString::fromUtf8(rsMsgs->getCustomStateString(detail.id).c_str()); + ui.statusmessage->setText(statustring); - RsPeerCryptoParams cdet ; - if(RsControl::instance()->getPeerCryptoDetails(detail.id,cdet) && cdet.connexion_state!=0) - ui.crypto_info->setText(QString::fromStdString(cdet.cipher_name)); - else - ui.crypto_info->setText(tr("Not connected")) ; + RsPeerCryptoParams cdet ; + if(RsControl::instance()->getPeerCryptoDetails(detail.id,cdet) && cdet.connexion_state!=0) + ui.crypto_info->setText(QString::fromStdString(cdet.cipher_name)); + else + ui.crypto_info->setText(tr("Not connected")) ; - if (detail.isHiddenNode) - { - // enable only the first row and set name of the first label to "Hidden Address" - ui.l_localAddress->setText(tr("Hidden Address")); + if (detail.isHiddenNode) + { + // enable only the first row and set name of the first label to "Hidden Address" + ui.l_localAddress->setText(tr("Hidden Address")); - ui.l_extAddress->setEnabled(false); - ui.extAddress->setEnabled(false); - ui.l_portExternal->setEnabled(false); - ui.extPort->setEnabled(false); + ui.l_extAddress->setEnabled(false); + ui.extAddress->setEnabled(false); + ui.l_portExternal->setEnabled(false); + ui.extPort->setEnabled(false); - ui.l_dynDNS->setEnabled(false); - ui.dynDNS->setEnabled(false); + ui.l_dynDNS->setEnabled(false); + ui.dynDNS->setEnabled(false); - /* set hidden address */ - ui.localAddress->setText(QString::fromStdString(detail.hiddenNodeAddress)); - ui.localPort -> setValue(detail.hiddenNodePort); + /* set hidden address */ + ui.localAddress->setText(QString::fromStdString(detail.hiddenNodeAddress)); + ui.localPort -> setValue(detail.hiddenNodePort); - // set everything else to none - ui.extAddress->setText(tr("none")); - ui.extPort->setValue(0); - ui.dynDNS->setText(tr("none")); - } - else - { - // enable everything and set name of the first label to "Local Address" - ui.l_localAddress->setText(tr("Local Address")); + // set everything else to none + ui.extAddress->setText(tr("none")); + ui.extPort->setValue(0); + ui.dynDNS->setText(tr("none")); + } + else + { + // enable everything and set name of the first label to "Local Address" + ui.l_localAddress->setText(tr("Local Address")); - ui.l_extAddress->setEnabled(true); - ui.extAddress->setEnabled(true); - ui.l_portExternal->setEnabled(true); - ui.extPort->setEnabled(true); + ui.l_extAddress->setEnabled(true); + ui.extAddress->setEnabled(true); + ui.l_portExternal->setEnabled(true); + ui.extPort->setEnabled(true); - ui.l_dynDNS->setEnabled(true); - ui.dynDNS->setEnabled(true); + ui.l_dynDNS->setEnabled(true); + ui.dynDNS->setEnabled(true); - /* set local address */ - ui.localAddress->setText(QString::fromStdString(detail.localAddr)); - ui.localPort -> setValue(detail.localPort); - /* set the server address */ - ui.extAddress->setText(QString::fromStdString(detail.extAddr)); - ui.extPort -> setValue(detail.extPort); + /* set local address */ + ui.localAddress->setText(QString::fromStdString(detail.localAddr)); + ui.localPort -> setValue(detail.localPort); + /* set the server address */ + ui.extAddress->setText(QString::fromStdString(detail.extAddr)); + ui.extPort -> setValue(detail.extPort); - ui.dynDNS->setText(QString::fromStdString(detail.dyndns)); - } + ui.dynDNS->setText(QString::fromStdString(detail.dyndns)); + } - ui.statusline->setText(StatusDefs::connectStateString(detail)); + ui.statusline->setText(StatusDefs::connectStateString(detail)); - ui.ipAddressList->clear(); - for(std::list::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it) - ui.ipAddressList->addItem(QString::fromStdString(*it)); + ui.ipAddressList->clear(); + for(std::list::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it) + ui.ipAddressList->addItem(QString::fromStdString(*it)); - ui.loc->show(); - ui.label_loc->show(); - ui.statusline->show(); - ui.label_status->show(); - ui.lastcontact->show(); - ui.label_last_contact->show(); - ui.version->show(); - ui.label_version->show(); + ui.loc->show(); + ui.label_loc->show(); + ui.statusline->show(); + ui.label_status->show(); + ui.lastcontact->show(); + ui.label_last_contact->show(); + ui.version->show(); + ui.label_version->show(); - //ui.groupBox->show(); - ui.groupBox_4->show(); - //ui.tabWidget->show(); - //ui.rsid->hide(); - //ui.label_rsid->hide(); - ui.pgpfingerprint->show(); - //ui.pgpfingerprint_label->show(); + //ui.groupBox->show(); + ui.detail_GBox->show(); + //ui.tabWidget->show(); + //ui.rsid->hide(); + //ui.label_rsid->hide(); + ui.pgpfingerprint->show(); + //ui.pgpfingerprint_label->show(); - ui.stabWidget->setTabEnabled(2,true) ; - ui.stabWidget->setTabEnabled(3,true) ; - ui.stabWidget->setTabEnabled(4,true) ; + ui.stabWidget->setTabEnabled(PageDetails,true) ; + ui.stabWidget->setTabEnabled(PageTrust,true) ; + ui.stabWidget->setTabEnabled(PageCertificate,true) ; - loadInvitePage() ; + loadInvitePage() ; } void ConfCertDialog::loadInvitePage() { - RsPeerDetails detail; + RsPeerDetails detail; - if (!rsPeers->getPeerDetails(peerId, detail)) - { - QMessageBox::information(this, - tr("RetroShare"), - tr("Error : cannot get peer details.")); - close(); - return; - } + if (!rsPeers->getPeerDetails(peerId, detail)) + { + QMessageBox::information(this, + tr("RetroShare"), + tr("Error : cannot get peer details.")); + close(); + return; + } - ui._shouldAddSignatures_CB->setEnabled(detail.gpgSigners.size() > 1) ; - - // std::string pgp_key = rsPeers->getPGPKey(detail.gpg_id,ui._shouldAddSignatures_CB_2->isChecked()) ; // this needs to be a SSL id - -// ui.userCertificateText_2->setReadOnly(true); -// ui.userCertificateText_2->setMinimumHeight(200); -// ui.userCertificateText_2->setMinimumWidth(530); -// QFont font("Courier New",10,50,false); -// font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); -// font.setStyle(QFont::StyleNormal); -// ui.userCertificateText_2->setFont(font); -// ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str())); + ui._shouldAddSignatures_CB->setEnabled(detail.gpgSigners.size() > 1) ; std::string invite ; - RetroshareInviteFlags flags = RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::RADIX_FORMAT; + RetroshareInviteFlags flags = RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::RADIX_FORMAT; - if(!detail.isHiddenNode && ui._includeIPHistory_CB->isChecked()) - flags |= RetroshareInviteFlags::FULL_IP_HISTORY; + if(!detail.isHiddenNode && ui._includeIPHistory_CB->isChecked()) + flags |= RetroshareInviteFlags::FULL_IP_HISTORY; - if(ui._shortFormat_CB->isChecked()) + if(ui._shortFormat_CB->isChecked()) { - rsPeers->getShortInvite(invite,detail.id,flags); - ui.stabWidget->setTabText(2, tr("Retroshare ID")); + rsPeers->getShortInvite(invite,detail.id,flags); + ui.stabWidget->setTabText(PageCertificate, tr("Retroshare ID")); } else { - if(ui._shouldAddSignatures_CB->isChecked()) - flags |= RetroshareInviteFlags::PGP_SIGNATURES; + if(ui._shouldAddSignatures_CB->isChecked()) + flags |= RetroshareInviteFlags::PGP_SIGNATURES; - invite = rsPeers->GetRetroshareInvite(detail.id, flags ) ; - ui.stabWidget->setTabText(1, tr("Retroshare Certificate")); + invite = rsPeers->GetRetroshareInvite(detail.id, flags ) ; + ui.stabWidget->setTabText(PageCertificate, tr("Retroshare Certificate")); } QString infotext = getCertificateDescription(detail,ui._shouldAddSignatures_CB->isChecked(),ui._shortFormat_CB->isChecked(), ui._includeIPHistory_CB->isChecked() ); - ui.userCertificateText->setToolTip(infotext) ; + ui.userCertificateText->setToolTip(infotext) ; - ui.userCertificateText->setReadOnly(true); - ui.userCertificateText->setMinimumHeight(200); - ui.userCertificateText->setMinimumWidth(530); - QFont font("Courier New",10,50,false); - font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); - font.setStyle(QFont::StyleNormal); - ui.userCertificateText->setFont(font); - ui.userCertificateText->setText(QString::fromUtf8(invite.c_str())); + ui.userCertificateText->setReadOnly(true); + ui.userCertificateText->setMinimumHeight(200); + ui.userCertificateText->setMinimumWidth(530); + QFont font("Courier New",10,50,false); + font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); + font.setStyle(QFont::StyleNormal); + ui.userCertificateText->setFont(font); + ui.userCertificateText->setText(QString::fromUtf8(invite.c_str())); } QString ConfCertDialog::getCertificateDescription(const RsPeerDetails& detail,bool signatures_included,bool use_short_format,bool include_additional_locators) diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.h b/retroshare-gui/src/gui/connect/ConfCertDialog.h index 019e46598..a883dfd17 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.h +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.h @@ -32,7 +32,8 @@ class ConfCertDialog : public QDialog Q_OBJECT public: - enum enumPage { PageDetails, PageTrust, PageCertificate }; + + enum enumPage { PageDetails = 0, PageTrust = 1, PageCertificate = 2 }; template static void showIt(const ID_CLASS& id, enumPage page) { @@ -40,13 +41,13 @@ public: switch (page) { case PageDetails: - confdialog->ui.stabWidget->setCurrentIndex(0); + confdialog->ui.stabWidget->setCurrentIndex(PageDetails); break; case PageTrust: - confdialog->ui.stabWidget->setCurrentIndex(1); + confdialog->ui.stabWidget->setCurrentIndex(PageTrust); break; case PageCertificate: - confdialog->ui.stabWidget->setCurrentIndex(2); + confdialog->ui.stabWidget->setCurrentIndex(PageCertificate); break; } @@ -65,7 +66,7 @@ signals: private: /** Default constructor */ - ConfCertDialog(const RsPeerId &id,const RsPgpId& pgp_id, QWidget *parent = 0, Qt::WindowFlags flags = 0); + ConfCertDialog(const RsPeerId &id,const RsPgpId& pgp_id, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default destructor */ ~ConfCertDialog(); @@ -88,6 +89,9 @@ private: QString nameAndLocation; + static QMap instances_ssl; + static QMap instances_pgp; + /** Qt Designer generated object */ Ui::ConfCertDialog ui; }; diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.ui b/retroshare-gui/src/gui/connect/ConfCertDialog.ui index 83b15ed92..a2f94bc5b 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.ui +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.ui @@ -17,7 +17,7 @@ :/images/logo/logo_16.png:/images/logo/logo_16.png - + 0 @@ -54,9 +54,9 @@ QFrame::Raised - + - + @@ -77,7 +77,7 @@ 0 - + :/images/info16.png:/images/info16.png @@ -85,15 +85,15 @@ Details - + - + - + Node info: - + @@ -184,7 +184,7 @@ - + Encryption @@ -211,7 +211,7 @@ - + Status message: @@ -221,7 +221,7 @@ - + @@ -239,7 +239,7 @@ - + Qt::Vertical @@ -256,7 +256,7 @@ - + Qt::Vertical @@ -270,19 +270,19 @@ - + Connectivity - + - + Current address: - + - + @@ -365,11 +365,11 @@ - + List of known addresses: - + @@ -385,16 +385,16 @@ - + Retroshare Certificate - + - + @@ -417,7 +417,7 @@ - + Qt::Horizontal diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index d1cf736a6..b167ca1ed 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -45,7 +45,7 @@ #include "util/DateTime.h" #include "util/misc.h" -static QMap instances_pgp; +QMap PGPKeyDialog::instances_pgp; PGPKeyDialog *PGPKeyDialog::instance(const RsPgpId& pgp_id) { @@ -148,9 +148,6 @@ void PGPKeyDialog::load() ui.name->setText(QString::fromUtf8(detail.name.c_str())); ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString()))); - ui.pgpfingerprint->show(); - 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()) @@ -183,7 +180,7 @@ void PGPKeyDialog::load() ui.signKeyButton->hide(); ui.denyFriendButton->hide(); - ui.web_of_trust_label->hide(); + ui.label_trustlevel->hide(); ui.trustlevel_CB->hide(); ui.is_signing_me->hide(); @@ -192,7 +189,7 @@ void PGPKeyDialog::load() } else { - ui.web_of_trust_label->show(); + ui.label_trustlevel->show(); ui.trustlevel_CB->show(); ui.is_signing_me->show(); ui.signersLabel->setText(tr("This key is signed by :")+" "); @@ -279,14 +276,14 @@ void PGPKeyDialog::loadKeyPage() std::string pgp_key = rsPeers->getPGPKey(detail.gpg_id,ui._shouldAddSignatures_CB_2->isChecked()) ; // this needs to be a SSL id - ui.userCertificateText_2->setReadOnly(true); - ui.userCertificateText_2->setMinimumHeight(200); - ui.userCertificateText_2->setMinimumWidth(530); + ui.userCertificateText->setReadOnly(true); + ui.userCertificateText->setMinimumHeight(200); + ui.userCertificateText->setMinimumWidth(530); QFont font("Courier New",10,50,false); font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); font.setStyle(QFont::StyleNormal); - ui.userCertificateText_2->setFont(font); - ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str())); + ui.userCertificateText->setFont(font); + ui.userCertificateText->setText(QString::fromUtf8(pgp_key.c_str())); QString helptext ; helptext += tr("

This PGP key (ID=")+detail.gpg_id.toStdString().c_str()+")" + " authenticates one or more retroshare nodes.

"; @@ -299,7 +296,7 @@ void PGPKeyDialog::loadKeyPage() helptext += "

" ; - ui.userCertificateText_2->setToolTip(helptext) ; + ui.userCertificateText->setToolTip(helptext) ; } void PGPKeyDialog::applyDialog() diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.h b/retroshare-gui/src/gui/connect/PGPKeyDialog.h index ed414960c..8ca79f2bf 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.h +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.h @@ -30,7 +30,7 @@ class PGPKeyDialog : public QDialog Q_OBJECT public: - enum enumPage { PageDetails=0x0 }; + enum enumPage { PageDetails = 0, PageKey = 1, PageOption = 2}; template static void showIt(const ID_CLASS& id, enumPage page) { @@ -38,7 +38,13 @@ public: switch (page) { case PageDetails: - confdialog->ui.stabWidget->setCurrentIndex(0); + confdialog->ui.stabWidget->setCurrentIndex(PageDetails); + break; + case PageKey: + confdialog->ui.stabWidget->setCurrentIndex(PageKey); + break; + case PageOption: + confdialog->ui.stabWidget->setCurrentIndex(PageOption); break; } @@ -56,7 +62,7 @@ signals: private: /** Default constructor */ - PGPKeyDialog(const RsPeerId &id,const RsPgpId& pgp_id, QWidget *parent = 0, Qt::WindowFlags flags = 0); + PGPKeyDialog(const RsPeerId &id,const RsPgpId& pgp_id, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default destructor */ ~PGPKeyDialog(); @@ -80,6 +86,8 @@ private: RsPeerId peerId; RsPgpId pgpId; + static QMap instances_pgp; + /** Qt Designer generated object */ Ui::PGPKeyDialog ui; }; diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.ui b/retroshare-gui/src/gui/connect/PGPKeyDialog.ui index 4baa2f667..04b891fdf 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.ui +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.ui @@ -13,7 +13,7 @@ Retroshare profile - + 0 @@ -37,7 +37,7 @@ QFrame::Raised - + 3 @@ -56,11 +56,11 @@ 0 - + Profile info - + 0 @@ -68,9 +68,9 @@ 6
- + - + @@ -89,7 +89,7 @@ - + Fingerprint : @@ -164,7 +164,7 @@ - + Trust level: @@ -174,14 +174,14 @@ - + Keysigning: - + @@ -206,7 +206,7 @@ p, li { white-space: pre-wrap; } - + Qt::Horizontal @@ -239,7 +239,7 @@ p, li { white-space: pre-wrap; } 6 - + Qt::Horizontal @@ -312,7 +312,7 @@ p, li { white-space: pre-wrap; } - + @@ -350,13 +350,13 @@ p, li { white-space: pre-wrap; }
- + PGP key - + - + Below is the node's profile key in PGP ASCII format. It identifies all nodes of the same profile. A "Retroshare certificate" that you can exchange in order to make friends, is in the the "details" of each separate node. @@ -366,7 +366,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -376,7 +376,7 @@ p, li { white-space: pre-wrap; } - + @@ -391,13 +391,13 @@ p, li { white-space: pre-wrap; } - + Options - + - + These options apply to all nodes of the profile: @@ -434,11 +434,11 @@ p, li { white-space: pre-wrap; } - + - + - + Max upload speed (0=unlimited) @@ -448,7 +448,7 @@ p, li { white-space: pre-wrap; } - + Max download speed (0=unlimited) @@ -460,7 +460,7 @@ p, li { white-space: pre-wrap; } - + @@ -486,7 +486,7 @@ p, li { white-space: pre-wrap; } - + Qt::Vertical @@ -518,17 +518,17 @@ p, li { white-space: pre-wrap; } + + RSTextBrowser + QTextBrowser +
gui/common/RSTextBrowser.h
+
HeaderFrame QFrame
gui/common/HeaderFrame.h
1
- - RSTextBrowser - QTextBrowser -
gui/common/RSTextBrowser.h
-