Merge pull request #345 from PhenomRetroShare/Update_CircleGraphical

Fix Graphic Circles update.
This commit is contained in:
Cyril Soler 2016-04-10 09:49:31 -04:00
commit c9c15e58f2
3 changed files with 64 additions and 40 deletions

View File

@ -127,14 +127,16 @@ void IdentityWidget::updateData(const RsPeerDetails &pgp_details)
ui->labelKeyId->setText(_keyId);
ui->labelKeyId->setToolTip(tr("PGP id:").append(" "+_keyId));
if (!_haveGXSId) {
QPixmap avatar;
/*AvatarDefs::getAvatarFromGpgId(_details.gpg_id, avatar);
AvatarDefs::getAvatarFromGpgId(_details.gpg_id, avatar);
if (_avatar != avatar.toImage()) {
_avatar = avatar.toImage();
_scene->clear();
_scene->addPixmap(avatar.scaled(ui->graphicsView->width(),ui->graphicsView->height()));
emit imageUpdated();
}*///if (_avatar != avatar.toImage())
}
}
//}//if (_details != gpg_details)

View File

@ -28,6 +28,7 @@
#include "gui/settings/rsharesettings.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/gxs/GxsIdDetails.h"
#include "gui/gxs/RsGxsUpdateBroadcastBase.h"
#include "gui/Identity/IdDetailsDialog.h"
#include "retroshare/rspeers.h"
@ -60,6 +61,9 @@ PeopleDialog::PeopleDialog(QWidget *parent)
/* Setup TokenQueue */
mIdentityQueue = new TokenQueue(rsIdentity->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);
@ -115,6 +119,9 @@ PeopleDialog::PeopleDialog(QWidget *parent)
if (geometryInt.isEmpty() == false) {
splitterInternal->restoreState(geometryInt);
}
reloadAll();
}
/** Destructor. */
@ -378,6 +385,13 @@ void PeopleDialog::requestCirclesList()
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)
{
std::cerr << "IdDialog::loadRequest() UserType: " << req.mUserType;
@ -404,6 +418,7 @@ void PeopleDialog::loadRequest(const TokenQueue * /*queue*/, const TokenRequest
std::cerr << std::endl;
break;
}//switch(req.mUserType)
}
void PeopleDialog::iw_AddButtonClickedExt()
@ -629,7 +644,9 @@ void PeopleDialog::cw_askForGXSIdentityWidget(RsGxsId gxs_id)
IdentityWidget *idWidget = itFound->second;
dest->addIdent(idWidget);
}//if((itFound=_gxs_identity_widgets.find(gxs_id)) != _gxs_identity_widgets.end()) {
}//if (dest)
} else {
reloadAll();
}
}
void PeopleDialog::cw_askForPGPIdentityWidget(RsPgpId pgp_id)
@ -643,7 +660,9 @@ void PeopleDialog::cw_askForPGPIdentityWidget(RsPgpId pgp_id)
IdentityWidget *idWidget = itFound->second;
dest->addIdent(idWidget);
}//if((itFound=_pgp_identity_widgets.find(gxs_id)) != _pgp_identity_widgets.end()) {
}//if (dest)
} else {
reloadAll();
}
}
void PeopleDialog::cw_imageUpdatedInt()

View File

@ -53,7 +53,7 @@ class PeopleDialog : public RsGxsUpdateBroadcastPage, public Ui::PeopleDialog, p
virtual QString pageName() const { return tr("People") ; } //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 requestCirclesList() ;
@ -67,6 +67,8 @@ class PeopleDialog : public RsGxsUpdateBroadcastPage, public Ui::PeopleDialog, p
//End RsGxsUpdateBroadcastPage
private slots:
void updateCirclesDisplay(bool);
void iw_AddButtonClickedExt();
void iw_AddButtonClickedInt();
void addToCircleExt();
@ -95,6 +97,7 @@ private:
TokenQueue *mIdentityQueue;
TokenQueue *mCirclesQueue;
RsGxsUpdateBroadcastBase *mCirclesBroadcastBase ;
FlowLayout *_flowLayoutExt;
std::map<RsGxsId,IdentityWidget *> _gxs_identity_widgets ;