Merge pull request #14 from RetroShare/master

update master
This commit is contained in:
defnax 2019-10-01 13:56:04 +02:00 committed by GitHub
commit 5ffb404231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 594 additions and 374 deletions

View File

@ -1581,24 +1581,25 @@ void PGPHandler::locked_updateOwnSignatureFlag(PGPCertificateInfo& cert,const Rs
cert._flags &= ~PGPCertificateInfo::PGP_CERTIFICATE_FLAG_HAS_SIGNED_ME ;
}
RsPgpId PGPHandler::pgpIdFromFingerprint(const PGPFingerprintType& f)
/*static*/ RsPgpId PGPHandler::pgpIdFromFingerprint(const RsPgpFingerprint& f)
{
return RsPgpId(f.toByteArray() + _RsIdSize::PGP_FINGERPRINT - _RsIdSize::PGP_ID);
return RsPgpId::fromBufferUnsafe(
f.toByteArray() +
RsPgpFingerprint::SIZE_IN_BYTES - RsPgpId::SIZE_IN_BYTES );
}
bool PGPHandler::getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const
bool PGPHandler::getKeyFingerprint(const RsPgpId& id, RsPgpFingerprint& fp) const
{
RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures.
RS_STACK_MUTEX(pgphandlerMtx);
const ops_keydata_t *key = locked_getPublicKey(id,false) ;
if(key == NULL)
return false ;
if(!key) return false;
ops_fingerprint_t f ;
ops_fingerprint(&f,&key->key.pkey) ;
fp = PGPFingerprintType(f.fingerprint) ;
fp = RsPgpFingerprint::fromBufferUnsafe(f.fingerprint);
return true ;
}
@ -1667,6 +1668,9 @@ bool PGPHandler::getGPGFilteredList(std::list<RsPgpId>& list,bool (*filter)(cons
return true ;
}
bool PGPHandler::isPgpPubKeyAvailable(const RsPgpId &id)
{ return _public_keyring_map.find(id) != _public_keyring_map.end(); }
bool PGPHandler::isGPGId(const RsPgpId &id)
{
return _public_keyring_map.find(id) != _public_keyring_map.end() ;

View File

@ -79,7 +79,7 @@ class PGPCertificateInfo
/// This class offer an abstract pgp handler to be used in RetroShare.
class PGPHandler
{
public:
public:
PGPHandler( const std::string& path_to_public_keyring,
const std::string& path_to_secret_keyring,
const std::string& path_to_trust_database,
@ -124,7 +124,6 @@ class PGPHandler
bool encryptTextToFile(const RsPgpId& key_id,const std::string& text,const std::string& outfile) ;
bool decryptTextFromFile(const RsPgpId& key_id,std::string& text,const std::string& encrypted_inputfile) ;
bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const ;
void setAcceptConnexion(const RsPgpId&,bool) ;
void updateOwnSignatureFlag(const RsPgpId& ownId) ;
@ -148,13 +147,37 @@ class PGPHandler
const PGPCertificateInfo *getCertificateInfo(const RsPgpId& id) const ;
RS_DEPRECATED_FOR(isPgpPubKeyAvailable)
bool isGPGId(const RsPgpId &id);
bool isGPGSigned(const RsPgpId &id);
bool isGPGAccepted(const RsPgpId &id);
static void setPassphraseCallback(PassphraseCallback cb) ;
static PassphraseCallback passphraseCallback() { return _passphrase_callback ; }
static RsPgpId pgpIdFromFingerprint(const PGPFingerprintType& f) ;
/**
* @brief Check if a PGP publick key is available
* @param id id of the key to check
* @return true if the public key for the given id is available,
* false otherwise
*/
bool isPgpPubKeyAvailable(const RsPgpId& id);
/**
* @brief Convert PGP fingerprint to PGP 64bit id
* @param f PGP fingerprint to convert
* @return PGP 64bit id extracted from fingerprint
*/
static RsPgpId pgpIdFromFingerprint(const RsPgpFingerprint& f);
/**
* @brief Get PGP fingerprint for the given key
* @param id PGP 64bit key id
* @param fp storage for the retrived key fingerpring, the contained value
* is meaningfull only if true is returned
* @return true if the key was found, false if not
*/
bool getKeyFingerprint(const RsPgpId& id, RsPgpFingerprint& fp) const;
// Gets info about the key. Who are the signers, what's the owner's name, etc.
//

View File

@ -1071,45 +1071,81 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg
}
bool p3PeerMgrIMPL::addSslOnlyFriend( const RsPeerId& sslId, const RsPgpId& pgp_id,const RsPeerDetails& dt )
bool p3PeerMgrIMPL::addSslOnlyFriend(
const RsPeerId& sslId, const RsPgpId& pgp_id, const RsPeerDetails& dt )
{
if(sslId.isNull() || sslId == getOwnId())
{
RsErr() <<"Attempt to add yourself or a null ID as SSL-only friend (id=" << sslId << ")" << std::endl;
return false;
}
peerState pstate;
// {
// RS_STACK_MUTEX(mPeerMtx);
//
// /* If in mOthersList -> move over */
// auto it = mOthersList.find(sslId);
// if (it != mOthersList.end())
// {
// pstate = it->second;
// mOthersList.erase(it);
// }
//
//
// } // RS_STACK_MUTEX(mPeerMtx);
if(!pstate.gpg_id.isNull() && AuthGPG::getAuthGPG()->isGPGAccepted(pstate.gpg_id))
if(sslId.isNull())
{
RsErr() << "Trying to add as SSL-only friend a peer which PGP id is already a friend. This means the code is inconsistent. Not doing this!" << std::endl;
RsErr() << __PRETTY_FUNCTION__ << " Cannot add a null "
<< "ID as SSL-only friend " << std::endl;
return false;
}
if(pgp_id.isNull())
{
RsErr() << "Null pgp id for friend added with skip_pgp_signature_validaiton flag. This is not allowed." << std::endl;
return false;
}
if(pgp_id.isNull())
{
RsErr() << __PRETTY_FUNCTION__ << " Cannot add as SSL-only friend a "
<< "peer with null PGP" << std::endl;
return false;
}
if(sslId == getOwnId())
{
RsErr() << __PRETTY_FUNCTION__ << " Cannot add yourself as SSL-only "
<< "friend (id=" << sslId << ")" << std::endl;
return false;
}
bool alreadySslFriend = false;
peerState pstate;
{ RS_STACK_MUTEX(mPeerMtx);
auto it = mFriendList.find(sslId);
if( it != mFriendList.end() )
{
alreadySslFriend = true;
/* If it is already friend override pstate so we don't loose already
* known information about the peer, in particular overriding
* pstate.skip_pgp_signature_validation is important for security.
*/
pstate = it->second;
}
} // RS_STACK_MUTEX(mPeerMtx);
/* If it is already friend check if PGP id of the invite matches with the
* PGP id we already know, to avoid nasty tricks with malevolently forged
* short invites.*/
if(alreadySslFriend && pstate.gpg_id != pgp_id)
{
RsErr() << __PRETTY_FUNCTION__ << " Cannot SSL-only friend for "
<< "a pre-existing friend with mismatching PGP-id "
<< "known: " << pstate.gpg_id << " new: " << pgp_id
<< std::endl;
return false;
}
/* It is very important to be expecially carefull setting
* pstate.skip_pgp_signature_validation to true because this effectively
* disables PGP signature verification on connection attempt.
* This check in particular avoid someone attempting to trick the user into
* accepting as SSL-only friend a malevolently forged short invite, with the
* PGP id of an already known friend but the SSL-id of a location generated
* by the attacker which doesn't have access to the legitimate PGP
* certificate.
* In that case being pstate.skip_pgp_signature_validation false on
* connection attempt the PGP signaure verification would fail and the
* connection closed.
* Instead if pstate.skip_pgp_signature_validation would have been
* superficially set to true the PGP signature verification would have been
* skipped and the attacker connection would be accepted. */
if(!AuthGPG::getAuthGPG()->isPgpPubKeyAvailable(pgp_id))
pstate.skip_pgp_signature_validation = true;
pstate.gpg_id = pgp_id;
pstate.id = sslId;
/* At this point if we got info about the peer just update with the new
* values. */
if(!dt.name.empty()) pstate.name = dt.name;
if(!dt.dyndns.empty()) pstate.dyndns = dt.dyndns;
pstate.hiddenNode = dt.isHiddenNode;
@ -1119,19 +1155,17 @@ bool p3PeerMgrIMPL::addSslOnlyFriend( const RsPeerId& sslId, const RsPgpId& pgp_
if(dt.hiddenType) pstate.hiddenType = dt.hiddenType;
if(!dt.location.empty()) pstate.location = dt.location;
pstate.skip_pgp_signature_validation = true;
{ RS_STACK_MUTEX(mPeerMtx);
mFriendList[sslId] = pstate;
mStatusChanged = true;
} // RS_STACK_MUTEX(mPeerMtx);
IndicateConfigChanged();
mLinkMgr->addFriend(sslId, dt.vs_dht != RS_VS_DHT_OFF);
// To update IP addresses is much more confortable to use locators
/* To update IP addresses is much more confortable to use locators, beside
* of the easy to use another benefit is that this way we don't loose
* previously known IP addresses */
if(!dt.isHiddenNode)
{
for(const std::string& locator : dt.ipAddressList)

View File

@ -1148,6 +1148,7 @@ enum class RsShortInviteFieldType : uint8_t
PEER_NAME = 0x01,
LOCATOR = 0x02,
PGP_FINGERPRINT = 0x03,
CHECKSUM = 0x04,
/* The following will be deprecated, and ported to LOCATOR when generic
* trasport layer will be implemented */
@ -1266,6 +1267,17 @@ bool p3Peers::getShortInvite(
offset += tLocator.size();
}
}
uint32_t computed_crc = PGPKeyManagement::compute24bitsCRC(buf,offset) ;
// handle endian issues.
unsigned char mem[3] ;
mem[0] = computed_crc & 0xff ;
mem[1] = (computed_crc >> 8 ) & 0xff ;
mem[2] = (computed_crc >> 16) & 0xff ;
addPacketHeader( RsShortInviteFieldType::CHECKSUM,3,buf,offset,buf_size);
memcpy(&buf[offset],mem,3);
offset += 3;
Radix64::encode(buf, static_cast<int>(offset), invite);
@ -1299,6 +1311,7 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d
unsigned char* buf = bf.data();
size_t total_s = 0;
bool CRC_ok = false ; // not checked yet
while(total_s < size)
{
@ -1373,6 +1386,25 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d
details.hiddenNodeAddress = std::string((char*)&buf[6],s-6);
break;
case RsShortInviteFieldType::CHECKSUM:
{
if(s != 3 || total_s+3 != size) // make sure the checksum is the last section
{
err_code = CERTIFICATE_PARSING_ERROR_INVALID_CHECKSUM_SECTION;
return false;
}
uint32_t computed_crc = PGPKeyManagement::compute24bitsCRC(bf.data(),size-5);
uint32_t certificate_crc = static_cast<uint32_t>( buf[0] + (buf[1] << 8) + (buf[2] << 16) );
if(computed_crc != certificate_crc)
{
err_code = CERTIFICATE_PARSING_ERROR_CHECKSUM_ERROR;
return false;
}
CRC_ok = true;
break;
}
}
buf = &buf[s];
@ -1396,6 +1428,11 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d
else
details.skip_pgp_signature_validation = true;
if(!CRC_ok)
{
err_code = CERTIFICATE_PARSING_ERROR_CHECKSUM_ERROR;
return false;
}
if(details.gpg_id.isNull())
{
err_code = CERTIFICATE_PARSING_ERROR_MISSING_PGP_FINGERPRINT;

View File

@ -32,7 +32,7 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
@ -116,6 +116,9 @@
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="lobbyTreeVLayout">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QFrame" name="toolBarFrame">
<property name="styleSheet">

View File

@ -32,7 +32,7 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
@ -176,7 +176,7 @@
<widget class="QWidget" name="dwloadsTab">
<layout class="QGridLayout" name="dwloadsTabGLayout">
<item row="0" column="0">
<widget class="LineEditClear" name="filterLineEdit"/>
<widget class="LineEditClear" name="filterLineEdit"/>
</item>
<item row="1" column="0">
<widget class="QTreeView" name="downloadList">

View File

@ -32,7 +32,7 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>

View File

@ -341,7 +341,7 @@ void GenCertDialog::setupState()
ui.genButton->setVisible(false) ;
ui.generate_label->setVisible(false) ;
ui.info_label->setText("Please fill your profile name and password...") ;
ui.info_label->setText("Please choose a profile name and password...") ;
ui.info_label->setVisible(true) ;
}
else if(!mEntropyOk)

View File

@ -68,84 +68,102 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="nodeType_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Node type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="nodeType_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Standard node</string>
</property>
</item>
<item>
<property name="text">
<string>Hidden node (over Tor)</string>
</property>
</item>
<item>
<property name="text">
<string>Hidden node (Tor/I2P - Manually configured)</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="toolBarHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="adv_checkbox">
<property name="text">
<string>advanced options</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="nodeTypeExplanation_TE">
<property name="text">
<string>TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>24</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>24</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="nodeTypeExplanation_TE">
<property name="text">
<string>TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="nodeType_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Node type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="nodeType_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Standard node</string>
</property>
</item>
<item>
<property name="text">
<string>Hidden node (over Tor)</string>
</property>
</item>
<item>
<property name="text">
<string>Hidden node (Tor/I2P - Manually configured)</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QCheckBox" name="adv_checkbox">
<property name="text">
<string>advanced options</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="toolBarHSpacer">
<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>
</layout>
</widget>
</item>
<item>

View File

@ -49,14 +49,15 @@ HomePage::HomePage(QWidget *parent) :
MainPage(parent),
ui(new Ui::HomePage),
mIncludeAllIPs(false),
mUseShortFormat(true)
mUseShortFormat(false)
{
ui->setupUi(this);
updateOwnCert();
updateOwnId();
connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addFriend()));
//connect(ui->LoadCertFileButton, SIGNAL(clicked()), this, SLOT(loadCert()));
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(doExpand()));
QAction *WebMailAction = new QAction(QIcon(),tr("Invite via WebMail"), this);
connect(WebMailAction, SIGNAL(triggered()), this, SLOT(webMail()));
@ -66,9 +67,24 @@ HomePage::HomePage(QWidget *parent) :
QAction *SendAction = new QAction(QIcon(),tr("Send via Email"), this);
connect(SendAction, SIGNAL(triggered()), this, SLOT(runEmailClient()));
QAction *CopyIdAction = new QAction(QIcon(),tr("Copy your Retroshare ID to Clipboard"), this);
connect(CopyIdAction, SIGNAL(triggered()), this, SLOT(copyId()));
QMenu *menu = new QMenu();
menu->addAction(SendAction);
menu->addAction(CopyIdAction);
if(!RsAccounts::isHiddenNode())
{
QAction *includeIPsAct = new QAction(QIcon(), tr("Include all your known IPs"),this);
connect(includeIPsAct, SIGNAL(triggered()), this, SLOT(toggleIncludeAllIPs()));
includeIPsAct->setCheckable(true);
includeIPsAct->setChecked(mIncludeAllIPs);
menu->addAction(includeIPsAct);
}
menu->addSeparator();
menu->addAction(SendAction);
menu->addAction(WebMailAction);
menu->addAction(RecAction);
@ -78,7 +94,7 @@ HomePage::HomePage(QWidget *parent) :
connect(ui->openwebhelp,SIGNAL(clicked()), this,SLOT(openWebHelp())) ;
//ui->LoadCertFileButton->hide(); // duplicates functionality => not good.
ui->userCertEdit->hide();
int S = QFontMetricsF(font()).height();
QString help_str = tr(
@ -137,6 +153,7 @@ void HomePage::toggleIncludeAllIPs()
{
mIncludeAllIPs = !mIncludeAllIPs;
updateOwnCert();
updateOwnId();
}
HomePage::~HomePage()
@ -170,6 +187,24 @@ void HomePage::updateOwnCert()
ui->userCertEdit->setToolTip(description);
}
void HomePage::updateOwnId()
{
bool include_extra_locators = mIncludeAllIPs;
RsPeerDetails detail;
if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail))
{
std::cerr << "(EE) Cannot retrieve information about own certificate. That is a real problem!!" << std::endl;
return ;
}
std::string invite ;
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,!mIncludeAllIPs);
ui->retroshareid->setText(QString::fromUtf8(invite.c_str()));
}
static void sendMail(QString sAddress, QString sSubject, QString sBody)
{
#ifdef Q_OS_WIN
@ -212,7 +247,14 @@ void HomePage::copyCert()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(ui->userCertEdit->toPlainText());
QMessageBox::information(this, "RetroShare", tr("Your Cert is copied to Clipboard, paste and send it to your friend via email or some other way"));
QMessageBox::information(this, "RetroShare", tr("Your Retroshare certificate is copied to Clipboard, paste and send it to your friend via email or some other way"));
}
void HomePage::copyId()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(ui->retroshareid->text());
QMessageBox::information(this, "RetroShare", tr("Your Retroshare ID is copied to Clipboard, paste and send it to your friend via email or some other way"));
}
void HomePage::saveCert()
@ -261,3 +303,19 @@ void HomePage::openWebHelp()
{
QDesktopServices::openUrl(QUrl(QString("https://retroshare.readthedocs.io")));
}
void HomePage::doExpand()
{
if (ui->expandButton->isChecked())
{
ui->userCertEdit->show();
ui->expandButton->setToolTip(tr("Hide"));
}
else
{
ui->userCertEdit->hide();
ui->expandButton->setToolTip(tr("Show full certificate (old format)"));
}
}

View File

@ -49,8 +49,10 @@ public:
private slots:
void certContextMenu(QPoint);
void updateOwnCert();
void updateOwnId();
void runEmailClient();
void copyCert();
void copyId();
void saveCert();
void addFriend();
void webMail();
@ -59,6 +61,7 @@ private slots:
void recommendFriends();
void toggleIncludeAllIPs();
void toggleUseShortFormat();
void doExpand();
private:
Ui::HomePage *ui;

View File

@ -6,14 +6,121 @@
<rect>
<x>0</x>
<y>0</y>
<width>1334</width>
<height>867</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="1" colspan="2">
<widget class="QFrame" name="addframe">
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Did you receive a Retroshare id from a friend?</string>
</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>
<item>
<widget class="QToolButton" name="addButton">
<property name="text">
<string>Add friend</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/png/invite.png</normaloff>:/icons/png/invite.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QFrame" name="helpframe">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>Do you need help with Retroshare?</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="openwebhelp">
<property name="text">
<string>Open Web Help</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/settings/webinterface.svg</normaloff>:/icons/settings/webinterface.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label">
<property name="sizePolicy">
@ -33,7 +140,24 @@
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Open Source cross-platform,
private and secure decentralized communication platform.
</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
<number>9</number>
@ -44,27 +168,6 @@
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="1" column="2">
<widget class="QLabel" name="userCertLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>The text below is your own Retroshare certificate. Send it to your friends</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="helpButton">
<property name="text">
@ -77,10 +180,71 @@
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<item row="1" column="4">
<widget class="QToolButton" name="shareButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Share your RetroShare ID&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/svg/share.svg</normaloff>:/icons/svg/share.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="retroshareid">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="text">
<string/>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="5">
<widget class="QPlainTextEdit" name="userCertEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Courier New</family>
@ -109,23 +273,38 @@
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QToolButton" name="shareButton">
<item row="0" column="2">
<widget class="QLabel" name="userCertLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>This is your Retroshare ID. Copy and share with your friends!</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QToolButton" name="expandButton">
<property name="toolTip">
<string>Share your RetroShare Key</string>
<string>Show full certificate (old format)</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/svg/share.svg</normaloff>:/icons/svg/share.svg</iconset>
<normaloff>:/icons/png/cert.png</normaloff>:/icons/png/cert.png</iconset>
</property>
<property name="iconSize">
<size>
@ -133,8 +312,8 @@
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
@ -143,165 +322,20 @@
</item>
</layout>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Open Source cross-platform,
private and secure decentralized communication platform.
</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QFrame" name="helpframe">
<property name="styleSheet">
<string notr="true"/>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>Do you need help with RetroShare?</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="openwebhelp">
<property name="text">
<string>Open Web Help</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/settings/webinterface.svg</normaloff>:/icons/settings/webinterface.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="6" column="1">
<widget class="QFrame" name="addFrame">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QFrame" name="addframe">
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Did you receive a certificate from a friend?</string>
</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>
<item>
<widget class="QToolButton" name="addButton">
<property name="text">
<string>Add friends certificate</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/png/invite.png</normaloff>:/icons/png/invite.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</spacer>
</item>
</layout>
<zorder>label</zorder>
<zorder>addFrame</zorder>
<zorder>label_2</zorder>
<zorder>addframe</zorder>
<zorder>frame</zorder>
<zorder>helpframe</zorder>
</widget>
<resources>
<include location="images.qrc"/>

View File

@ -32,6 +32,9 @@
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="titleBarFrame">
<property name="sizePolicy">
@ -41,7 +44,7 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
@ -138,6 +141,9 @@
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="leftVLayout">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QFrame" name="toolBarFrame">
<property name="frameShape">
@ -283,8 +289,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1372</width>
<height>999</height>
<width>1003</width>
<height>1094</height>
</rect>
</property>
<layout class="QVBoxLayout" name="scrollAreaWidgetContentsVLayout">

View File

@ -32,7 +32,7 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>

View File

@ -210,7 +210,7 @@ void GroupTreeWidget::addToolButton(QToolButton *toolButton)
toolButton->setIconSize(ui->displayButton->iconSize());
toolButton->setFocusPolicy(ui->displayButton->focusPolicy());
ui->titleBarFrame->layout()->addWidget(toolButton);
ui->toolBarFrame->layout()->addWidget(toolButton);
}
// Load and save settings (group must be started from the caller)

View File

@ -27,7 +27,7 @@
<number>0</number>
</property>
<item>
<widget class="QFrame" name="titleBarFrame">
<widget class="QFrame" name="toolBarFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>

View File

@ -596,7 +596,7 @@ static void sendMail(QString sAddress, QString sSubject, QString sBody)
bool ConnectFriendWizard::validateCurrentPage()
{
error = true;
error = false;
switch ((Page) currentId()) {
case Page_WebMail:
@ -616,14 +616,14 @@ bool ConnectFriendWizard::validateCurrentPage()
if(peerDetails.id == rsPeers->getOwnId())
{
setField("errorMessage", tr("This is your own certificate! You would not want to make friend with yourself. Wouldn't you?") ) ;
error = false;
error = true;
}
break;
}
// error message
setField("errorMessage", tr("Certificate Load Failed") + ": \n\n" + getErrorString(cert_load_error_code)) ;
error = false;
error = true;
break;
}
case Page_ErrorMessage:
@ -638,7 +638,7 @@ bool ConnectFriendWizard::validateCurrentPage()
int ConnectFriendWizard::nextId() const
{
switch ((Page) currentId()) {
case Page_Text: return Page_Conclusion;
case Page_Text: return error?Page_ErrorMessage:Page_Conclusion;
case Page_WebMail:
case Page_ErrorMessage:
case Page_Conclusion:

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1139</width>
<height>1171</height>
<width>600</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
@ -19,10 +19,10 @@
</property>
<widget class="ConnectFriendPage" name="TextPage">
<property name="title">
<string>RetroShare certificate</string>
<string>RetroShare ID</string>
</property>
<property name="subTitle">
<string>Please paste below your friend's Retroshare certificate</string>
<string>Please paste below your friend's Retroshare ID</string>
</property>
<attribute name="pageId">
<string notr="true">ConnectFriendWizard::Page_Text</string>
@ -207,7 +207,7 @@
<item row="0" column="0">
<widget class="QLabel" name="userCertLabel">
<property name="text">
<string>The text below is your Retroshare certificate. You have to provide it to your friend</string>
<string>The text below is your Retroshare ID. You have to provide it to your friend</string>
</property>
</widget>
</item>
@ -229,10 +229,10 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Paste Cert of your friend from Clipboard</string>
<string>Paste ID of your friend from Clipboard</string>
</property>
<property name="text">
<string>Paste certificate</string>
<string>Paste</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
@ -267,7 +267,7 @@
<string>Open Cert of your friend from File</string>
</property>
<property name="text">
<string>Open certificate</string>
<string>Open</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
@ -314,7 +314,7 @@
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="placeholderText">
<string>Please, paste your friend's Retroshare certificate into the box below</string>
<string>Please, paste your friend's Retroshare ID into the box below</string>
</property>
</widget>
</item>

View File

@ -32,7 +32,7 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>

View File

@ -71,6 +71,7 @@
<file>icons/png/add.png</file>
<file>icons/png/attach-image.png</file>
<file>icons/png/attach.png</file>
<file>icons/png/cert.png</file>
<file>icons/png/channels-notify.png</file>
<file>icons/png/channels.png</file>
<file>icons/png/chat-bubble-notify.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -24,7 +24,7 @@
<number>0</number>
</property>
<item>
<widget class="QFrame" name="toolBarFrame">
<widget class="QFrame" name="titleBarFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -40,11 +40,11 @@
<property name="maximumSize">
<size>
<width>16777215</width>
<height>36</height>
<height>28</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
@ -96,7 +96,7 @@
<string>Compose</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/folder-draft24.png</normaloff>:/images/folder-draft24.png</iconset>
</property>
<property name="iconSize">
@ -137,7 +137,7 @@
<string>Delete</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/deletemail24.png</normaloff>:/images/deletemail24.png</iconset>
</property>
<property name="iconSize">
@ -201,7 +201,7 @@
<string>Foward</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/mailforward24-hover.png</normaloff>:/images/mailforward24-hover.png</iconset>
</property>
<property name="iconSize">
@ -248,7 +248,7 @@
<string>Print</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/print24.png</normaloff>:/images/print24.png</iconset>
</property>
<property name="iconSize">
@ -283,7 +283,7 @@
<string>Display</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property>
<property name="iconSize">
@ -324,7 +324,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="icons.qrc">:/icons/png/messages.png</pixmap>
<pixmap resource="../icons.qrc">:/icons/png/messages.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
@ -343,7 +343,7 @@
<string>Tags</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/tag24.png</normaloff>:/images/tag24.png</iconset>
</property>
<property name="iconSize">
@ -390,7 +390,7 @@
<string>Reply</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/replymail-pressed.png</normaloff>:/images/replymail-pressed.png</iconset>
</property>
<property name="iconSize">
@ -431,7 +431,7 @@
<string>Reply all</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/replymailall24-hover.png</normaloff>:/images/replymailall24-hover.png</iconset>
</property>
<property name="iconSize">
@ -454,7 +454,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
@ -570,7 +570,7 @@
<string>Inbox</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/folder-inbox.png</normaloff>:/images/folder-inbox.png</iconset>
</property>
</item>
@ -579,7 +579,7 @@
<string>Outbox</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/folder-outbox.png</normaloff>:/images/folder-outbox.png</iconset>
</property>
</item>
@ -588,7 +588,7 @@
<string>Draft</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/folder-draft.png</normaloff>:/images/folder-draft.png</iconset>
</property>
</item>
@ -597,7 +597,7 @@
<string>Sent</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/folder-sent.png</normaloff>:/images/folder-sent.png</iconset>
</property>
</item>
@ -606,7 +606,7 @@
<string>Trash</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/folder-trash.png</normaloff>:/images/folder-trash.png</iconset>
</property>
</item>
@ -662,7 +662,7 @@
</size>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/foldermail.png</pixmap>
<pixmap resource="../images.qrc">:/images/foldermail.png</pixmap>
</property>
</widget>
</item>
@ -703,7 +703,7 @@
</size>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/tag24.png</pixmap>
<pixmap resource="../images.qrc">:/images/tag24.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
@ -804,7 +804,7 @@
</action>
<action name="actionReply">
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_reply.png</normaloff>:/images/mail_reply.png</iconset>
</property>
<property name="text">
@ -813,7 +813,7 @@
</action>
<action name="actionReplyAll">
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_replyall.png</normaloff>:/images/mail_replyall.png</iconset>
</property>
<property name="text">
@ -822,7 +822,7 @@
</action>
<action name="actionForward">
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_forward.png</normaloff>:/images/mail_forward.png</iconset>
</property>
<property name="text">
@ -831,16 +831,16 @@
</action>
</widget>
<customwidgets>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
<customwidget>
<class>RSTabWidget</class>
<extends>QTabWidget</extends>
@ -853,8 +853,8 @@
<tabstop>listWidget</tabstop>
</tabstops>
<resources>
<include location="images.qrc"/>
<include location="icons.qrc"/>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -2,7 +2,7 @@
/* Standard rules */
QFrame#titleBarFrame, QFrame#toolBarFrame {
QFrame#toolBarFrame {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;
}
@ -740,9 +740,8 @@ ConnectFriendWizard QPlainTextEdit#friendCertEdit {
}
HomePage QPlainTextEdit#userCertEdit {
border: 2px solid #0099cc;
border-radius: 6px;
background: white;
background: transparent;
}
HomePage QFrame#addframe{