mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-19 03:18:15 -04:00
Fix Graphic Circles update.
This commit is contained in:
parent
3eb9a5e5f1
commit
d727311dbc
3 changed files with 64 additions and 40 deletions
|
@ -127,14 +127,16 @@ void IdentityWidget::updateData(const RsPeerDetails &pgp_details)
|
||||||
ui->labelKeyId->setText(_keyId);
|
ui->labelKeyId->setText(_keyId);
|
||||||
ui->labelKeyId->setToolTip(tr("PGP id:").append(" "+_keyId));
|
ui->labelKeyId->setToolTip(tr("PGP id:").append(" "+_keyId));
|
||||||
|
|
||||||
QPixmap avatar;
|
if (!_haveGXSId) {
|
||||||
/*AvatarDefs::getAvatarFromGpgId(_details.gpg_id, avatar);
|
QPixmap avatar;
|
||||||
if (_avatar != avatar.toImage()) {
|
AvatarDefs::getAvatarFromGpgId(_details.gpg_id, avatar);
|
||||||
_avatar = avatar.toImage();
|
if (_avatar != avatar.toImage()) {
|
||||||
_scene->clear();
|
_avatar = avatar.toImage();
|
||||||
_scene->addPixmap(avatar.scaled(ui->graphicsView->width(),ui->graphicsView->height()));
|
_scene->clear();
|
||||||
emit imageUpdated();
|
_scene->addPixmap(avatar.scaled(ui->graphicsView->width(),ui->graphicsView->height()));
|
||||||
}*///if (_avatar != avatar.toImage())
|
emit imageUpdated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//}//if (_details != gpg_details)
|
//}//if (_details != gpg_details)
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/msgs/MessageComposer.h"
|
#include "gui/msgs/MessageComposer.h"
|
||||||
#include "gui/gxs/GxsIdDetails.h"
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
|
#include "gui/gxs/RsGxsUpdateBroadcastBase.h"
|
||||||
#include "gui/Identity/IdDetailsDialog.h"
|
#include "gui/Identity/IdDetailsDialog.h"
|
||||||
|
|
||||||
#include "retroshare/rspeers.h"
|
#include "retroshare/rspeers.h"
|
||||||
|
@ -60,6 +61,9 @@ PeopleDialog::PeopleDialog(QWidget *parent)
|
||||||
/* Setup TokenQueue */
|
/* Setup TokenQueue */
|
||||||
mIdentityQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
mIdentityQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
||||||
mCirclesQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
|
mCirclesQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
|
||||||
|
// This is used to grab the broadcast of changes from p3GxsCircles, which is discarded by the current dialog, since it expects data for p3Identity only.
|
||||||
|
mCirclesBroadcastBase = new RsGxsUpdateBroadcastBase(rsGxsCircles, this);
|
||||||
|
connect(mCirclesBroadcastBase, SIGNAL(fillDisplay(bool)), this, SLOT(updateCirclesDisplay(bool)));
|
||||||
|
|
||||||
|
|
||||||
tabWidget->removeTab(1);
|
tabWidget->removeTab(1);
|
||||||
|
@ -115,6 +119,9 @@ PeopleDialog::PeopleDialog(QWidget *parent)
|
||||||
if (geometryInt.isEmpty() == false) {
|
if (geometryInt.isEmpty() == false) {
|
||||||
splitterInternal->restoreState(geometryInt);
|
splitterInternal->restoreState(geometryInt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reloadAll();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructor. */
|
/** Destructor. */
|
||||||
|
@ -280,18 +287,18 @@ void PeopleDialog::insertCircles(uint32_t token)
|
||||||
}//if(!rsGxsCircles->getCircleDetails(RsGxsCircleId(git->mGroupId), details))
|
}//if(!rsGxsCircles->getCircleDetails(RsGxsCircleId(git->mGroupId), details))
|
||||||
|
|
||||||
if (!details.mIsExternal){
|
if (!details.mIsExternal){
|
||||||
std::map<RsGxsGroupId, CircleWidget*>::iterator itFound;
|
std::map<RsGxsGroupId, CircleWidget*>::iterator itFound;
|
||||||
if((itFound=_int_circles_widgets.find(gsItem.mGroupId)) == _int_circles_widgets.end()) {
|
if((itFound=_int_circles_widgets.find(gsItem.mGroupId)) == _int_circles_widgets.end()) {
|
||||||
std::cerr << "PeopleDialog::insertExtCircles() add new Internal GroupId: " << gsItem.mGroupId;
|
std::cerr << "PeopleDialog::insertExtCircles() add new Internal GroupId: " << gsItem.mGroupId;
|
||||||
std::cerr << " GroupName: " << gsItem.mGroupName;
|
std::cerr << " GroupName: " << gsItem.mGroupName;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
CircleWidget *gitem = new CircleWidget() ;
|
CircleWidget *gitem = new CircleWidget() ;
|
||||||
QObject::connect(gitem, SIGNAL(flowLayoutItemDropped(QList<FlowLayoutItem*>,bool&)), this, SLOT(fl_flowLayoutItemDroppedInt(QList<FlowLayoutItem*>,bool&)));
|
QObject::connect(gitem, SIGNAL(flowLayoutItemDropped(QList<FlowLayoutItem*>,bool&)), this, SLOT(fl_flowLayoutItemDroppedInt(QList<FlowLayoutItem*>,bool&)));
|
||||||
QObject::connect(gitem, SIGNAL(askForGXSIdentityWidget(RsGxsId)), this, SLOT(cw_askForGXSIdentityWidget(RsGxsId)));
|
QObject::connect(gitem, SIGNAL(askForGXSIdentityWidget(RsGxsId)), this, SLOT(cw_askForGXSIdentityWidget(RsGxsId)));
|
||||||
QObject::connect(gitem, SIGNAL(askForPGPIdentityWidget(RsPgpId)), this, SLOT(cw_askForPGPIdentityWidget(RsPgpId)));
|
QObject::connect(gitem, SIGNAL(askForPGPIdentityWidget(RsPgpId)), this, SLOT(cw_askForPGPIdentityWidget(RsPgpId)));
|
||||||
QObject::connect(gitem, SIGNAL(imageUpdated()), this, SLOT(cw_imageUpdatedInt()));
|
QObject::connect(gitem, SIGNAL(imageUpdated()), this, SLOT(cw_imageUpdatedInt()));
|
||||||
gitem->updateData( gsItem, details );
|
gitem->updateData( gsItem, details );
|
||||||
_int_circles_widgets[gsItem.mGroupId] = gitem ;
|
_int_circles_widgets[gsItem.mGroupId] = gitem ;
|
||||||
|
|
||||||
_flowLayoutInt->addWidget(gitem);
|
_flowLayoutInt->addWidget(gitem);
|
||||||
|
@ -328,21 +335,21 @@ void PeopleDialog::insertCircles(uint32_t token)
|
||||||
|
|
||||||
_flowLayoutExt->addWidget(gitem);
|
_flowLayoutExt->addWidget(gitem);
|
||||||
|
|
||||||
QPixmap pixmap = gitem->getImage();
|
QPixmap pixmap = gitem->getImage();
|
||||||
pictureFlowWidgetExternal->addSlide( pixmap );
|
pictureFlowWidgetExternal->addSlide( pixmap );
|
||||||
_extListCir << gitem;
|
_extListCir << gitem;
|
||||||
} else {//if((itFound=_circles_widgets.find(gsItem.mGroupId)) == _circles_widgets.end())
|
} else {//if((itFound=_circles_widgets.find(gsItem.mGroupId)) == _circles_widgets.end())
|
||||||
std::cerr << "PeopleDialog::insertExtCircles() Update GroupId: " << gsItem.mGroupId;
|
std::cerr << "PeopleDialog::insertExtCircles() Update GroupId: " << gsItem.mGroupId;
|
||||||
std::cerr << " GroupName: " << gsItem.mGroupName;
|
std::cerr << " GroupName: " << gsItem.mGroupName;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
CircleWidget *cirWidget = itFound->second;
|
CircleWidget *cirWidget = itFound->second;
|
||||||
cirWidget->updateData( gsItem, details );
|
cirWidget->updateData( gsItem, details );
|
||||||
|
|
||||||
//int index = _extListCir.indexOf(cirWidget);
|
//int index = _extListCir.indexOf(cirWidget);
|
||||||
//QPixmap pixmap = cirWidget->getImage();
|
//QPixmap pixmap = cirWidget->getImage();
|
||||||
//pictureFlowWidgetExternal->setSlide(index, pixmap);
|
//pictureFlowWidgetExternal->setSlide(index, pixmap);
|
||||||
}//if((item=_circles_items.find(gsItem.mGroupId)) == _circles_items.end())
|
}//if((item=_circles_items.find(gsItem.mGroupId)) == _circles_items.end())
|
||||||
}//else (!details.mIsExternal)
|
}//else (!details.mIsExternal)
|
||||||
}//for(gsIt = gSummaryList.begin(); gsIt != gSummaryList.end(); ++gsIt)
|
}//for(gsIt = gSummaryList.begin(); gsIt != gSummaryList.end(); ++gsIt)
|
||||||
}
|
}
|
||||||
|
@ -378,32 +385,40 @@ void PeopleDialog::requestCirclesList()
|
||||||
mCirclesQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, PD_CIRCLES);
|
mCirclesQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, PD_CIRCLES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PeopleDialog::updateCirclesDisplay(bool)
|
||||||
|
{
|
||||||
|
std::cerr << "!!Updating circles display!" << std::endl;
|
||||||
|
|
||||||
|
requestCirclesList() ;
|
||||||
|
}
|
||||||
|
|
||||||
void PeopleDialog::loadRequest(const TokenQueue * /*queue*/, const TokenRequest &req)
|
void PeopleDialog::loadRequest(const TokenQueue * /*queue*/, const TokenRequest &req)
|
||||||
{
|
{
|
||||||
std::cerr << "IdDialog::loadRequest() UserType: " << req.mUserType;
|
std::cerr << "IdDialog::loadRequest() UserType: " << req.mUserType;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
switch(req.mUserType) {
|
switch(req.mUserType) {
|
||||||
case PD_IDLIST:
|
case PD_IDLIST:
|
||||||
insertIdList(req.mToken);
|
insertIdList(req.mToken);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PD_IDDETAILS:
|
case PD_IDDETAILS:
|
||||||
//insertIdDetails(req.mToken);
|
//insertIdDetails(req.mToken);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PD_CIRCLES:
|
case PD_CIRCLES:
|
||||||
insertCircles(req.mToken);
|
insertCircles(req.mToken);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PD_REFRESH:
|
case PD_REFRESH:
|
||||||
updateDisplay(true);
|
updateDisplay(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
std::cerr << "IdDialog::loadRequest() ERROR";
|
std::cerr << "IdDialog::loadRequest() ERROR";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
break;
|
break;
|
||||||
}//switch(req.mUserType)
|
}//switch(req.mUserType)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeopleDialog::iw_AddButtonClickedExt()
|
void PeopleDialog::iw_AddButtonClickedExt()
|
||||||
|
@ -629,7 +644,9 @@ void PeopleDialog::cw_askForGXSIdentityWidget(RsGxsId gxs_id)
|
||||||
IdentityWidget *idWidget = itFound->second;
|
IdentityWidget *idWidget = itFound->second;
|
||||||
dest->addIdent(idWidget);
|
dest->addIdent(idWidget);
|
||||||
}//if((itFound=_gxs_identity_widgets.find(gxs_id)) != _gxs_identity_widgets.end()) {
|
}//if((itFound=_gxs_identity_widgets.find(gxs_id)) != _gxs_identity_widgets.end()) {
|
||||||
}//if (dest)
|
} else {
|
||||||
|
reloadAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeopleDialog::cw_askForPGPIdentityWidget(RsPgpId pgp_id)
|
void PeopleDialog::cw_askForPGPIdentityWidget(RsPgpId pgp_id)
|
||||||
|
@ -643,7 +660,9 @@ void PeopleDialog::cw_askForPGPIdentityWidget(RsPgpId pgp_id)
|
||||||
IdentityWidget *idWidget = itFound->second;
|
IdentityWidget *idWidget = itFound->second;
|
||||||
dest->addIdent(idWidget);
|
dest->addIdent(idWidget);
|
||||||
}//if((itFound=_pgp_identity_widgets.find(gxs_id)) != _pgp_identity_widgets.end()) {
|
}//if((itFound=_pgp_identity_widgets.find(gxs_id)) != _pgp_identity_widgets.end()) {
|
||||||
}//if (dest)
|
} else {
|
||||||
|
reloadAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeopleDialog::cw_imageUpdatedInt()
|
void PeopleDialog::cw_imageUpdatedInt()
|
||||||
|
|
|
@ -53,7 +53,7 @@ class PeopleDialog : public RsGxsUpdateBroadcastPage, public Ui::PeopleDialog, p
|
||||||
virtual QString pageName() const { return tr("People") ; } //MainPage
|
virtual QString pageName() const { return tr("People") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
void loadRequest(const TokenQueue * /*queue*/, const TokenRequest &req) ;
|
void loadRequest(const TokenQueue * queue, const TokenRequest &req) ;
|
||||||
|
|
||||||
void requestIdList() ;
|
void requestIdList() ;
|
||||||
void requestCirclesList() ;
|
void requestCirclesList() ;
|
||||||
|
@ -67,6 +67,8 @@ class PeopleDialog : public RsGxsUpdateBroadcastPage, public Ui::PeopleDialog, p
|
||||||
//End RsGxsUpdateBroadcastPage
|
//End RsGxsUpdateBroadcastPage
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void updateCirclesDisplay(bool);
|
||||||
|
|
||||||
void iw_AddButtonClickedExt();
|
void iw_AddButtonClickedExt();
|
||||||
void iw_AddButtonClickedInt();
|
void iw_AddButtonClickedInt();
|
||||||
void addToCircleExt();
|
void addToCircleExt();
|
||||||
|
@ -95,6 +97,7 @@ private:
|
||||||
|
|
||||||
TokenQueue *mIdentityQueue;
|
TokenQueue *mIdentityQueue;
|
||||||
TokenQueue *mCirclesQueue;
|
TokenQueue *mCirclesQueue;
|
||||||
|
RsGxsUpdateBroadcastBase *mCirclesBroadcastBase ;
|
||||||
|
|
||||||
FlowLayout *_flowLayoutExt;
|
FlowLayout *_flowLayoutExt;
|
||||||
std::map<RsGxsId,IdentityWidget *> _gxs_identity_widgets ;
|
std::map<RsGxsId,IdentityWidget *> _gxs_identity_widgets ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue