Merge remote-tracking branch 'upstream/master' into v0.6-CacheTests

This commit is contained in:
csoler 2021-01-02 22:25:10 +01:00
commit a6010beab3
51 changed files with 1382 additions and 785 deletions

View File

@ -258,8 +258,7 @@ int p3discovery2::handleIncoming()
++nhandled;
Dbg4() << __PRETTY_FUNCTION__ << " Received item: " << std::endl
<< *item << std::endl;
Dbg4() << __PRETTY_FUNCTION__ << " Received item: " << *item << std::endl;
if((contact = dynamic_cast<RsDiscContactItem *>(item)) != nullptr)
{
@ -269,30 +268,26 @@ int p3discovery2::handleIncoming()
processContactInfo(item->PeerId(), contact);
}
else if( (gxsidlst = dynamic_cast<RsDiscIdentityListItem *>(item)) != nullptr )
{
recvIdentityList(item->PeerId(),gxsidlst->ownIdentityList);
delete item;
}
else if((pgpkey = dynamic_cast<RsDiscPgpKeyItem *>(item)) != nullptr)
recvPGPCertificate(item->PeerId(), pgpkey);
else if((pgpcert = dynamic_cast<RsDiscPgpCertItem *>(item)) != nullptr)
// sink
delete pgpcert;
RsWarn() << "Received a deprecated RsDiscPgpCertItem. Will not be handled." << std::endl; // nothing to do.
else if((pgplist = dynamic_cast<RsDiscPgpListItem *>(item)) != nullptr)
{
if (pgplist->mode == RsGossipDiscoveryPgpListMode::FRIENDS)
processPGPList(pgplist->PeerId(), pgplist);
else if (pgplist->mode == RsGossipDiscoveryPgpListMode::GETCERT)
recvPGPCertificateRequest(pgplist->PeerId(), pgplist);
else delete item;
}
else
{
RsWarn() << __PRETTY_FUNCTION__ << " Received unknown item type " << (int)item->PacketSubType() << "! " << std::endl ;
RsWarn() << item << std::endl;
delete item;
}
}
delete item;
}
return nhandled;
}
@ -350,8 +345,6 @@ void p3discovery2::sendOwnContactInfo(const RsPeerId &sslid)
void p3discovery2::recvOwnContactInfo(const RsPeerId &fromId, const RsDiscContactItem *item)
{
std::unique_ptr<const RsDiscContactItem> pitem(item); // ensures that item will be destroyed whichever door we leave through
#ifdef P3DISC_DEBUG
std::cerr << "p3discovery2::recvOwnContactInfo()";
std::cerr << std::endl;
@ -678,7 +671,6 @@ void p3discovery2::processPGPList(const RsPeerId &fromId, const RsDiscPgpListIte
#endif
// cleanup.
delete item;
return;
}
@ -716,9 +708,6 @@ void p3discovery2::processPGPList(const RsPeerId &fromId, const RsDiscPgpListIte
it->second.mergeFriendList(item->pgpIdSet.ids);
updatePeers_locked(fromId);
// cleanup.
delete item;
}
@ -913,7 +902,6 @@ void p3discovery2::processContactInfo(const RsPeerId &fromId, const RsDiscContac
if(sockaddr_storage_isExternalNet(item->currentConnectAddress.addr))
mPeerMgr->addCandidateForOwnExternalAddress(item->PeerId(), item->currentConnectAddress.addr);
delete item;
return;
}
@ -942,7 +930,6 @@ void p3discovery2::processContactInfo(const RsPeerId &fromId, const RsDiscContac
/* inform NetMgr that we know this peer */
mNetMgr->netAssistKnownPeer(item->sslId, item->extAddrV4.addr, NETASSIST_KNOWN_PEER_FOF | NETASSIST_KNOWN_PEER_OFFLINE);
}
delete item;
return;
}
@ -991,8 +978,6 @@ void p3discovery2::processContactInfo(const RsPeerId &fromId, const RsDiscContac
if(should_notify_discovery)
RsServer::notify()->notifyDiscInfoChanged();
delete item;
}
/* we explictly request certificates, instead of getting them all the time
@ -1041,8 +1026,6 @@ void p3discovery2::recvPGPCertificateRequest( const RsPeerId& fromId, const RsDi
sendPGPCertificate(pgpId, fromId);
else
std::cerr << "(WW) not sending certificate " << pgpId << " asked by friend " << fromId << " because this either this cert is not a friend, or discovery is off" << std::endl;
delete item;
}
@ -1119,7 +1102,6 @@ void p3discovery2::recvPGPCertificate(const RsPeerId& fromId, RsDiscPgpKeyItem*
#endif
// now that will add the key *and* set the skip_signature_validation flag at once
rsPeers->loadPgpKeyFromBinaryData((unsigned char*)item->bin_data,item->bin_len, tmp_pgp_id,error_string); // no error should occur at this point because we called loadDetailsFromStringCert() already
delete item;
// Make sure we allow connections after the key is added. This is not the case otherwise. We only do that if the peer is non validated peer, since
// otherwise the connection should already be accepted. This only happens when the short invite peer sends its own PGP key.

View File

@ -121,9 +121,9 @@ class p3GxsTunnelService: public RsGxsTunnelService, public RsTurtleClientServic
{
public:
explicit p3GxsTunnelService(RsGixs *pids) ;
virtual void connectToTurtleRouter(p3turtle *) ;
virtual void connectToTurtleRouter(p3turtle *) override;
uint16_t serviceId() const { return RS_SERVICE_TYPE_GXS_TUNNEL ; }
uint16_t serviceId() const override { return RS_SERVICE_TYPE_GXS_TUNNEL ; }
// Creates the invite if the public key of the distant peer is available.
// Om success, stores the invite in the map above, so that we can respond to tunnel requests.
@ -137,8 +137,8 @@ public:
// derived from p3service
virtual int tick();
virtual RsServiceInfo getServiceInfo();
virtual int tick() override;
virtual RsServiceInfo getServiceInfo() override;
private:
void flush() ;
@ -147,19 +147,19 @@ private:
class GxsTunnelPeerInfo
{
public:
GxsTunnelPeerInfo() : last_contact(0), last_keep_alive_sent(0), status(0), direction(0)
#ifndef V07_NON_BACKWARD_COMPATIBLE_CHANGE_004
,accepts_fast_turtle_items(false)
#endif
GxsTunnelPeerInfo()
: last_contact(0), last_keep_alive_sent(0), status(0), direction(0)
, total_sent(0), total_received(0)
#ifndef V07_NON_BACKWARD_COMPATIBLE_CHANGE_004
, accepts_fast_turtle_items(false)
, already_probed_for_fast_items(false)
#endif
{
memset(aes_key, 0, GXS_TUNNEL_AES_KEY_SIZE);
total_sent = 0 ;
total_received = 0 ;
}
rstime_t last_contact ; // used to keep track of working connexion
rstime_t last_keep_alive_sent ; // last time we sent a keep alive packet.
rstime_t last_keep_alive_sent ; // last time we sent a keep alive packet.
unsigned char aes_key[GXS_TUNNEL_AES_KEY_SIZE] ;
@ -213,10 +213,10 @@ private:
// Overloaded from RsTurtleClientService
virtual bool handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) ;
virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ;
void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) ;
void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) ;
virtual bool handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) override;
virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) override;
void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) override;
void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) override;
// session handling handles

View File

@ -1864,6 +1864,8 @@ bool PGPHandler::locked_writePrivateTrustDatabase()
return false;
}
PrivateTrustPacket trustpacket ;
/* Clear PrivateTrustPacket struct to suppress valgrind warnings due to the compiler extra padding*/
memset(&trustpacket, 0, sizeof(PrivateTrustPacket));
for( std::map<RsPgpId,PGPCertificateInfo>::iterator it =
_public_keyring_map.begin(); it!=_public_keyring_map.end(); ++it )

View File

@ -1238,14 +1238,6 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
RsErr() << __PRETTY_FUNCTION__ << " " << errMsg << std::endl;
// if(rsEvents)
// {
// ev->mErrorMsg = errMsg;
// ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::NO_CERTIFICATE_SUPPLIED;
//
// rsEvents->postEvent(std::move(ev));
// }
return verificationFailed;
}
@ -1400,8 +1392,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
return verificationFailed;
}
//setCurrentConnectionAttemptInfo(pgpId, sslId, sslCn);
LocalStoreCert(x509Cert);
LocalStoreCert(x509Cert);
RsInfo() << __PRETTY_FUNCTION__ << " authentication successfull for "
<< "sslId: " << sslId << " isSslOnlyFriend: " << isSslOnlyFriend
@ -1410,9 +1401,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
return verificationSuccess;
}
bool AuthSSLimpl::parseX509DetailsFromFile(
const std::string& certFilePath, RsPeerId& certId,
RsPgpId& issuer, std::string& location )
bool AuthSSLimpl::parseX509DetailsFromFile( const std::string& certFilePath, RsPeerId& certId, RsPgpId& issuer, std::string& location )
{
FILE* tmpfp = RsDirUtil::rs_fopen(certFilePath.c_str(), "r");
if(!tmpfp)
@ -1433,11 +1422,14 @@ bool AuthSSLimpl::parseX509DetailsFromFile(
}
uint32_t diagnostic = 0;
if(!AuthX509WithGPG(x509,false, diagnostic))
{
RsErr() << __PRETTY_FUNCTION__ << " AuthX509WithGPG failed with "
<< "diagnostic: " << diagnostic << std::endl;
return false;
X509_free(x509);
return false;
}
certId = RsX509Cert::getCertSslId(*x509);
@ -1805,26 +1797,28 @@ bool AuthSSLimpl::loadList(std::list<RsItem*>& load)
for(it = load.begin(); it != load.end(); ++it) {
RsConfigKeyValueSet *vitem = dynamic_cast<RsConfigKeyValueSet *>(*it);
if(vitem) {
#ifdef AUTHSSL_DEBUG
if(vitem)
{
#ifdef AUTHSSL_DEBUG
std::cerr << "AuthSSLimpl::loadList() General Variable Config Item:" << std::endl;
vitem->print(std::cerr, 10);
std::cerr << std::endl;
#endif
#endif
std::list<RsTlvKeyValue>::iterator kit;
for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit) {
if (RsPeerId(kit->key) == mOwnId) {
continue;
}
for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit)
{
if (RsPeerId(kit->key) == mOwnId) {
continue;
}
X509 *peer = loadX509FromPEM(kit->value);
/* authenticate it */
uint32_t diagnos ;
if (AuthX509WithGPG(peer,false,diagnos))
{
LocalStoreCert(peer);
}
X509 *peer = loadX509FromPEM(kit->value);
/* authenticate it */
uint32_t diagnos ;
if (peer && AuthX509WithGPG(peer,false,diagnos))
LocalStoreCert(peer);
X509_free(peer);
}
}
delete (*it);

View File

@ -2206,7 +2206,7 @@ bool p3MsgService::notifyGxsTransSendStatus( RsGxsTransId mailId,
if( status == GxsTransSendStatus::RECEIPT_RECEIVED )
{
pEvent->mMailStatusEventCode = RsMailStatusEventCode::NEW_MESSAGE;
pEvent->mMailStatusEventCode = RsMailStatusEventCode::MESSAGE_RECEIVED_ACK;
uint32_t msg_id;
{

View File

@ -32,6 +32,7 @@
#include "gui/common/AvatarDefs.h"
#include "gui/common/FilesDefs.h"
#include "util/qtthreadsutils.h"
#include "util/misc.h"
#include "gui/Circles/CreateCircleDialog.h"
#include "gui/gxs/GxsIdDetails.h"
#include "gui/Identity/IdDialog.h"
@ -53,24 +54,11 @@ CreateCircleDialog::CreateCircleDialog()
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
/* Setup Queue */
setAttribute(Qt::WA_DeleteOnClose, false);
/* Setup Queue */
ui.headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/circles.png"));
// connect up the buttons.
connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addMember()));
connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeMember()));
connect(ui.createButton, SIGNAL(clicked()), this, SLOT(createCircle()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(close()));
connect(ui.treeWidget_membership, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedMember(QTreeWidgetItem*, QTreeWidgetItem*)));
connect(ui.treeWidget_IdList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedId(QTreeWidgetItem*, QTreeWidgetItem*)));
connect(ui.treeWidget_IdList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(IdListCustomPopupMenu(QPoint)));
connect(ui.treeWidget_membership, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(MembershipListCustomPopupMenu(QPoint)));
connect(ui.IdFilter, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
//connect(ui.toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId()));
/* Add filter actions */
@ -88,17 +76,8 @@ CreateCircleDialog::CreateCircleDialog()
ui.removeButton->setEnabled(false);
ui.addButton->setEnabled(false);
ui.radioButton_ListAll->setChecked(true);
QObject::connect(ui.radioButton_ListAll, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ;
QObject::connect(ui.radioButton_ListAllPGP, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ;
QObject::connect(ui.radioButton_ListFriendPGP, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ;
QObject::connect(ui.radioButton_Public, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
QObject::connect(ui.radioButton_Self, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
QObject::connect(ui.radioButton_Restricted, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
ui.radioButton_Public->setChecked(true) ;
mIsExistingCircle = false;
mIsExternalCircle = true;
mClearList = true;
@ -107,9 +86,32 @@ CreateCircleDialog::CreateCircleDialog()
#endif
ui.treeWidget_IdList->setColumnHidden(RSCIRCLEID_COL_KEYID,true); // no need to show this. the tooltip will do it.
//ui.idChooser->loadIds(0,RsGxsId());
ui.circleComboBox->loadCircles(RsGxsCircleId());
ui.circleComboBox->hide();
// connect up the buttons.
connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addMember()));
connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeMember()));
connect(ui.createButton, SIGNAL(clicked()), this, SLOT(createCircle()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(close()));
connect(ui.treeWidget_membership, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedMember(QTreeWidgetItem*, QTreeWidgetItem*)));
connect(ui.treeWidget_IdList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedId(QTreeWidgetItem*, QTreeWidgetItem*)));
connect(ui.treeWidget_IdList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(IdListCustomPopupMenu(QPoint)));
connect(ui.treeWidget_membership, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(MembershipListCustomPopupMenu(QPoint)));
connect(ui.IdFilter, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
QObject::connect(ui.radioButton_ListAll, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ;
QObject::connect(ui.radioButton_ListAllPGP, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ;
QObject::connect(ui.radioButton_ListFriendPGP, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ;
QObject::connect(ui.radioButton_Public, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
QObject::connect(ui.radioButton_Self, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
QObject::connect(ui.radioButton_Restricted, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
}
CreateCircleDialog::~CreateCircleDialog()
@ -575,7 +577,7 @@ void CreateCircleDialog::updateCircleGUI()
std::cerr << std::endl;
#endif
ui.circleName->setText(QString::fromUtf8(mCircleGroup.mMeta.mGroupName.c_str()));
whileBlocking(ui.circleName)->setText(QString::fromUtf8(mCircleGroup.mMeta.mGroupName.c_str()));
bool isExternal = true;
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
@ -583,9 +585,9 @@ void CreateCircleDialog::updateCircleGUI()
std::cerr << std::endl;
#endif
ui.radioButton_Public->setChecked(false);
ui.radioButton_Self->setChecked(false);
ui.radioButton_Restricted->setChecked(false);
whileBlocking(ui.radioButton_Public)->setChecked(false);
whileBlocking(ui.radioButton_Self)->setChecked(false);
whileBlocking(ui.radioButton_Restricted)->setChecked(false);
switch(mCircleGroup.mMeta.mCircleType)
{
@ -604,7 +606,7 @@ void CreateCircleDialog::updateCircleGUI()
std::cerr << std::endl;
#endif
ui.radioButton_Public->setChecked(true);
whileBlocking(ui.radioButton_Public)->setChecked(true);
break;
case GXS_CIRCLE_TYPE_EXT_SELF:
@ -618,11 +620,11 @@ void CreateCircleDialog::updateCircleGUI()
#endif
if (RsGxsGroupId(mCircleGroup.mMeta.mCircleId) == mCircleGroup.mMeta.mGroupId)
ui.radioButton_Self->setChecked(true);
whileBlocking(ui.radioButton_Self)->setChecked(true);
else
ui.radioButton_Restricted->setChecked(true);
whileBlocking(ui.radioButton_Restricted)->setChecked(true);
ui.circleComboBox->loadCircles(mCircleGroup.mMeta.mCircleId);
whileBlocking(ui.circleComboBox)->loadCircles(mCircleGroup.mMeta.mCircleId);
break;
@ -643,15 +645,15 @@ void CreateCircleDialog::updateCircleGUI()
if(mReadOnly)
{
ui.circleAdminLabel->setId(mCircleGroup.mMeta.mAuthorId) ;
ui.idChooser->setVisible(false) ;
ui.circleAdminLabel->setId(mCircleGroup.mMeta.mAuthorId) ;
ui.idChooser->setVisible(false) ;
}
else
{
//std::set<RsGxsId> ids ;
//ids.insert(mCircleGroup.mMeta.mAuthorId) ;
ui.idChooser->setDefaultId(mCircleGroup.mMeta.mAuthorId) ;
ui.idChooser->setChosenId(mCircleGroup.mMeta.mAuthorId) ;
ui.idChooser->setDefaultId(mCircleGroup.mMeta.mAuthorId) ;
ui.idChooser->setChosenId(mCircleGroup.mMeta.mAuthorId) ;
//ui.idChooser->setIdConstraintSet(ids) ;
ui.idChooser->setFlags(IDCHOOSER_NO_CREATE) ;
ui.circleAdminLabel->setVisible(false) ;
@ -696,6 +698,8 @@ void CreateCircleDialog::loadCircle(const RsGxsGroupId& groupId)
void CreateCircleDialog::loadIdentities()
{
std::cerr << "Loading identities..." << std::endl;
RsThread::async([this]()
{
std::list<RsGroupMetaData> ids_meta;
@ -707,23 +711,30 @@ void CreateCircleDialog::loadIdentities()
}
std::set<RsGxsId> ids;
for(auto& meta:ids_meta) ids.insert(RsGxsId(meta.mGroupId));
for(auto& meta:ids_meta)
ids.insert(RsGxsId(meta.mGroupId));
// Needs a pointer on the heap, to pass to postToObject, otherwise it will get deleted before
// the posted method will actually run. Memory ownership is left to the posted method.
auto id_groups = new std::vector<RsGxsIdGroup>();
auto id_groups = std::make_unique<std::vector<RsGxsIdGroup>>();
if(!rsIdentity->getIdentitiesInfo(ids, *id_groups))
{
RS_ERR("failed to retrieve identities group info for all identities");
delete id_groups;
return;
}
RsQThreadUtils::postToObject(
[id_groups = std::move(id_groups), this]()
RsQThreadUtils::postToObject( [id_groups, this]()
{
/* Here it goes any code you want to be executed on the Qt Gui
* thread, for example to update the data model with new information
* after a blocking call to RetroShare API complete */
fillIdentitiesList(*id_groups);
delete id_groups;
}, this );
});

View File

@ -154,8 +154,8 @@ SearchDialog::SearchDialog(QWidget *parent)
// To allow a proper sorting, be careful to pad at right with spaces. This
// is achieved by using QString("%1").arg(number,15,10).
//
ui.searchResultWidget->setItemDelegateForColumn(SR_SIZE_COL, new RSHumanReadableSizeDelegate()) ;
ui.searchResultWidget->setItemDelegateForColumn(SR_AGE_COL, new RSHumanReadableAgeDelegate()) ;
ui.searchResultWidget->setItemDelegateForColumn(SR_SIZE_COL, mSizeColumnDelegate=new RSHumanReadableSizeDelegate()) ;
ui.searchResultWidget->setItemDelegateForColumn(SR_AGE_COL, mAgeColumnDelegate=new RSHumanReadableAgeDelegate()) ;
/* make it extended selection */
ui.searchResultWidget -> setSelectionMode(QAbstractItemView::ExtendedSelection);
@ -225,12 +225,17 @@ SearchDialog::~SearchDialog()
// save settings
processSettings(false);
if (compareSummaryRole) {
if (compareSummaryRole)
delete(compareSummaryRole);
}
if (compareResultRole) {
if (compareResultRole)
delete(compareResultRole);
}
delete mSizeColumnDelegate;
delete mAgeColumnDelegate;
ui.searchResultWidget->setItemDelegateForColumn(SR_SIZE_COL, nullptr);
ui.searchResultWidget->setItemDelegateForColumn(SR_AGE_COL, nullptr);
}
void SearchDialog::processSettings(bool bLoad)

View File

@ -156,6 +156,9 @@ private:
RSTreeWidgetItemCompareRole *compareSummaryRole;
RSTreeWidgetItemCompareRole *compareResultRole;
QAbstractItemDelegate *mAgeColumnDelegate;
QAbstractItemDelegate *mSizeColumnDelegate;
/* Color definitions (for standard see qss.default) */
QColor mTextColorLocal;
QColor mTextColorDownloading;

View File

@ -1124,10 +1124,16 @@ void TransfersDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> eve
TransfersDialog::~TransfersDialog()
{
rsEvents->unregisterEventsHandler(mEventHandlerId);
rsEvents->unregisterEventsHandler(mEventHandlerId);
// save settings
processSettings(false);
ui.uploadsList->setItemDelegate(nullptr);
ui.downloadList->setItemDelegate(nullptr);
delete ULDelegate;
delete DLDelegate;
}
void TransfersDialog::activatePage(TransfersDialog::Page page)

View File

@ -505,16 +505,16 @@ void IdDialog::updateCircles()
/* This can be big so use a smart pointer to just copy the pointer
* instead of copying the whole list accross the lambdas */
auto circle_metas = std::make_unique<std::list<RsGroupMetaData>>();
auto circle_metas = new std::list<RsGroupMetaData>();
if(!rsGxsCircles->getCirclesSummaries(*circle_metas))
{
RS_ERR("failed to retrieve circles group info list");
delete circle_metas;
return;
}
RsQThreadUtils::postToObject(
[circle_metas = std::move(circle_metas), this]()
RsQThreadUtils::postToObject( [circle_metas, this]()
{
/* Here it goes any code you want to be executed on the Qt Gui
* thread, for example to update the data model with new information
@ -522,7 +522,8 @@ void IdDialog::updateCircles()
loadCircles(*circle_metas);
}, this );
delete circle_metas;
}, this );
});
}
@ -1316,17 +1317,19 @@ void IdDialog::updateIdList()
return;
}
auto ids_set = std::make_unique<std::map<RsGxsGroupId,RsGxsIdGroup>>();
auto ids_set = new std::map<RsGxsGroupId,RsGxsIdGroup>();
for(auto it(groups.begin()); it!=groups.end(); ++it)
(*ids_set)[(*it).mMeta.mGroupId] = *it;
RsQThreadUtils::postToObject(
[ids_set = std::move(ids_set), this] ()
RsQThreadUtils::postToObject( [ids_set, this] ()
{
/* Here it goes any code you want to be executed on the Qt Gui
* thread, for example to update the data model with new information
* after a blocking call to RetroShare API complete */
loadIdentities(*ids_set);
delete ids_set;
}, this );
});

View File

@ -375,6 +375,9 @@ MainWindow::~MainWindow()
delete soundStatus;
delete toasterDisable;
delete sysTrayStatus;
delete trayIcon;
delete trayMenu;
delete notifyMenu;
#ifdef MESSENGER_WINDOW
MessengerWindow::releaseInstance();
#endif
@ -602,7 +605,7 @@ void MainWindow::displayDiskSpaceWarning(int loc,int size_limit_mb)
void MainWindow::createTrayIcon()
{
/** Tray icon Menu **/
QMenu *trayMenu = new QMenu(this);
trayMenu = new QMenu(this);
if (sysTrayStatus) sysTrayStatus->trayMenu = trayMenu;
QObject::connect(trayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
toggleVisibilityAction = trayMenu->addAction(QIcon(IMAGE_RETROSHARE), tr("Show/Hide"), this, SLOT(toggleVisibilitycontextmenu()));

View File

@ -284,6 +284,7 @@ private:
QSystemTrayIcon *trayIcon;
QMenu *notifyMenu;
QMenu *trayMenu;
QString notifyToolTip;
QAction *toggleVisibilityAction, *toolAct;
QList<UserNotify*> userNotifyList;

View File

@ -101,3 +101,8 @@ void PhotoView::copyMessageLink()
QMessageBox::information(NULL,tr("information"),tr("The Retrohare link was copied to your clipboard.")) ;
}
}
void PhotoView::setGroupNameString(const QString& name)
{
ui->nameLabel->setText("@" + name);
}

View File

@ -48,6 +48,7 @@ public slots:
void setTime(const QString& text);
void setGroupId(const RsGxsGroupId &groupId);
void setMessageId(const RsGxsMessageId& messageId);
void setGroupNameString(const QString& name);
private slots:
void copyMessageLink();

View File

@ -699,7 +699,7 @@ PostedListWidgetWithModel::~PostedListWidgetWithModel()
void PostedListWidgetWithModel::processSettings(bool load)
{
Settings->beginGroup(QString("ChannelPostsWidget"));
Settings->beginGroup(QString("BoardPostsWidget"));
if (load)
{

View File

@ -22,6 +22,7 @@
#include <QtGui>
#include "PulseReply.h"
#include "gui/gxs/GxsIdDetails.h"
#include "gui/common/FilesDefs.h"
#include "PulseAddDialog.h"
@ -39,6 +40,10 @@ PulseAddDialog::PulseAddDialog(QWidget *parent)
connect(ui.pushButton_ClearDisplayAs, SIGNAL( clicked( void ) ), this, SLOT( clearDisplayAs( void ) ) );
connect(ui.pushButton_Cancel, SIGNAL( clicked( void ) ), this, SLOT( cancelPulse( void ) ) );
connect(ui.textEdit_Pulse, SIGNAL( textChanged( void ) ), this, SLOT( pulseTextChanged( void ) ) );
connect(ui.pushButton_picture, SIGNAL(clicked()), this, SLOT( toggle()));
ui.pushButton_picture->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/photo.png")));
ui.frame_picture->hide();
setAcceptDrops(true);
}
@ -47,6 +52,28 @@ void PulseAddDialog::setGroup(RsWireGroup &group)
{
ui.label_groupName->setText(QString::fromStdString(group.mMeta.mGroupName));
ui.label_idName->setText(QString::fromStdString(group.mMeta.mAuthorId.toStdString()));
if (group.mHeadshot.mData )
{
QPixmap pixmap;
if (GxsIdDetails::loadPixmapFromData(
group.mHeadshot.mData,
group.mHeadshot.mSize,
pixmap,GxsIdDetails::ORIGINAL))
{
pixmap = pixmap.scaled(50,50);
ui.headshot->setPixmap(pixmap);
ui.topheadshot->setPixmap(pixmap);
}
}
else
{
// default.
QPixmap pixmap = FilesDefs::getPixmapFromQtResourcePath(":/icons/wire.png").scaled(50,50);
ui.headshot->setPixmap(pixmap);
ui.topheadshot->setPixmap(pixmap);
}
mGroup = group;
}
@ -62,6 +89,8 @@ void PulseAddDialog::setGroup(const RsGxsGroupId &grpId)
void PulseAddDialog::cleanup()
{
resize(700, 400 );
if (mIsReply)
{
std::cerr << "PulseAddDialog::cleanup() cleaning up old replyto";
@ -90,6 +119,7 @@ void PulseAddDialog::cleanup()
delete layout;
mIsReply = false;
}
ui.frame_reply->setVisible(false);
ui.comboBox_sentiment->setCurrentIndex(0);
ui.lineEdit_URL->setText("");
@ -97,28 +127,36 @@ void PulseAddDialog::cleanup()
ui.textEdit_Pulse->setPlainText("");
// disable URL until functionality finished.
ui.frame_URL->setEnabled(false);
ui.frame_URL->hide();
ui.pushButton_Post->setEnabled(false);
ui.pushButton_Post->setText("Post");
ui.pushButton_Post->setText(tr("Post"));
ui.textEdit_Pulse->setPlaceholderText(tr("Whats happening?"));
ui.frame_input->setVisible(true);
ui.widget_sentiment->setVisible(true);
ui.pushButton_picture->show();
ui.topheadshot->show();
// cleanup images.
mImage1.clear();
ui.label_image1->clear();
ui.label_image1->setText("Drag and Drop Image");
ui.label_image1->setText(tr("Drag and Drop Image"));
mImage2.clear();
ui.label_image2->clear();
ui.label_image2->setText("Drag and Drop Image");
ui.label_image2->setText(tr("Drag and Drop Image"));
mImage3.clear();
ui.label_image3->clear();
ui.label_image3->setText("Drag and Drop Image");
ui.label_image3->setText(tr("Drag and Drop Image"));
mImage4.clear();
ui.label_image4->clear();
ui.label_image4->setText("Drag and Drop Image");
ui.label_image4->setText(tr("Drag and Drop Image"));
// Hide Drag & Drop Frame
ui.frame_picture->hide();
ui.pushButton_picture->setChecked(false);
}
void PulseAddDialog::pulseTextChanged()
@ -136,6 +174,8 @@ void PulseAddDialog::setReplyTo(RsWirePulse &pulse, RsWirePulseSPtr pPulse, std:
mReplyToPulse = pulse;
mReplyType = replyType;
ui.frame_reply->setVisible(true);
ui.pushButton_picture->show();
ui.topheadshot->hide();
{
PulseReply *reply = new PulseReply(NULL, pPulse);
@ -151,7 +191,8 @@ void PulseAddDialog::setReplyTo(RsWirePulse &pulse, RsWirePulseSPtr pPulse, std:
if (mReplyType & WIRE_PULSE_TYPE_REPLY)
{
ui.pushButton_Post->setText("Reply to Pulse");
ui.pushButton_Post->setText(tr("Reply to Pulse"));
ui.textEdit_Pulse->setPlaceholderText(tr("Pulse your reply"));
}
else
{
@ -160,10 +201,12 @@ void PulseAddDialog::setReplyTo(RsWirePulse &pulse, RsWirePulseSPtr pPulse, std:
ui.frame_input->setVisible(false);
ui.widget_sentiment->setVisible(false);
if (mReplyType & WIRE_PULSE_TYPE_REPUBLISH) {
ui.pushButton_Post->setText("Republish Pulse");
ui.pushButton_Post->setText(tr("Republish Pulse"));
ui.pushButton_picture->hide();
}
else if (mReplyType & WIRE_PULSE_TYPE_LIKE) {
ui.pushButton_Post->setText("Like Pulse");
ui.pushButton_Post->setText(tr("Like Pulse"));
ui.pushButton_picture->hide();
}
}
@ -464,3 +507,16 @@ void PulseAddDialog::addImage(const QString &path)
}
}
void PulseAddDialog::toggle()
{
if (ui.pushButton_picture->isChecked())
{
ui.frame_picture->show();
ui.pushButton_picture->setToolTip(tr("Hide Pictures"));
}
else
{
ui.frame_picture->hide();
ui.pushButton_picture->setToolTip(tr("Add Pictures"));
}
}

View File

@ -52,6 +52,7 @@ private slots:
void cancelPulse();
void clearDialog();
void pulseTextChanged();
void toggle();
private:
// OLD VERSIONs, private now.

View File

@ -7,13 +7,19 @@
<x>0</x>
<y>0</y>
<width>720</width>
<height>493</height>
<height>449</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
@ -35,6 +41,9 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="maximumSize">
@ -51,25 +60,18 @@
</font>
</property>
<property name="text">
<string>Post From:</string>
<string>From:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_groupName">
<property name="text">
<string>GroupLabel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="3">
<widget class="GxsIdLabel" name="label_idName">
<property name="text">
<string>IDLabel</string>
</property>
</widget>
</item>
<item row="0" column="3">
<item row="0" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -82,6 +84,35 @@
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_groupName">
<property name="text">
<string>GroupLabel</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="topheadshot">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string>Head</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -94,12 +125,68 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_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>
<item>
<widget class="QWidget" name="widget_replyto" native="true"/>
</item>
<item>
<widget class="QWidget" name="widget_sentiment" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="headshot">
<property name="minimumSize">
<size>
<width>50</width>
<height>51</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string>Head Shot</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>238</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
@ -143,19 +230,6 @@
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>238</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
@ -171,11 +245,24 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QTextEdit" name="textEdit_Pulse"/>
<widget class="QTextEdit" name="textEdit_Pulse">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="placeholderText">
<string>Whats happening?</string>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_2">
<widget class="QFrame" name="frame_picture">
<property name="minimumSize">
<size>
<width>0</width>
@ -301,6 +388,25 @@
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="pushButton_picture">
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">

View File

@ -19,6 +19,8 @@
*******************************************************************************/
#include "PulseMessage.h"
#include "gui/Posted/PhotoView.h"
#include "util/misc.h"
/** Constructor */
@ -26,6 +28,11 @@ PulseMessage::PulseMessage(QWidget *parent)
:QWidget(parent)
{
setupUi(this);
connect(label_image1, SIGNAL(clicked()), this, SLOT(viewPicture()));
connect(label_image2, SIGNAL(clicked()), this, SLOT(viewPicture()));
connect(label_image3, SIGNAL(clicked()), this, SLOT(viewPicture()));
connect(label_image4, SIGNAL(clicked()), this, SLOT(viewPicture()));
}
void PulseMessage::setup(RsWirePulseSPtr pulse)
@ -34,6 +41,8 @@ void PulseMessage::setup(RsWirePulseSPtr pulse)
return;
}
mPulse = pulse;
setMessage(QString::fromStdString(pulse->mPulseText));
// show indent if republish (both RESPONSE or REF)
@ -139,3 +148,46 @@ void PulseMessage::setRefImageCount(uint32_t count)
}
}
void PulseMessage::viewPicture()
{
PhotoView *photoView = new PhotoView(this);
if (!mPulse->mImage1.empty()) {
// install image.
QPixmap pixmap;
pixmap.loadFromData(mPulse->mImage1.mData, mPulse->mImage1.mSize);
photoView->setPixmap(pixmap);
}
if (!mPulse->mImage2.empty()) {
// install image.
QPixmap pixmap;
pixmap.loadFromData(mPulse->mImage2.mData, mPulse->mImage2.mSize);
photoView->setPixmap(pixmap);
}
if (!mPulse->mImage3.empty()) {
// install image.
QPixmap pixmap;
pixmap.loadFromData(mPulse->mImage3.mData, mPulse->mImage3.mSize);
photoView->setPixmap(pixmap);
}
if (!mPulse->mImage4.empty()) {
// install image.
QPixmap pixmap;
pixmap.loadFromData(mPulse->mImage4.mData, mPulse->mImage4.mSize);
photoView->setPixmap(pixmap);
}
QString timestamp = misc::timeRelativeToNow(mPulse->mRefPublishTs);
photoView->setTitle(QString::fromStdString(mPulse->mPulseText));
photoView->setGroupNameString(QString::fromStdString(mPulse->mRefGroupName));
photoView->setTime(timestamp);
//photoView->setGroupId(mPulse->mRefGroupId);
photoView->show();
/* window will destroy itself! */
}

View File

@ -35,6 +35,13 @@ public:
void setup(RsWirePulseSPtr pulse);
void setMessage(QString msg);
void setRefImageCount(uint32_t count);
private slots:
void viewPicture();
private:
RsWirePulseSPtr mPulse;
};
#endif

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>570</width>
<height>376</height>
<height>377</height>
</rect>
</property>
<property name="windowTitle">
@ -20,6 +20,12 @@
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="Line" name="line">
<property name="minimumSize">
@ -32,7 +38,7 @@
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>5</number>
<number>4</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -43,7 +49,14 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QTextBrowser" name="textBrowser"/>
<widget class="QTextBrowser" name="textBrowser">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame_expand">
@ -55,13 +68,16 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_image1">
<widget class="ClickableLabel" name="label_image1">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -71,13 +87,16 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_image2">
<widget class="ClickableLabel" name="label_image2">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -87,13 +106,16 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_image3">
<widget class="ClickableLabel" name="label_image3">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -103,13 +125,16 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_image4">
<widget class="ClickableLabel" name="label_image4">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -123,6 +148,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>util/ClickableLabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -49,6 +49,9 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QWidget" name="widget_prefix" native="true">
<property name="sizePolicy">
@ -64,6 +67,12 @@
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
@ -95,9 +104,18 @@
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>retweeted</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
@ -131,21 +149,11 @@
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="topMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_8">
<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="toolButton_reply">
<property name="text">
@ -158,6 +166,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -209,6 +220,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -260,6 +274,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -311,6 +328,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -419,6 +439,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="label_authorName">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -426,9 +452,20 @@
</item>
<item>
<widget class="QLabel" name="label_groupName">
<property name="font">
<font>
<family>Segoe UI</family>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;@sidler_here&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
@ -449,6 +486,12 @@
</item>
<item>
<widget class="QLabel" name="label_date">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;· Apr 13 ·&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -492,63 +535,61 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<spacer name="horizontalSpacer_16">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_replyLine">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item>
<spacer name="horizontalSpacer_16">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_replyLine">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
@ -567,11 +608,29 @@
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_reference">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;Replying to @sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>

View File

@ -64,6 +64,18 @@
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<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>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
@ -130,6 +142,9 @@
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -150,6 +165,9 @@
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -287,11 +305,8 @@
<iconset resource="TheWire_images.qrc">
<normaloff>:/images/external-link.svg</normaloff>:/images/external-link.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
@ -534,6 +549,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -585,6 +603,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -636,6 +657,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -687,6 +711,9 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>

View File

@ -172,16 +172,26 @@ bool WireGroupDialog::service_loadGroup(const RsGxsGenericGroupData *data, Mode
const RsWireGroup &group = *pgroup;
// description = QString::fromUtf8(group.mDescription.c_str());
#if 0
if (group.mThumbnail.mData) {
if (group.mHeadshot.mData) {
QPixmap pixmap;
if (GxsIdDetails::loadPixmapFromData(group.mThumbnail.mData, group.mThumbnail.mSize, pixmap,GxsIdDetails::ORIGINAL)) {
if (GxsIdDetails::loadPixmapFromData(group.mHeadshot.mData, group.mHeadshot.mSize, pixmap,GxsIdDetails::ORIGINAL)) {
setLogo(pixmap);
}
} else {
setLogo(FilesDefs::getPixmapFromQtResourcePath(":/images/album_create_64.png"));
setLogo(FilesDefs::getPixmapFromQtResourcePath(":/images/album_create_64.png"));
}
// from Extra Widget.
mExtra->setTagline(group.mTagline);
mExtra->setLocation(group.mLocation);
if (group.mMasthead.mData){
QPixmap pixmap;
if (GxsIdDetails::loadPixmapFromData(group.mMasthead.mData, group.mMasthead.mSize, pixmap,GxsIdDetails::ORIGINAL))
{
mExtra->setMasthead(pixmap);
}
}
#endif
return true;
}

View File

@ -22,14 +22,40 @@
#include <QMessageBox>
#include <QMouseEvent>
#include <QBuffer>
#include <QPixmap>
#include <QImage>
#include <QSize>
#include <QPainter>
#include "WireGroupItem.h"
#include "WireGroupDialog.h"
#include "gui/gxs/GxsIdDetails.h"
#include "gui/common/FilesDefs.h"
#include <algorithm>
#include <iostream>
static QImage getCirclePhoto(const QImage original, int sizePhoto)
{
QImage target(sizePhoto, sizePhoto, QImage::Format_ARGB32_Premultiplied);
target.fill(Qt::transparent);
QPainter painter(&target);
painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
painter.setBrush(QBrush(Qt::white));
auto scaledPhoto = original
.scaled(sizePhoto, sizePhoto, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)
.convertToFormat(QImage::Format_ARGB32_Premultiplied);
int margin = 0;
if (scaledPhoto.width() > sizePhoto) {
margin = (scaledPhoto.width() - sizePhoto) / 2;
}
painter.drawEllipse(0, 0, sizePhoto, sizePhoto);
painter.setCompositionMode(QPainter::CompositionMode_SourceIn);
painter.drawImage(0, 0, scaledPhoto, margin, 0);
return target;
}
/** Constructor */
WireGroupItem::WireGroupItem(WireGroupHolder *holder, const RsWireGroup &grp)
@ -39,6 +65,8 @@ WireGroupItem::WireGroupItem(WireGroupHolder *holder, const RsWireGroup &grp)
setAttribute ( Qt::WA_DeleteOnClose, true );
setup();
// disabled, still not yet functional Edit/Update
editButton->setEnabled(false);
}
RsGxsGroupId &WireGroupItem::groupId()
@ -51,7 +79,7 @@ void WireGroupItem::setup()
label_groupName->setText(QString::fromStdString(mGroup.mMeta.mGroupName));
label_authorId->setId(mGroup.mMeta.mAuthorId);
frame_details->setVisible(false);
if (mGroup.mHeadshot.mData )
{
QPixmap pixmap;
@ -60,7 +88,12 @@ void WireGroupItem::setup()
mGroup.mHeadshot.mSize,
pixmap,GxsIdDetails::ORIGINAL))
{
pixmap = pixmap.scaled(32,32);
//make avatar as circle avatar
QImage orginalImage = pixmap.toImage();
QImage circleImage = getCirclePhoto(orginalImage,orginalImage.size().width());
pixmap.convertFromImage(circleImage);
pixmap = pixmap.scaled(40,40);
label_headshot->setPixmap(pixmap);
}
}
@ -84,6 +117,7 @@ void WireGroupItem::setup()
connect(toolButton_show, SIGNAL(clicked()), this, SLOT(show()));
connect(toolButton_subscribe, SIGNAL(clicked()), this, SLOT(subscribe()));
connect(editButton, SIGNAL(clicked()), this, SLOT(editGroupDetails()));
setGroupSet();
}
@ -93,16 +127,19 @@ void WireGroupItem::setGroupSet()
toolButton_type->setText("Own");
toolButton_subscribe->setText("N/A");
toolButton_subscribe->setEnabled(false);
editButton->show();
}
else if (mGroup.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
{
toolButton_type->setText("Following");
toolButton_subscribe->setText("Unfollow");
editButton->hide();
}
else
{
toolButton_type->setText("Other");
toolButton_subscribe->setText("Follow");
editButton->hide();
}
}
@ -174,3 +211,16 @@ const QPixmap *WireGroupItem::getPixmap()
return NULL;
}
void WireGroupItem::editGroupDetails()
{
RsGxsGroupId groupId = mGroup.mMeta.mGroupId;
if (groupId.isNull())
{
std::cerr << "WireGroupItem::editGroupDetails() No Group selected";
std::cerr << std::endl;
return;
}
WireGroupDialog wireEdit(GxsGroupDialog::MODE_EDIT, groupId, this);
wireEdit.exec ();
}

View File

@ -55,6 +55,7 @@ public:
private slots:
void show();
void subscribe();
void editGroupDetails();
protected:
void mousePressEvent(QMouseEvent *event);

View File

@ -35,14 +35,32 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_headshot">
<property name="minimumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="text">
@ -55,6 +73,12 @@
</item>
<item>
<widget class="QLabel" name="label_groupName">
<property name="font">
<font>
<family>Segoe UI</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>WireGroupName</string>
</property>
@ -136,6 +160,20 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="toolTip">
<string>Edit Profile</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/mail/compose.png</normaloff>:/icons/mail/compose.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -696,7 +696,7 @@ void ChatLobbyDialog::participantsTreeWidgetDoubleClicked(QTreeWidgetItem *item,
if(column == COLUMN_NAME)
{
getChatWidget()->pasteText("@" + RsHtml::plainText(item->text(COLUMN_NAME))) ;
getChatWidget()->pasteText("@" + RsHtml::plainText(item->text(COLUMN_NAME)) + " ") ;
return ;
}

View File

@ -1842,13 +1842,16 @@ void ChatWidget::updateTitle()
ui->titleLabel->setText(RsHtml::plainText(name) + "@" + RsHtml::plainText(title));
}
void ChatWidget::updatePeersCustomStateString(const QString& /*peer_id*/, const QString& /*status_string*/)
void ChatWidget::updatePeersCustomStateString(const QString& peer_id, const QString& status_string)
{
if (chatType() != CHATTYPE_PRIVATE )
{
return;
}
QString status_text;
// TODO: fix peer_id and types and eveyrhing
/*
if (RsPeerId(peer_id.toStdString()) == peerId) {
if (RsPeerId(peer_id.toStdString()) == chatId.toPeerId()) {
// the peers status string has changed
if (status_string.isEmpty()) {
ui->statusMessageLabel->hide();
@ -1863,7 +1866,6 @@ void ChatWidget::updatePeersCustomStateString(const QString& /*peer_id*/, const
ui->statusLabel->setAlignment ( Qt::AlignVCenter );
}
}
*/
}
void ChatWidget::updateStatusString(const QString &statusMask, const QString &statusString, bool permanent)

View File

@ -256,17 +256,20 @@ void FriendSelectionWidget::loadIdentities()
return;
}
auto ids = std::make_unique<std::vector<RsGxsGroupId>>();
for(auto& meta: ids_meta) ids->push_back(meta.mGroupId);
auto ids = new std::vector<RsGxsGroupId>();
RsQThreadUtils::postToObject(
[ids = std::move(ids), this]()
for(auto& meta: ids_meta)
ids->push_back(meta.mGroupId);
RsQThreadUtils::postToObject( [ids, this]()
{
// We do that is the GUI thread. Dont try it on another thread!
gxsIds = *ids;
/* TODO: To furter optimize away a copy gxsIds could be a unique_ptr
* too */
fillList();
delete ids;
}, this );
});
}

View File

@ -264,6 +264,8 @@ void NewFriendList::handleEvent(std::shared_ptr<const RsEvent> /*e*/)
NewFriendList::~NewFriendList()
{
rsEvents->unregisterEventsHandler(mEventHandlerId);
delete mModel;
delete mProxyModel;
delete ui;
}

View File

@ -190,7 +190,7 @@ void PGPKeyDialog::load()
ui.trustlevel_CB->hide();
ui.is_signing_me->hide();
ui.signersBox->setTitle(tr("This is your own PGP key, and it is signed by :")+" ");
ui.signersLabel->setText(tr("This is your own PGP key, and it is signed by :")+" ");
}
else
@ -198,7 +198,7 @@ void PGPKeyDialog::load()
ui.web_of_trust_label->show();
ui.trustlevel_CB->show();
ui.is_signing_me->show();
ui.signersBox->setTitle(tr("This key is signed by :")+" ");
ui.signersLabel->setText(tr("This key is signed by :")+" ");
if (detail.accept_connection)
{

View File

@ -7,14 +7,515 @@
<x>0</x>
<y>0</y>
<width>600</width>
<height>500</height>
<height>401</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Retroshare profile</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<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>
<property name="spacing">
<number>0</number>
</property>
<item row="2" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>3</number>
</property>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QTabWidget" name="stabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Profile info</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="bottomMargin">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="name">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="pgpfingerprint">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The PGP key fingerprint is a---supposedly unforgeable---characteristics of the PGP key. In order to make sure that you're dealing with the right key, compare the fingerprints.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="pgpfingerprint_label">
<property name="text">
<string>Fingerprint :</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_name">
<property name="text">
<string>Name :</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="trustlevel_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The trust level is an optional and local parameter that you can set in order to remember your option about a given PGP key. It is not used whatsoever to authorize connections. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Unset</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-low-off-48.png</normaloff>:/images/security-low-off-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Unknown</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-low-off-48.png</normaloff>:/images/security-low-off-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>No trust</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-low-48.png</normaloff>:/images/security-low-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Marginal</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-medium-48.png</normaloff>:/images/security-medium-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Full</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-high-48.png</normaloff>:/images/security-high-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Ultimate</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-high-48.png</normaloff>:/images/security-high-48.png</iconset>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="web_of_trust_label">
<property name="text">
<string>Trust level:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Keysigning:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QToolButton" name="signKeyButton">
<property name="toolTip">
<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:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;justify&quot; 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-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sign this key</string>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="signGPGKeyCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sign PGP key</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<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>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="friendAndSignLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<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="denyFriendButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click here if you want to refuse connections to nodes authenticated by this key.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Deny connections</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/user/deny_user48.png</normaloff>:/images/user/deny_user48.png</iconset>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="make_friend_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click this if you want your node to accept connecting to Retroshare nodes authenticated by this PGP key. This is done automatically when exchanging your Retroshare certificate with someone. In order to make friends, it is better to exchange certificates than accept connections from a given key, since the certificate also contain useful connection information (IP, DNS, SSL ids, etc).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Accept connections</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/user/add_user48.png</normaloff>:/images/user/add_user48.png</iconset>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="signersLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="RSTextBrowser" name="signers">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. The signatures below cryptographically attest that owners of the listed keys recognise the current PGP key as authentic.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="is_signing_me">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>This profile has signed your own profile key</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget">
<attribute name="title">
<string>PGP key</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Below is the node's profile key in PGP ASCII format. It identifies all nodes of the same profile. A &quot;Retroshare certificate&quot; that you can exchange in order to make friends, is in the the &quot;details&quot; of each separate node.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="userCertificateText_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="_shouldAddSignatures_CB_2">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This button will toggle the inclusion of signatures in the ascii display of the PGP key. See the comments about signatures in the other tab. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Include signatures</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Options</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>These options apply to all nodes of the profile:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_direct_transfer_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. This setting is applied to all locations of the same node.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use as direct source, when available</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_allow_push_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This option allows you to automatically download a file that is recommended in an message coming from this profile (e.g. when the message author is a signed identity that belongs to this profile). This can be used for instance to send files between your own nodes.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto-download recommended files from this node</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_require_WL_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by &amp;quot;security feed items&amp;quot; in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Require white list clearance</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Max upload speed (0=unlimited)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max download speed (0=unlimited)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QSpinBox" name="maxUploadSpeed_SB">
<property name="suffix">
<string> kB/s</string>
</property>
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="maxDownloadSpeed_SB">
<property name="suffix">
<string> kB/s</string>
</property>
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>274</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="HeaderFrame" name="headerFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@ -24,463 +525,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QTabWidget" name="stabWidget">
<property name="currentIndex">
<number>2</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Profile info</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="name">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="pgpfingerprint">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The PGP key fingerprint is a---supposedly unforgeable---characteristics of the PGP key. In order to make sure that you're dealing with the right key, compare the fingerprints.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="pgpfingerprint_label">
<property name="text">
<string>Fingerprint :</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_name">
<property name="text">
<string>Name :</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="trustlevel_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The trust level is an optional and local parameter that you can set in order to remember your option about a given PGP key. It is not used whatsoever to authorize connections. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Unset</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-low-off-48.png</normaloff>:/images/security-low-off-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Unknown</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-low-off-48.png</normaloff>:/images/security-low-off-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>No trust</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-low-48.png</normaloff>:/images/security-low-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Marginal</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-medium-48.png</normaloff>:/images/security-medium-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Full</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-high-48.png</normaloff>:/images/security-high-48.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Ultimate</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/security-high-48.png</normaloff>:/images/security-high-48.png</iconset>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="web_of_trust_label">
<property name="text">
<string>Trust level:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Keysigning:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QToolButton" name="signKeyButton">
<property name="toolTip">
<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:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;justify&quot; 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-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sign this key</string>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="signGPGKeyCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sign PGP key</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<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>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="is_signing_me">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>This profile has signed your own profile key</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="signersBox">
<property name="title">
<string>Key signatures :</string>
</property>
<layout class="QVBoxLayout" name="_11">
<item>
<widget class="RSTextBrowser" name="signers">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. The signatures below cryptographically attest that owners of the listed keys recognise the current PGP key as authentic.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="friendAndSignLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<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="denyFriendButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click here if you want to refuse connections to nodes authenticated by this key.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Deny connections</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/user/deny_user48.png</normaloff>:/images/user/deny_user48.png</iconset>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="make_friend_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click this if you want your node to accept connecting to Retroshare nodes authenticated by this PGP key. This is done automatically when exchanging your Retroshare certificate with someone. In order to make friends, it is better to exchange certificates than accept connections from a given key, since the certificate also contain useful connection information (IP, DNS, SSL ids, etc).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Accept connections</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/user/add_user48.png</normaloff>:/images/user/add_user48.png</iconset>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget">
<attribute name="title">
<string>PGP key</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Below is the node's profile key in PGP ASCII format. It identifies all nodes of the same profile. A &quot;Retroshare certificate&quot; that you can exchange in order to make friends, is in the the &quot;details&quot; of each separate node.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="userCertificateText_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="_shouldAddSignatures_CB_2">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This button will toggle the inclusion of signatures in the ascii display of the PGP key. See the comments about signatures in the other tab. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Include signatures</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Options</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>These options apply to all nodes of the profile:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_direct_transfer_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. This setting is applied to all locations of the same node.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use as direct source, when available</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_allow_push_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This option allows you to automatically download a file that is recommended in an message coming from this profile (e.g. when the message author is a signed identity that belongs to this profile). This can be used for instance to send files between your own nodes.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto-download recommended files from this node</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_require_WL_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by &amp;quot;security feed items&amp;quot; in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Require white list clearance</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Max upload speed (0=unlimited)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max download speed (0=unlimited)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QSpinBox" name="maxUploadSpeed_SB">
<property name="suffix">
<string> kB/s</string>
</property>
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="maxDownloadSpeed_SB">
<property name="suffix">
<string> kB/s</string>
</property>
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>274</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>

View File

@ -12,16 +12,16 @@
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>0</number>
<number>1</number>
</property>
<property name="topMargin">
<number>0</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>1</number>
</property>
<item row="2" column="0">
<widget class="QFrame" name="frame">

View File

@ -127,14 +127,40 @@ CreateGxsForumMsg::CreateGxsForumMsg(const RsGxsGroupId &fId, const RsGxsMessage
ui.generateCheckBox->hide();
ui.generateSpinBox->hide();
#endif
processSettings(true);
}
CreateGxsForumMsg::~CreateGxsForumMsg()
{
processSettings(false);
delete(mForumQueue);
delete(mCirclesQueue);
}
void CreateGxsForumMsg::processSettings(bool load)
{
Settings->beginGroup(QString("ForumPostsWidget"));
if (load)
{
// state of ID Chooser combobox
RsGxsId gxs_id(Settings->value("IDChooser", QString::fromStdString(RsGxsId().toStdString())).toString().toStdString());
if(!gxs_id.isNull() && rsIdentity->isOwnId(gxs_id))
ui.idChooser->setChosenId(gxs_id);
}
else
{
// state of ID Chooser combobox
RsGxsId id;
if(ui.idChooser->getChosenId(id))
Settings->setValue("IDChooser", QString::fromStdString(id.toStdString()));
}
Settings->endGroup();
}
void CreateGxsForumMsg::newMsg()
{
/* clear all */

View File

@ -59,7 +59,8 @@ protected:
void closeEvent (QCloseEvent * event);
private:
void loadFormInformation();
void processSettings(bool load);
void loadFormInformation();
void loadForumInfo(const uint32_t &token);
void loadParentMsg(const uint32_t &token);

View File

@ -273,6 +273,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion()));
connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint)));
connect(ui->postText, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
connect(ui->forumName, SIGNAL(clicked()), this, SLOT(showForumInfo()));
ui->subscribeToolButton->hide() ;
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
@ -396,6 +397,13 @@ void GxsForumThreadWidget::handleEvent_main_thread(std::shared_ptr<const RsEvent
}
}
void GxsForumThreadWidget::showForumInfo()
{
mThreadId.clear();
ui->threadTreeWidget->selectionModel()->clear();
updateForumDescription(true);
}
void GxsForumThreadWidget::blank()
{
ui->subscribeToolButton->hide();

View File

@ -110,6 +110,7 @@ private slots:
void threadListCustomPopupMenu(QPoint point);
void contextMenuTextBrowser(QPoint point);
void headerContextMenuRequested(const QPoint& pos);
void showForumInfo();
void changedSelection(const QModelIndex &, const QModelIndex &);
void changedThread(QModelIndex index);
@ -197,7 +198,7 @@ private:
private:
void setForumDescriptionLoading();
void clearForumDescription();
void blankPost();
void blankPost();
RsGxsGroupId mLastForumID;
RsGxsMessageId mThreadId;

View File

@ -112,30 +112,15 @@
</widget>
</item>
<item>
<widget class="ElidedLabel" name="forumName">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>1677215</height>
</size>
<widget class="QPushButton" name="forumName">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click here to clear current selected thread and display more information about this forum.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string notr="true">Forum name</string>
<string>PushButton</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
@ -532,16 +517,16 @@
</action>
</widget>
<customwidgets>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>RSTextBrowser</class>
<extends>QTextBrowser</extends>
<header>gui/common/RSTextBrowser.h</header>
</customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
@ -552,12 +537,6 @@
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>ElidedLabel</class>
<extends>QLabel</extends>
<header location="global">gui/common/ElidedLabel.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>RSImageBlockWidget</class>
<extends>QWidget</extends>
@ -566,8 +545,8 @@
</customwidget>
</customwidgets>
<resources>
<include location="../icons.qrc"/>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -92,7 +92,7 @@ void ImHistoryBrowserCreateItemsThread::run()
/** Default constructor */
ImHistoryBrowser::ImHistoryBrowser(const ChatId &chatId, QTextEdit *edit,const QString &chatTitle, QWidget *parent)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);

View File

@ -219,7 +219,11 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
/* initialize friends list */
ui.friendSelectionWidget->setHeaderText(tr("Send To:"));
ui.friendSelectionWidget->setModus(FriendSelectionWidget::MODUS_MULTI);
ui.friendSelectionWidget->setShowType(FriendSelectionWidget::SHOW_GXS);
ui.friendSelectionWidget->setShowType(FriendSelectionWidget::SHOW_GXS
#ifdef RS_DIRECT_CHAT
| FriendSelectionWidget::SHOW_SSL
#endif // RS_DIRECT_CHAT
);
ui.friendSelectionWidget->start();
QActionGroup *grp = new QActionGroup(this);
@ -265,6 +269,9 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
/* Add filter types */
ui.filterComboBox->addItem(tr("All people"));
ui.filterComboBox->addItem(tr("My contacts"));
#ifdef RS_DIRECT_CHAT
ui.filterComboBox->addItem(tr("Friend Nodes"));
#endif // RS_DIRECT_CHAT
ui.filterComboBox->setCurrentIndex(0);
if(rsIdentity->nbRegularContacts() > 0)
@ -1056,8 +1063,25 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
QString MessageComposer::buildReplyHeader(const MessageInfo &msgInfo)
{
RetroShareLink link = RetroShareLink::createMessage(msgInfo.rspeerid_srcId, "");
QString from = link.toHtml();
RetroShareLink link;
QString from;
if(msgInfo.msgflags & RS_MSG_DISTANT)
{
link = RetroShareLink::createMessage(msgInfo.rsgxsid_srcId, "");
if (link.valid())
{
from += link.toHtml();
}
}
else
{
link = RetroShareLink::createMessage(msgInfo.rspeerid_srcId, "");
if (link.valid())
{
from += link.toHtml();
}
}
QString to;
for ( std::set<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgto.begin(); it != msgInfo.rspeerid_msgto.end(); ++it)
@ -2608,6 +2632,11 @@ void MessageComposer::filterComboBoxChanged(int i)
case 1:
ui.friendSelectionWidget->setShowType(FriendSelectionWidget::SHOW_CONTACTS);
break;
#ifdef RS_DIRECT_CHAT
case 2:
ui.friendSelectionWidget->setShowType(FriendSelectionWidget::SHOW_SSL);
break;
#endif // RS_DIRECT_CHAT
}
}

View File

@ -143,7 +143,7 @@ PulseViewGroup QToolButton#toolButton_follow{
color: white;
background: #0099cc;
border-radius: 4px;
max-height: 27px;
max-height: 20px;
min-width: 4em;
padding: 2px;
padding-left: 6px;
@ -220,7 +220,7 @@ PulseAddDialog QPushButton#pushButton_Post:disabled {
color: white;
background: #d40000;
border-radius: 4px;
max-height: 27px;
max-height: 20px;
min-width: 4em;
padding-left: 6px;
padding-right: 6px;
@ -228,7 +228,7 @@ PulseAddDialog QPushButton#pushButton_Post:disabled {
/* Forums */
GxsForumThreadWidget QLabel#forumName
GxsForumThreadWidget QPushButton#forumName
{
font: bold;
font-size: 14px;
@ -1109,3 +1109,34 @@ PulseTopLevel QFrame#frame, PulseViewGroup QFrame#frame, PulseReply QFrame#frame
border-radius: 6px;
background: white;
}
PulseAddDialog QTextEdit#textEdit_Pulse {
border: 2px solid #7ecbfb;
border-radius: 6px;
background: white;
}
PulseAddDialog QFrame#frame_input, QFrame#frame_reply, QFrame#frame {
border: 0px;
}
PulseAddDialog QLabel#label_groupName {
font-size: 12pt;
}
PulseReply #line_replyLine , PulseMessage #line{
color: #7ecbfb;
}
PulseReply QLabel#label_groupName{
color: #5b7083;
}
WireDialog QLabel#label_viewMode {
font-size: 12pt;
}
WireGroupDialog QFrame#frame {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #9BDBF9, stop:1 #1592CD);
border: 0px;
}

View File

@ -41,8 +41,6 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
ui.unit_CB->addItem(tr("KB/s")) ;
ui.unit_CB->addItem(tr("Count")) ;
ui.logScale_CB->setChecked(true) ;
ui.bwgraph_BW->setSelector(BWGraphSource::SELECTOR_TYPE_FRIEND,BWGraphSource::GRAPH_TYPE_SUM) ;
ui.bwgraph_BW->setSelector(BWGraphSource::SELECTOR_TYPE_SERVICE,BWGraphSource::GRAPH_TYPE_SUM) ;

View File

@ -192,7 +192,7 @@ BwCtrlWindow::BwCtrlWindow(QWidget *parent)
/* Set header resize modes and initial section sizes Peer TreeView*/
QHeaderView * _header = bwTreeWidget->header () ;
// _header->resizeSection ( COLUMN_RSNAME, 170*fact );
QHeaderView_setSectionResizeMode(_header, QHeaderView::ResizeToContents);
QHeaderView_setSectionResizeMode(_header, QHeaderView::Interactive);
}
BwCtrlWindow::~BwCtrlWindow()

View File

@ -109,7 +109,7 @@ void DhtWindow::updateDisplay()
RsAutoUpdatePage::unlockAllEvents() ;
QHeaderView_setSectionResizeMode(ui.peerTreeWidget->header(), QHeaderView::ResizeToContents);
//QHeaderView_setSectionResizeMode(ui.peerTreeWidget->header(), QHeaderView::ResizeToContents);
QHeaderView_setSectionResizeMode(ui.dhtTreeWidget->header(), QHeaderView::ResizeToContents);
QHeaderView_setSectionResizeMode(ui.relayTreeWidget->header(), QHeaderView::ResizeToContents);
}

View File

@ -203,6 +203,8 @@ void GlobalRouterStatistics::updateContent()
item -> setData(COL_DUPLICATION_FACTOR, Qt::DisplayRole, QString::number(cache_infos[i].duplication_factor));
item -> setData(COL_RECEIVEDTIME, Qt::DisplayRole, QString::number(now - cache_infos[i].routing_time));
item -> setData(COL_SENDTIME, Qt::DisplayRole, QString::number(now - cache_infos[i].last_sent_time));
item->setTextAlignment(COL_DATASIZE, Qt::AlignRight );
}
}

View File

@ -464,17 +464,16 @@ void GxsTransportStatistics::loadGroups()
#ifdef DEBUG_FORUMS
std::cerr << "Retrieving post data for post " << mThreadId << std::endl;
#endif
auto stats = std::make_unique<
std::map<RsGxsGroupId,RsGxsTransGroupStatistics> >();
auto stats = new std::map<RsGxsGroupId,RsGxsTransGroupStatistics>();
if(!rsGxsTrans->getGroupStatistics(*stats))
{
RS_ERR("Cannot retrieve group statistics in GxsTransportStatistics");
delete stats;
return;
}
RsQThreadUtils::postToObject(
[stats = std::move(stats), this]()
RsQThreadUtils::postToObject( [stats, this]()
{
/* Here it goes any code you want to be executed on the Qt Gui
* thread, for example to update the data model with new information
@ -485,7 +484,8 @@ void GxsTransportStatistics::loadGroups()
updateContent();
mStateHelper->setLoading(GXSTRANS_GROUP_META, false);
}, this );
delete stats;
}, this );
});
}

View File

@ -121,7 +121,7 @@ RttStatisticsGraph::RttStatisticsGraph(QWidget *parent)
src->setCollectionTimeLimit(10*60*1000) ; // 10 mins
src->setCollectionTimePeriod(1000) ; // collect every second
src->setDigits(1) ;
src->setDigits(3) ;
src->start() ;
setSource(src) ;

View File

@ -1969,7 +1969,7 @@ GxsChannelPostItem > QFrame#mainFrame[new=true] {
border-radius: 10px;
}
GxsForumThreadWidget QLabel#forumName
GxsForumThreadWidget QPushButton#forumName
{
qproperty-fontSizeFactor: 140;
color: #0099cc;
@ -2277,3 +2277,11 @@ PulseTopLevel QFrame#frame, PulseViewGroup QFrame#frame, PulseReply QFrame#frame
MainWindow QListWidget {
font-size: 12pt;
}
ChatLobbyWidget QTreeWidget#lobbyTreeWidget{
font-size: 10pt;
}
NewFriendList QTreeView#peerTreeWidget {
font-size: 12pt;
}

View File

@ -1373,7 +1373,7 @@ PostedCreatePostDialog QPushButton#submitButton:hover {
}
GxsForumThreadWidget QLabel#forumName
GxsForumThreadWidget QPushButton#forumName
{
qproperty-fontSizeFactor: 140;
color: #0099cc;
@ -1498,3 +1498,11 @@ PulseTopLevel QFrame#frame, PulseViewGroup QFrame#frame, PulseReply QFrame#frame
MainWindow QListWidget {
font-size: 12pt;
}
ChatLobbyWidget QTreeWidget#lobbyTreeWidget{
font-size: 10pt;
}
NewFriendList QTreeView#peerTreeWidget {
font-size: 12pt;
}

View File

@ -305,7 +305,7 @@ QPixmap misc::getOpenThumbnailedPicture(QWidget *parent, const QString &caption,
{
// Let the user choose an picture file
QString fileName;
if (!getOpenFileName(parent, RshareSettings::LASTDIR_IMAGES, caption, tr("Pictures (*.png *.jpeg *.xpm *.jpg *.tiff *.gif)"), fileName))
if (!getOpenFileName(parent, RshareSettings::LASTDIR_IMAGES, caption, tr("Pictures (*.png *.jpeg *.xpm *.jpg *.tiff *.gif *.webp)"), fileName))
return QPixmap();
if(width > 0 && height > 0)