mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Added Person details dialog, for popup mode view.
changed from setEnabled to setVisible, to not show up the disabled actions for Own Ids. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7871 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9236f01238
commit
4a4ea80110
335
retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp
Normal file
335
retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp
Normal file
@ -0,0 +1,335 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2015 RetroShare Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include "IdDetailsDialog.h"
|
||||
#include "ui_IdDetailsDialog.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/common/UIStateHelper.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
#define IDDETAILSDIALOG_IDDETAILS 1
|
||||
|
||||
/******
|
||||
* #define ID_DEBUG 1
|
||||
*****/
|
||||
|
||||
/** Default constructor */
|
||||
IdDetailsDialog::IdDetailsDialog(const RsGxsGroupId& id, QWidget *parent) :
|
||||
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
|
||||
mId(id),
|
||||
ui(new Ui::IdDetailsDialog)
|
||||
{
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui->setupUi(this);
|
||||
|
||||
/* Setup UI helper */
|
||||
mStateHelper = new UIStateHelper(this);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Type);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->toolButton_Reputation);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOverall);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingImplicit);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOwn);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingPeers);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repModButton);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Accept);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Ban);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Negative);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Positive);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Custom);
|
||||
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_spinBox);
|
||||
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Type);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOverall);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingImplicit);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOwn);
|
||||
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingPeers);
|
||||
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Type);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOverall);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingImplicit);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOwn);
|
||||
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingPeers);
|
||||
|
||||
/* Create token queue */
|
||||
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
||||
|
||||
Settings->loadWidgetInformation(this);
|
||||
|
||||
ui->headerFrame->setHeaderImage(QPixmap(":/images/identity/identity_64.png"));
|
||||
ui->headerFrame->setHeaderText(tr("Person Details"));
|
||||
|
||||
//connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(changeGroup()));
|
||||
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
// Hiding Rep Btn until that part is finished.
|
||||
ui->toolButton_Reputation->setVisible(false);
|
||||
|
||||
requestIdDetails();
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
IdDetailsDialog::~IdDetailsDialog()
|
||||
{
|
||||
Settings->saveWidgetInformation(this);
|
||||
|
||||
delete(ui);
|
||||
delete(mIdQueue);
|
||||
}
|
||||
|
||||
void IdDetailsDialog::insertIdDetails(uint32_t token)
|
||||
{
|
||||
mStateHelper->setLoading(IDDETAILSDIALOG_IDDETAILS, false);
|
||||
|
||||
/* get details from libretroshare */
|
||||
std::vector<RsGxsIdGroup> datavector;
|
||||
if (!rsIdentity->getGroupData(token, datavector))
|
||||
{
|
||||
mStateHelper->setActive(IDDETAILSDIALOG_IDDETAILS, false);
|
||||
mStateHelper->clear(IDDETAILSDIALOG_IDDETAILS);
|
||||
|
||||
ui->lineEdit_KeyId->setText("ERROR GETTING KEY!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (datavector.size() != 1)
|
||||
{
|
||||
#ifdef ID_DEBUG
|
||||
std::cerr << "IdDetailsDialog::insertIdDetails() Invalid datavector size";
|
||||
#endif
|
||||
|
||||
mStateHelper->setActive(IDDETAILSDIALOG_IDDETAILS, false);
|
||||
mStateHelper->clear(IDDETAILSDIALOG_IDDETAILS);
|
||||
|
||||
ui->lineEdit_KeyId->setText("INVALID DV SIZE");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
mStateHelper->setActive(IDDETAILSDIALOG_IDDETAILS, true);
|
||||
|
||||
RsGxsIdGroup &data = datavector[0];
|
||||
|
||||
/* get GPG Details from rsPeers */
|
||||
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
|
||||
|
||||
ui->lineEdit_Nickname->setText(QString::fromUtf8(data.mMeta.mGroupName.c_str()));
|
||||
ui->lineEdit_KeyId->setText(QString::fromStdString(data.mMeta.mGroupId.toStdString()));
|
||||
//ui->lineEdit_GpgHash->setText(QString::fromStdString(data.mPgpIdHash.toStdString()));
|
||||
ui->lineEdit_GpgId->setText(QString::fromStdString(data.mPgpId.toStdString()));
|
||||
|
||||
QPixmap pix = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ;
|
||||
#ifdef ID_DEBUG
|
||||
std::cerr << "Setting header frame image : " << pix.width() << " x " << pix.height() << std::endl;
|
||||
#endif
|
||||
ui->headerFrame->setHeaderImage(QPixmap(pix));
|
||||
|
||||
|
||||
if (data.mPgpKnown)
|
||||
{
|
||||
RsPeerDetails details;
|
||||
rsPeers->getGPGDetails(data.mPgpId, details);
|
||||
ui->lineEdit_GpgName->setText(QString::fromUtf8(details.name.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
{
|
||||
ui->lineEdit_GpgName->setText(tr("Unknown real name"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->lineEdit_GpgName->setText(tr("Anonymous Id"));
|
||||
}
|
||||
}
|
||||
|
||||
if(data.mPgpId.isNull())
|
||||
{
|
||||
ui->lineEdit_GpgId->hide() ;
|
||||
ui->lineEdit_GpgName->hide() ;
|
||||
ui->PgpId_LB->hide() ;
|
||||
ui->PgpName_LB->hide() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->lineEdit_GpgId->show() ;
|
||||
ui->lineEdit_GpgName->show() ;
|
||||
ui->PgpId_LB->show() ;
|
||||
ui->PgpName_LB->show() ;
|
||||
}
|
||||
|
||||
bool isOwnId = (data.mPgpKnown && (data.mPgpId == ownPgpId)) || (data.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN);
|
||||
|
||||
if (isOwnId)
|
||||
if (data.mPgpKnown)
|
||||
ui->lineEdit_Type->setText(tr("Identity owned by you, linked to your Retroshare node")) ;
|
||||
else
|
||||
ui->lineEdit_Type->setText(tr("Anonymous identity, owned by you")) ;
|
||||
else if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
{
|
||||
if (data.mPgpKnown)
|
||||
if (rsPeers->isGPGAccepted(data.mPgpId))
|
||||
ui->lineEdit_Type->setText(tr("Owned by a friend Retroshare node")) ;
|
||||
else
|
||||
ui->lineEdit_Type->setText(tr("Owned by 2-hops Retroshare node")) ;
|
||||
else
|
||||
ui->lineEdit_Type->setText(tr("Owned by unknown Retroshare node")) ;
|
||||
}
|
||||
else
|
||||
ui->lineEdit_Type->setText(tr("Anonymous identity")) ;
|
||||
|
||||
// if (isOwnId)
|
||||
// {
|
||||
// ui->radioButton_IdYourself->setChecked(true);
|
||||
// }
|
||||
// else if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
// {
|
||||
// if (data.mPgpKnown)
|
||||
// {
|
||||
// if (rsPeers->isGPGAccepted(data.mPgpId))
|
||||
// {
|
||||
// ui->radioButton_IdFriend->setChecked(true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ui->radioButton_IdFOF->setChecked(true);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ui->radioButton_IdOther->setChecked(true);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ui->radioButton_IdPseudo->setChecked(true);
|
||||
// }
|
||||
|
||||
if (isOwnId)
|
||||
{
|
||||
//mStateHelper->setWidgetEnabled(ui->toolButton_Reputation, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No Reputation yet!
|
||||
//mStateHelper->setWidgetEnabled(ui->toolButton_Reputation, /*true*/ false);
|
||||
}
|
||||
|
||||
/* now fill in the reputation information */
|
||||
ui->line_RatingOverall->setText("Overall Rating TODO");
|
||||
ui->line_RatingOwn->setText("Own Rating TODO");
|
||||
|
||||
if (data.mPgpKnown)
|
||||
{
|
||||
ui->line_RatingImplicit->setText("+50 Known PGP");
|
||||
}
|
||||
else if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
{
|
||||
ui->line_RatingImplicit->setText("+10 UnKnown PGP");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->line_RatingImplicit->setText("+5 Anon Id");
|
||||
}
|
||||
|
||||
{
|
||||
QString rating = QString::number(data.mReputation.mOverallScore);
|
||||
ui->line_RatingOverall->setText(rating);
|
||||
}
|
||||
|
||||
{
|
||||
QString rating = QString::number(data.mReputation.mIdScore);
|
||||
ui->line_RatingImplicit->setText(rating);
|
||||
}
|
||||
|
||||
{
|
||||
QString rating = QString::number(data.mReputation.mOwnOpinion);
|
||||
ui->line_RatingOwn->setText(rating);
|
||||
}
|
||||
|
||||
{
|
||||
QString rating = QString::number(data.mReputation.mPeerOpinion);
|
||||
ui->line_RatingPeers->setText(rating);
|
||||
}
|
||||
}
|
||||
|
||||
void IdDetailsDialog::requestIdDetails()
|
||||
{
|
||||
mIdQueue->cancelActiveRequestTokens(IDDETAILSDIALOG_IDDETAILS);
|
||||
|
||||
if (mId.isNull())
|
||||
{
|
||||
mStateHelper->setActive(IDDETAILSDIALOG_IDDETAILS, false);
|
||||
mStateHelper->setLoading(IDDETAILSDIALOG_IDDETAILS, false);
|
||||
mStateHelper->clear(IDDETAILSDIALOG_IDDETAILS);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
mStateHelper->setLoading(IDDETAILSDIALOG_IDDETAILS, true);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
uint32_t token;
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
groupIds.push_back(mId);
|
||||
|
||||
mIdQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, IDDETAILSDIALOG_IDDETAILS);
|
||||
}
|
||||
|
||||
void IdDetailsDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
if (queue != mIdQueue) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ID_DEBUG
|
||||
std::cerr << "IdDetailsDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
switch (req.mUserType)
|
||||
{
|
||||
case IDDETAILSDIALOG_IDDETAILS:
|
||||
insertIdDetails(req.mToken);
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cerr << "IdDetailsDialog::loadRequest() ERROR";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
62
retroshare-gui/src/gui/Identity/IdDetailsDialog.h
Normal file
62
retroshare-gui/src/gui/Identity/IdDetailsDialog.h
Normal file
@ -0,0 +1,62 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2014 - 2010 RetroShare Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef _IDDETAILSDIALOG_H
|
||||
#define _IDDETAILSDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "util/TokenQueue.h"
|
||||
#include <retroshare/rsidentity.h>
|
||||
|
||||
namespace Ui {
|
||||
class IdDetailsDialog;
|
||||
}
|
||||
|
||||
class UIStateHelper;
|
||||
|
||||
class IdDetailsDialog : public QDialog, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Default constructor */
|
||||
IdDetailsDialog(const RsGxsGroupId &id, QWidget *parent = 0);
|
||||
/** Default destructor */
|
||||
~IdDetailsDialog();
|
||||
|
||||
/* TokenResponse */
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
private:
|
||||
void requestIdDetails();
|
||||
void insertIdDetails(uint32_t token);
|
||||
|
||||
private:
|
||||
RsGxsGroupId mId;
|
||||
TokenQueue *mIdQueue;
|
||||
UIStateHelper *mStateHelper;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::IdDetailsDialog *ui;
|
||||
};
|
||||
|
||||
#endif
|
395
retroshare-gui/src/gui/Identity/IdDetailsDialog.ui
Normal file
395
retroshare-gui/src/gui/Identity/IdDetailsDialog.ui
Normal file
@ -0,0 +1,395 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>IdDetailsDialog</class>
|
||||
<widget class="QDialog" name="IdDetailsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>698</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Person Details</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/logo/logo_32.png</normaloff>:/images/logo/logo_32.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="HeaderFrame" name="headerFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="detailsGroupBox">
|
||||
<property name="title">
|
||||
<string>Identity Info</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="PgpId_LB">
|
||||
<property name="text">
|
||||
<string>Owner node ID :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_Type"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_KeyId">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_Nickname">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_GpgName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="PgpName_LB">
|
||||
<property name="text">
|
||||
<string>Owner node name :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_GpgId">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Identity name :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Identity ID :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="reputationGroupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Reputation</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Overall</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="line_RatingOverall">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Implicit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="line_RatingImplicit">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Opinion</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="line_RatingOwn">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Peers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="line_RatingPeers">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_Reputation">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit Reputation</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit_24.png</normaloff>:/images/edit_24.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="tweakGroupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Tweak Opinion</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="repMod_Accept">
|
||||
<property name="text">
|
||||
<string>Accept (+100)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="repMod_Positive">
|
||||
<property name="text">
|
||||
<string>Positive (+10)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="repMod_Negative">
|
||||
<property name="text">
|
||||
<string>Negative (-10)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="repMod_Ban">
|
||||
<property name="text">
|
||||
<string>Ban (-100)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="repMod_Custom">
|
||||
<property name="text">
|
||||
<string>Custom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="repMod_spinBox">
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="repModButton">
|
||||
<property name="text">
|
||||
<string>Modify</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="margin">
|
||||
<number>9</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="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>HeaderFrame</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>gui/common/HeaderFrame.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -134,8 +134,7 @@ IdDialog::IdDialog(QWidget *parent) :
|
||||
/* Connect signals */
|
||||
connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(addIdentity()));
|
||||
connect(ui->todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));
|
||||
//connect(ui->toolButton_Delete, SIGNAL(clicked()), this, SLOT(removeIdentity()));
|
||||
//connect(ui->toolButton_EditId, SIGNAL(clicked()), this, SLOT(editIdentity()));
|
||||
|
||||
connect(ui->removeIdentity, SIGNAL(triggered()), this, SLOT(removeIdentity()));
|
||||
connect(ui->editIdentity, SIGNAL(triggered()), this, SLOT(editIdentity()));
|
||||
connect(ui->chatIdentity, SIGNAL(triggered()), this, SLOT(chatIdentity()));
|
||||
@ -291,8 +290,8 @@ void IdDialog::updateSelection()
|
||||
void IdDialog::requestIdList()
|
||||
{
|
||||
//Disable by default, will be enable by insertIdDetails()
|
||||
ui->removeIdentity->setEnabled(false);
|
||||
ui->editIdentity->setEnabled(false);
|
||||
ui->removeIdentity->setVisible(false);
|
||||
ui->editIdentity->setVisible(false);
|
||||
|
||||
if (!mIdQueue)
|
||||
return;
|
||||
@ -635,16 +634,16 @@ void IdDialog::insertIdDetails(uint32_t token)
|
||||
if (isOwnId)
|
||||
{
|
||||
mStateHelper->setWidgetEnabled(ui->toolButton_Reputation, false);
|
||||
ui->editIdentity->setEnabled(true);
|
||||
ui->removeIdentity->setEnabled(true);
|
||||
ui->editIdentity->setVisible(true);
|
||||
ui->removeIdentity->setVisible(true);
|
||||
ui->chatIdentity->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No Reputation yet!
|
||||
mStateHelper->setWidgetEnabled(ui->toolButton_Reputation, /*true*/ false);
|
||||
ui->editIdentity->setEnabled(false);
|
||||
ui->removeIdentity->setEnabled(false);
|
||||
ui->editIdentity->setVisible(false);
|
||||
ui->removeIdentity->setVisible(false);
|
||||
ui->chatIdentity->setEnabled(true);
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/connect/ConfCertDialog.h"
|
||||
#include "gui/Identity/IdDetailsDialog.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/DateTime.h"
|
||||
@ -599,8 +600,11 @@ void MessageComposer::contextMenuMsgSendList(QPoint)
|
||||
contextMnu.addSeparator();
|
||||
|
||||
action = contextMnu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Friend Details"), this, SLOT(friendDetails()));
|
||||
action->setEnabled(selectedCount == 1 && idType == FriendSelectionWidget::IDTYPE_SSL);
|
||||
action->setVisible(selectedCount == 1 && idType == FriendSelectionWidget::IDTYPE_SSL);
|
||||
|
||||
action = contextMnu.addAction(QIcon(), tr("Person Details"), this, SLOT(identityDetails()));
|
||||
action->setVisible(selectedCount == 1 && idType == FriendSelectionWidget::IDTYPE_GXS);
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
@ -2447,6 +2451,23 @@ void MessageComposer::friendDetails()
|
||||
ConfCertDialog::showIt(RsPeerId(id), ConfCertDialog::PageDetails);
|
||||
}
|
||||
|
||||
void MessageComposer::identityDetails()
|
||||
{
|
||||
FriendSelectionWidget::IdType idType;
|
||||
std::string id = ui.friendSelectionWidget->selectedId(idType);
|
||||
|
||||
if (id.empty() || idType != FriendSelectionWidget::IDTYPE_GXS) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (RsGxsGroupId(id).isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
IdDetailsDialog dialog(RsGxsGroupId(id), this);
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void MessageComposer::tagAboutToShow()
|
||||
{
|
||||
TagsMenu *menu = dynamic_cast<TagsMenu*>(ui.tagButton->menu());
|
||||
|
@ -143,6 +143,7 @@ private slots:
|
||||
void addRecommend();
|
||||
void editingRecipientFinished();
|
||||
void friendDetails();
|
||||
void identityDetails();
|
||||
|
||||
void peerStatusChanged(const QString& peer_id, int status);
|
||||
|
||||
|
@ -1121,13 +1121,16 @@ identities {
|
||||
HEADERS += \
|
||||
gui/Identity/IdDialog.h \
|
||||
gui/Identity/IdEditDialog.h \
|
||||
gui/Identity/IdDetailsDialog.h \
|
||||
|
||||
FORMS += gui/Identity/IdDialog.ui \
|
||||
gui/Identity/IdEditDialog.ui \
|
||||
|
||||
gui/Identity/IdDetailsDialog.ui \
|
||||
|
||||
SOURCES += \
|
||||
gui/Identity/IdDialog.cpp \
|
||||
gui/Identity/IdEditDialog.cpp \
|
||||
gui/Identity/IdDetailsDialog.cpp \
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user