- removed "use olf key format" from certificate export

- improved GXS Id display when unsigned
- use ProfileManager to export own PGP key pair in keyring and profile.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7562 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-09-25 20:14:21 +00:00
parent 37ddbf63cc
commit eede11a772
7 changed files with 44 additions and 126 deletions

View File

@ -34,6 +34,7 @@
#include "common/RSTreeWidgetItem.h"
#include <gui/common/FriendSelectionDialog.h>
#include "gui/msgs/MessageComposer.h"
#include "gui/profile/ProfileManager.h"
#include "NetworkDialog.h"
//#include "TrustView.h"
#include "NetworkView.h"
@ -218,11 +219,11 @@ void NetworkDialog::connectTreeWidgetCostumPopupMenu( QPoint /*point*/ )
contextMnu->addAction(QIcon(IMAGE_MAKEFRIEND), tr("Make friend"), this, SLOT(makeFriend()));
}
if(peer_id == rsPeers->getGPGOwnId())
contextMnu->addAction(QIcon(IMAGE_EXPORT), tr("Export my certificate..."), this, SLOT(on_actionExportKey_activated()));
contextMnu->addAction(QIcon(IMAGE_EXPORT), tr("Export/create a new location"), this, SLOT(on_actionExportKey_activated()));
contextMnu->addAction(QIcon(IMAGE_PEERDETAILS), tr("Peer details..."), this, SLOT(peerdetails()));
//contextMnu->addAction(QIcon(IMAGE_MESSAGE), tr("Send Message"), this, SLOT(sendDistantMessage()));
contextMnu->addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyLink()));
//contextMnu->addAction(QIcon(IMAGE_MESSAGE), tr("Send Message"), this, SLOT(sendDistantMessage()));
//contextMnu->addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyLink()));
contextMnu->addSeparator() ;
contextMnu->addAction(QIcon(IMAGE_CLEAN_UNUSED), tr("Remove unused keys..."), this, SLOT(removeUnusedKeys()));
@ -690,42 +691,8 @@ void NetworkDialog::on_actionAddFriend_activated()
void NetworkDialog::on_actionExportKey_activated()
{
// qDebug() << " exportcert";
//
// std::string cert = rsPeers->GetRetroshareInvite();
// if (cert.empty()) {
// QMessageBox::information(this, tr("RetroShare"),
// tr("Sorry, create certificate failed"),
// QMessageBox::Ok, QMessageBox::Ok);
// return;
// }
//
// use misc::getSaveFileName
// QString qdir = QFileDialog::getSaveFileName(this,
// tr("Please choose a filename"),
// QDir::homePath(),
// tr("RetroShare Certificate (*.rsc );;All Files (*)"));
// //Todo: move save to file to p3Peers::SaveCertificateToFile
//
// if (qdir.isEmpty() == false) {
// QFile CertFile (qdir);
// if (CertFile.open(QIODevice::WriteOnly/* | QIODevice::Text*/)) {
// if (CertFile.write(QByteArray(cert.c_str())) > 0) {
// QMessageBox::information(this, tr("RetroShare"),
// tr("Certificate file successfully created"),
// QMessageBox::Ok, QMessageBox::Ok);
// } else {
// QMessageBox::information(this, tr("RetroShare"),
// tr("Sorry, certificate file creation failed"),
// QMessageBox::Ok, QMessageBox::Ok);
// }
// CertFile.close();
// } else {
// QMessageBox::information(this, tr("RetroShare"),
// tr("Sorry, certificate file creation failed"),
// QMessageBox::Ok, QMessageBox::Ok);
// }
// }
ProfileManager prof ;
prof.exec() ;
}
void NetworkDialog::on_actionCreate_New_Profile_activated()

View File

@ -207,11 +207,12 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, std
/* look up real name */
std::string authorName = rsPeers->getGPGName(details.mPgpId);
comment += QString::fromUtf8(authorName.c_str());
comment += " [";
comment += QString::fromStdString(details.mPgpId.toStdString()) ;
comment += "]";
}
comment += " [";
comment += QString::fromStdString(details.mPgpId.toStdString()) ;
comment += "]";
else
comment += QObject::tr("signed by unknown Key") ;
}
else
comment += "Authentication: anonymous" ;

View File

@ -48,22 +48,15 @@ ProfileManager::ProfileManager(QWidget *parent)
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
// setAttribute ( Qt::WA_DeleteOnClose, true );
ui.headerFrame->setHeaderImage(QPixmap(":/images/contact_new128.png"));
ui.headerFrame->setHeaderText(tr("Profile Manager"));
connect(ui.identityTreeWidget, SIGNAL( customContextMenuRequested(QPoint)), this, SLOT( identityTreeWidgetCostumPopupMenu(QPoint)));
connect(ui.identityTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(identityItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)));
// connect(ui.newIdentity_PB, SIGNAL(clicked()), this, SLOT(newIdentity()));
// connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity()));
connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity()));
// ui.newIdentity_PB->hide() ;
// ui.importIdentity_PB->hide() ;
// ui.exportIdentity_PB->setEnabled(false);
fillIdentities();
ui.exportIdentity_PB->setEnabled(false);
}
void ProfileManager::identityTreeWidgetCostumPopupMenu(QPoint)
@ -90,6 +83,8 @@ void ProfileManager::fillIdentities()
ui.identityTreeWidget->setColumnWidth(COLUMN_NAME, 200);
ui.identityTreeWidget->setColumnWidth(COLUMN_EMAIL, 200);
RsPgpId own_pgp_id = rsPeers->getGPGOwnId() ;
std::cerr << "Finding PGPUsers" << std::endl;
QTreeWidget *identityTreeWidget = ui.identityTreeWidget;
@ -111,6 +106,12 @@ void ProfileManager::fillIdentities()
item -> setText(COLUMN_EMAIL, QString::fromUtf8(email.c_str()));
item -> setText(COLUMN_GID, gid);
identityTreeWidget->addTopLevelItem(item);
if(own_pgp_id == *it)
{
item->setSelected(true) ;
ui.exportIdentity_PB->setEnabled(true);
}
}
}

View File

@ -54,12 +54,12 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;Select an identity from the list below to be used on another computer, and press &amp;quot;Export selected identity&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;To use it on a different computer, select the identity manager in the login window. From there you can import the identity file and create a new location for that identity. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;When keeping the same identity for your new location, your friends will automatically accept you.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Select a Retroshare node key from the list below to be used on another computer, and press &amp;quot;Export selected key.&amp;quot;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;To create a new location on a different computer, select the identity manager in the login window. From there you can import the key file and create a new location for that key. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Creating a new node with the same key allows your your friend nodes to accept you automatically.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -73,7 +73,7 @@ p, li { white-space: pre-wrap; }
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Identities</string>
<string>Full keys available in your keyring:</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
@ -110,7 +110,7 @@ p, li { white-space: pre-wrap; }
</size>
</property>
<property name="text">
<string>Export selected identity</string>
<string>Export selected key</string>
</property>
</widget>
</item>

View File

@ -47,10 +47,6 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(fileSaveAs()));
connect(ui._includeSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(load()));
connect(ui._copyLink_PB, SIGNAL(clicked()), this, SLOT(copyRSLink()));
connect(ui._useOldFormat_CB, SIGNAL(toggled(bool)), this, SLOT(load()));
ui._useOldFormat_CB->setEnabled(false) ;
ui._useOldFormat_CB->setChecked(false) ;
// hide profile manager as it causes bugs when generating a new profile.
//ui.profile_Button->hide() ;
@ -59,15 +55,14 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WindowFlags flags)
#ifdef Q_WS_WIN
#endif
connect(ui.profile_Button,SIGNAL(clicked()), this, SLOT(profilemanager()));
connect(ui.createNewLocation_PB,SIGNAL(clicked()), this, SLOT(profilemanager()));
ui.onlinesince->setText(DateTime::formatLongDateTime(Rshare::startupTime()));
}
void CryptoPage::profilemanager()
{
ProfileManager profilemanager;
profilemanager.exec();
ProfileManager().exec();
}
void CryptoPage::showEvent ( QShowEvent * /*event*/ )
{

View File

@ -40,7 +40,7 @@ class CryptoPage : public ConfigPage
/** Loads the settings for this page */
virtual QPixmap iconPixmap() const { return QPixmap(":/images/encrypted32.png") ; }
virtual QString pageName() const { return tr("Profile") ; }
virtual QString pageName() const { return tr("Node") ; }
virtual QString helpText() const { return ""; }
private slots:

View File

@ -14,56 +14,13 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Profile</string>
<string>Node information</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QToolButton" name="profile_Button">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Profile Manager</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/contact_new.png</normaloff>:/images/contact_new.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frame_1">
<property name="frameShape">
@ -233,7 +190,7 @@
</size>
</property>
<property name="text">
<string>Identity ID</string>
<string>PGP Id :</string>
</property>
</widget>
</item>
@ -303,7 +260,7 @@
</size>
</property>
<property name="text">
<string>Number of Friends:</string>
<string>Friend nodes:</string>
</property>
</widget>
</item>
@ -492,16 +449,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_useOldFormat_CB">
<property name="text">
<string>Use old key format</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
@ -522,7 +469,7 @@
<item>
<widget class="QPushButton" name="_copyLink_PB">
<property name="text">
<string>Copy link to clipboard</string>
<string>Copy certificate to clipboard</string>
</property>
</widget>
</item>
@ -532,7 +479,14 @@
<string>Save Key into a file</string>
</property>
<property name="text">
<string>Save Key</string>
<string>Save certificate to file</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="createNewLocation_PB">
<property name="text">
<string>Create new location...</string>
</property>
</widget>
</item>