mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-06 05:14:21 -04:00
incorporated defnax changes
This commit is contained in:
parent
734a308aa3
commit
0769dabb2e
5 changed files with 1767 additions and 1645 deletions
|
@ -85,14 +85,22 @@ void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info)
|
||||||
ui->labelKeyId->setVisible(false);
|
ui->labelKeyId->setVisible(false);
|
||||||
|
|
||||||
/// (TODO) Get real ident icon
|
/// (TODO) Get real ident icon
|
||||||
QImage image = GxsIdDetails::makeDefaultIcon(RsGxsId(_group_info.mMeta.mGroupId));
|
QImage image;
|
||||||
|
|
||||||
|
if(_group_info.mImage.mSize > 0 && image.loadFromData(_group_info.mImage.mData, _group_info.mImage.mSize, "PNG"))
|
||||||
|
image = image;
|
||||||
|
else
|
||||||
|
image = GxsIdDetails::makeDefaultIcon(RsGxsId(_group_info.mMeta.mGroupId));
|
||||||
|
|
||||||
if (_avatar != image) {
|
if (_avatar != image) {
|
||||||
_avatar = image;
|
_avatar = image;
|
||||||
_scene->clear();
|
_scene->clear();
|
||||||
_scene->addPixmap(QPixmap::fromImage(image.scaled(ui->graphicsView->width(),ui->graphicsView->height())));
|
_scene->addPixmap(QPixmap::fromImage(image.scaled(ui->graphicsView->width(),ui->graphicsView->height())));
|
||||||
emit imageUpdated();
|
emit imageUpdated();
|
||||||
}
|
}//if (_avatar != image)
|
||||||
}
|
}//if (!_havePGPDetail)
|
||||||
|
|
||||||
|
//}//if (_group_info != gxs_group_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdentityWidget::updateData(const RsPeerDetails &pgp_details)
|
void IdentityWidget::updateData(const RsPeerDetails &pgp_details)
|
||||||
|
@ -120,14 +128,16 @@ void IdentityWidget::updateData(const RsPeerDetails &pgp_details)
|
||||||
ui->labelKeyId->setToolTip(tr("PGP id:").append(" "+_keyId));
|
ui->labelKeyId->setToolTip(tr("PGP id:").append(" "+_keyId));
|
||||||
|
|
||||||
QPixmap avatar;
|
QPixmap avatar;
|
||||||
AvatarDefs::getAvatarFromGpgId(_details.gpg_id, avatar);
|
/*AvatarDefs::getAvatarFromGpgId(_details.gpg_id, avatar);
|
||||||
if (_avatar != avatar.toImage())
|
if (_avatar != avatar.toImage()) {
|
||||||
{
|
|
||||||
_avatar = avatar.toImage();
|
_avatar = avatar.toImage();
|
||||||
_scene->clear();
|
_scene->clear();
|
||||||
_scene->addPixmap(avatar.scaled(ui->graphicsView->width(),ui->graphicsView->height()));
|
_scene->addPixmap(avatar.scaled(ui->graphicsView->width(),ui->graphicsView->height()));
|
||||||
emit imageUpdated();
|
emit imageUpdated();
|
||||||
}
|
}*///if (_avatar != avatar.toImage())
|
||||||
|
|
||||||
|
|
||||||
|
//}//if (_details != gpg_details)
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info, const RsPeerDetails &pgp_details)
|
void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info, const RsPeerDetails &pgp_details)
|
||||||
|
@ -197,3 +207,4 @@ void IdentityWidget::pbAdd_clicked()
|
||||||
{
|
{
|
||||||
emit addButtonClicked();
|
emit addButtonClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>102</width>
|
<width>102</width>
|
||||||
<height>158</height>
|
<height>170</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
@ -131,7 +131,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ElidedLabel</class>
|
<class>ElidedLabel</class>
|
||||||
|
@ -140,5 +139,8 @@
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
<resources>
|
||||||
|
<include location="../images.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -26,11 +26,15 @@
|
||||||
#include "gui/Circles/CreateCircleDialog.h"
|
#include "gui/Circles/CreateCircleDialog.h"
|
||||||
#include "gui/common/FlowLayout.h"
|
#include "gui/common/FlowLayout.h"
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
#include "gui/msgs/MessageComposer.h"
|
||||||
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
|
#include "gui/Identity/IdDetailsDialog.h"
|
||||||
|
|
||||||
#include "retroshare/rspeers.h"
|
#include "retroshare/rspeers.h"
|
||||||
#include "retroshare/rsidentity.h"
|
#include "retroshare/rsidentity.h"
|
||||||
#include "retroshare/rsgxscircles.h"
|
#include "retroshare/rsgxscircles.h"
|
||||||
#include "retroshare/rsgxsflags.h"
|
#include "retroshare/rsgxsflags.h"
|
||||||
|
#include "retroshare/rsmsgs.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
@ -56,6 +60,9 @@ PeopleDialog::PeopleDialog(QWidget *parent)
|
||||||
mIdentityQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
mIdentityQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
||||||
mCirclesQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
|
mCirclesQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
|
||||||
|
|
||||||
|
|
||||||
|
tabWidget->removeTab(1);
|
||||||
|
|
||||||
//need erase QtCreator Layout first(for Win)
|
//need erase QtCreator Layout first(for Win)
|
||||||
delete idExternal->layout();
|
delete idExternal->layout();
|
||||||
delete idInternal->layout();
|
delete idInternal->layout();
|
||||||
|
@ -418,6 +425,45 @@ void PeopleDialog::iw_AddButtonClickedExt()
|
||||||
+ ";" + QString::fromStdString(dest->groupInfo().mMeta.mGroupId.toStdString()));
|
+ ";" + QString::fromStdString(dest->groupInfo().mMeta.mGroupId.toStdString()));
|
||||||
}//for( itCurs =_ext_circles_widgets.begin();
|
}//for( itCurs =_ext_circles_widgets.begin();
|
||||||
|
|
||||||
|
std::list<RsGxsId> own_identities ;
|
||||||
|
rsIdentity->getOwnIds(own_identities) ;
|
||||||
|
|
||||||
|
if(own_identities.size() <= 1)
|
||||||
|
{
|
||||||
|
QAction *action = contextMnu.addAction(QIcon(":/images/chat_24.png"), tr("Chat with this person"), this, SLOT(chatIdentity()));
|
||||||
|
|
||||||
|
if(own_identities.empty())
|
||||||
|
action->setEnabled(false) ;
|
||||||
|
else
|
||||||
|
action->setData(QString::fromStdString((own_identities.front()).toStdString()) + ";" + QString::fromStdString(dest->groupInfo().mMeta.mGroupId.toStdString())) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMenu *mnu = contextMnu.addMenu(QIcon(":/images/chat_24.png"),tr("Chat with this person as...")) ;
|
||||||
|
|
||||||
|
for(std::list<RsGxsId>::const_iterator it=own_identities.begin();it!=own_identities.end();++it)
|
||||||
|
{
|
||||||
|
RsIdentityDetails idd ;
|
||||||
|
rsIdentity->getIdDetails(*it,idd) ;
|
||||||
|
|
||||||
|
QPixmap pixmap ;
|
||||||
|
|
||||||
|
if(idd.mAvatar.mSize == 0 || !pixmap.loadFromData(idd.mAvatar.mData, idd.mAvatar.mSize, "PNG"))
|
||||||
|
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(*it)) ;
|
||||||
|
|
||||||
|
QAction *action = mnu->addAction(QIcon(pixmap), QString("%1 (%2)").arg(QString::fromUtf8(idd.mNickname.c_str()), QString::fromStdString((*it).toStdString())), this, SLOT(chatIdentity()));
|
||||||
|
action->setData(QString::fromStdString((*it).toStdString()) + ";" + QString::fromStdString(dest->groupInfo().mMeta.mGroupId.toStdString())) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QAction *actionsendmsg = contextMnu.addAction(QIcon(":/images/mail_new.png"), tr("Send message to this person"), this, SLOT(sendMessage()));
|
||||||
|
actionsendmsg->setData( QString::fromStdString(dest->groupInfo().mMeta.mGroupId.toStdString()));
|
||||||
|
|
||||||
|
contextMnu.addSeparator();
|
||||||
|
|
||||||
|
QAction *actionDetails = contextMnu.addAction(QIcon(":/images/info16.png"), tr("Person details"), this, SLOT(personDetails()));
|
||||||
|
actionDetails->setData( QString::fromStdString(dest->groupInfo().mMeta.mGroupId.toStdString()));
|
||||||
|
|
||||||
contextMnu.exec(QCursor::pos());
|
contextMnu.exec(QCursor::pos());
|
||||||
}//if (dest)
|
}//if (dest)
|
||||||
}
|
}
|
||||||
|
@ -504,6 +550,71 @@ void PeopleDialog::addToCircleInt()
|
||||||
}//if (action)
|
}//if (action)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PeopleDialog::chatIdentity()
|
||||||
|
{
|
||||||
|
QAction *action =
|
||||||
|
qobject_cast<QAction *>(QObject::sender());
|
||||||
|
if (action) {
|
||||||
|
QString data = action->data().toString();
|
||||||
|
QStringList idList = data.split(";");
|
||||||
|
|
||||||
|
RsGxsId from_gxs_id = RsGxsId(idList.at(0).toStdString());
|
||||||
|
RsGxsId gxs_id = RsGxsId(idList.at(1).toStdString());
|
||||||
|
|
||||||
|
uint32_t error_code ;
|
||||||
|
|
||||||
|
if(!rsMsgs->initiateDistantChatConnexion(RsGxsId(gxs_id), from_gxs_id, error_code))
|
||||||
|
QMessageBox::information(NULL, tr("Distant chat cannot work"), QString("%1 %2: %3").arg(tr("Distant chat refused with this person.")).arg(tr("Error code")).arg(error_code)) ;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PeopleDialog::sendMessage()
|
||||||
|
{
|
||||||
|
QAction *action =
|
||||||
|
qobject_cast<QAction *>(QObject::sender());
|
||||||
|
if (action) {
|
||||||
|
QString data = action->data().toString();
|
||||||
|
|
||||||
|
MessageComposer *nMsgDialog = MessageComposer::newMsg();
|
||||||
|
if (nMsgDialog == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RsGxsId gxs_id = RsGxsId(data.toStdString());;
|
||||||
|
|
||||||
|
nMsgDialog->addRecipient(MessageComposer::TO, RsGxsId(gxs_id));
|
||||||
|
nMsgDialog->show();
|
||||||
|
nMsgDialog->activateWindow();
|
||||||
|
|
||||||
|
/* window will destroy itself! */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void PeopleDialog::personDetails()
|
||||||
|
{
|
||||||
|
QAction *action =
|
||||||
|
qobject_cast<QAction *>(QObject::sender());
|
||||||
|
if (action) {
|
||||||
|
QString data = action->data().toString();
|
||||||
|
|
||||||
|
RsGxsId gxs_id = RsGxsId(data.toStdString());
|
||||||
|
|
||||||
|
if (RsGxsGroupId(gxs_id).isNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IdDetailsDialog *dialog = new IdDetailsDialog(RsGxsGroupId(gxs_id));
|
||||||
|
dialog->show();
|
||||||
|
|
||||||
|
/* Dialog will destroy itself */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void PeopleDialog::cw_askForGXSIdentityWidget(RsGxsId gxs_id)
|
void PeopleDialog::cw_askForGXSIdentityWidget(RsGxsId gxs_id)
|
||||||
{
|
{
|
||||||
CircleWidget *dest =
|
CircleWidget *dest =
|
||||||
|
|
|
@ -84,6 +84,10 @@ private slots:
|
||||||
void pf_dropEventOccursExt(QDropEvent *event);
|
void pf_dropEventOccursExt(QDropEvent *event);
|
||||||
void pf_dropEventOccursInt(QDropEvent *event);
|
void pf_dropEventOccursInt(QDropEvent *event);
|
||||||
|
|
||||||
|
void chatIdentity();
|
||||||
|
void sendMessage();
|
||||||
|
void personDetails();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reloadAll();
|
void reloadAll();
|
||||||
void populatePictureFlowExt();
|
void populatePictureFlowExt();
|
||||||
|
|
|
@ -20,16 +20,7 @@
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="titleBarLayout">
|
<layout class="QGridLayout" name="titleBarLayout">
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
|
@ -94,8 +85,11 @@
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabExternal">
|
<widget class="QWidget" name="tabExternal">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -105,7 +99,7 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>External</string>
|
<string>People</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout">
|
||||||
<item>
|
<item>
|
||||||
|
@ -128,7 +122,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>685</width>
|
<width>701</width>
|
||||||
<height>248</height>
|
<height>248</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -197,7 +191,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>685</width>
|
<width>701</width>
|
||||||
<height>248</height>
|
<height>248</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue