show fingerprint in ConfCertDialog, and splitted the string with spaces. Removed the use of the ambiguous peer id for both pgp and locations ids

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6900 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-11-09 22:52:26 +00:00
parent d2ddf9c4c4
commit fc56b95d3f
5 changed files with 63 additions and 4 deletions

View File

@ -42,6 +42,7 @@
#include "gui/MainWindow.h"
#include "mainpage.h"
#include "util/DateTime.h"
#include "util/misc.h"
static QMap<std::string, ConfCertDialog*> instances;
@ -185,6 +186,7 @@ void ConfCertDialog::load()
link.createPerson(detail.id);
ui.rsid->setText(link.toHtml());
ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr)));
ui.rsid->setToolTip(link.title());
if (!detail.isOnlyGPGdetail) {
@ -242,11 +244,17 @@ void ConfCertDialog::load()
ui.tabWidget->show();
ui.rsid->hide();
ui.label_rsid->hide();
ui.pgpfingerprint->show();
ui.pgpfingerprint_label->show();
} else {
ui.avatar->setId(mId, true);
ui.rsid->show();
ui.peerid->hide();
ui.label_id->hide();
ui.label_rsid->show();
ui.pgpfingerprint->show();
ui.pgpfingerprint_label->show();
ui.loc->hide();
ui.label_loc->hide();
ui.statusline->hide();

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>635</width>
<height>549</height>
<height>643</height>
</rect>
</property>
<property name="windowTitle">
@ -110,7 +110,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_id">
<property name="text">
<string>Peer ID</string>
<string>Location ID</string>
</property>
</widget>
</item>
@ -157,13 +157,48 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="pgpfingerprint_label">
<property name="text">
<string>PGP fingerprint</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="RSTextBrowser" name="pgpfingerprint">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="crypto_label">
<property name="text">
<string>Encryption</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QLineEdit" name="crypto_info"/>
</item>
</layout>

View File

@ -76,7 +76,7 @@ void CryptoPage::showEvent ( QShowEvent * /*event*/ )
ui.peerid->setText(QString::fromStdString(detail.id));
ui.pgpid->setText(QString::fromStdString(detail.gpg_id));
ui.pgpfingerprint->setText(QString::fromStdString(detail.fpr));
ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr)));
/* set retroshare version */
std::map<std::string, std::string>::iterator vit;

View File

@ -47,6 +47,20 @@ QString misc::friendlyUnit(float val)
return QString(QByteArray::number(val, 'f', 1)) + tr(" TB", "terabytes (1024 gigabytes)");
}
QString misc::fingerPrintStyleSplit(const QString& in)
{
QString rest = in ;
QString res ;
if(in.isNull())
return in ;
for(int i=0;i<in.length();i+=4)
res += rest.mid(i,4)+' ' ;
return res.left(res.length()-1) ;
}
bool misc::isPreviewable(QString extension)
{
extension = extension.toUpper();

View File

@ -104,6 +104,8 @@ class misc : public QObject
static bool isPreviewable(QString extension);
static QString fingerPrintStyleSplit(const QString& in) ;
// return qBittorrent config path
static QString qBittorrentPath();