improved display in Identity tab

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7557 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-09-24 20:13:19 +00:00
parent c074d3abc3
commit e93c814427
2 changed files with 66 additions and 40 deletions

View File

@ -83,7 +83,7 @@ IdDialog::IdDialog(QWidget *parent)
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui.lineEdit_Nickname);
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui.lineEdit_KeyId);
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui.lineEdit_GpgHash);
// mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui.lineEdit_GpgHash);
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui.lineEdit_GpgId);
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui.lineEdit_GpgName);
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui.toolButton_Reputation);
@ -104,7 +104,7 @@ IdDialog::IdDialog(QWidget *parent)
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.lineEdit_Nickname);
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.lineEdit_GpgName);
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.lineEdit_KeyId);
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.lineEdit_GpgHash);
// mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.lineEdit_GpgHash);
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.lineEdit_GpgId);
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.lineEdit_GpgName);
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui.line_RatingOverall);
@ -115,7 +115,7 @@ IdDialog::IdDialog(QWidget *parent)
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.lineEdit_Nickname);
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.lineEdit_GpgName);
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.lineEdit_KeyId);
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.lineEdit_GpgHash);
// mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.lineEdit_GpgHash);
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.lineEdit_GpgId);
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.lineEdit_GpgName);
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui.line_RatingOverall);
@ -310,6 +310,19 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item,
item->setText(RSID_COL_NICKNAME, QString::fromUtf8(data.mMeta.mGroupName.c_str()));
item->setText(RSID_COL_KEYID, QString::fromStdString(data.mMeta.mGroupId.toStdString()));
if(isOwnId)
{
QFont font = item->font(RSID_COL_NICKNAME) ;
font.setWeight(QFont::Bold) ;
item->setFont(RSID_COL_NICKNAME,font) ;
item->setFont(RSID_COL_KEYID,font) ;
item->setFont(RSID_COL_IDTYPE,font) ;
item->setToolTip(RSID_COL_NICKNAME,tr("This identity is owned by you")) ;
item->setToolTip(RSID_COL_KEYID ,tr("This identity is owned by you")) ;
item->setToolTip(RSID_COL_IDTYPE ,tr("This identity is owned by you")) ;
}
QPixmap pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ;
std::cerr << "Setting item image : " << pixmap.width() << " x " << pixmap.height() << std::endl;
item->setIcon(RSID_COL_NICKNAME, QIcon(pixmap));
@ -321,15 +334,18 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item,
RsPeerDetails details;
rsPeers->getGPGDetails(data.mPgpId, details);
item->setText(RSID_COL_IDTYPE, QString::fromUtf8(details.name.c_str()));
item->setToolTip(RSID_COL_IDTYPE,QString()) ;
}
else
{
item->setText(RSID_COL_IDTYPE, tr("PGP Linked Id"));
item->setText(RSID_COL_IDTYPE, tr("Unknown PGP key 0x")+QString::fromStdString(data.mPgpId.toStdString()));
item->setToolTip(RSID_COL_IDTYPE,tr("Unknown key ID")) ;
}
}
else
{
item->setText(RSID_COL_IDTYPE, tr("Anon Id"));
item->setText(RSID_COL_IDTYPE, QString()) ;
item->setToolTip(RSID_COL_IDTYPE,QString()) ;
}
return true;
@ -481,7 +497,7 @@ void IdDialog::insertIdDetails(uint32_t token)
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_GpgHash->setText(QString::fromStdString(data.mPgpIdHash.toStdString()));
ui.lineEdit_GpgId->setText(QString::fromStdString(data.mPgpId.toStdString()));
ui.headerFrame->setHeaderText(QString::fromUtf8(data.mMeta.mGroupName.c_str()));
@ -508,6 +524,21 @@ void IdDialog::insertIdDetails(uint32_t token)
}
}
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)

View File

@ -122,7 +122,7 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QFrame" name="toolBarFrame">
@ -253,24 +253,24 @@
</property>
<column>
<property name="text">
<string>Nickname</string>
<string>Identity name</string>
</property>
</column>
<column>
<property name="text">
<string>KeyId</string>
<string>Key ID</string>
</property>
</column>
<column>
<property name="text">
<string>Type</string>
<string>Linked to Retroshare node...</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="HeaderFrame" name="headerFrame">
@ -386,6 +386,13 @@
<property name="margin">
<number>6</number>
</property>
<item row="2" column="0">
<widget class="QLabel" name="PgpId_LB">
<property name="text">
<string>Owner node ID</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Nickname">
<property name="enabled">
@ -399,7 +406,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Nickname</string>
<string>Identity name</string>
</property>
</widget>
</item>
@ -416,19 +423,19 @@
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Key ID</string>
<string>Identity ID</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<item row="3" column="0">
<widget class="QLabel" name="PgpName_LB">
<property name="text">
<string>PGP Hash</string>
<string>Owner node name</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_GpgHash">
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_GpgName">
<property name="enabled">
<bool>true</bool>
</property>
@ -437,14 +444,7 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>PGP Id</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_GpgId">
<property name="enabled">
<bool>true</bool>
@ -454,22 +454,18 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>PGP Name</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_GpgName">
<property name="enabled">
<bool>true</bool>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="readOnly">
<bool>true</bool>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
@ -736,7 +732,6 @@
<tabstop>toolButton_EditId</tabstop>
<tabstop>lineEdit_Nickname</tabstop>
<tabstop>lineEdit_KeyId</tabstop>
<tabstop>lineEdit_GpgHash</tabstop>
<tabstop>lineEdit_GpgId</tabstop>
<tabstop>lineEdit_GpgName</tabstop>
<tabstop>radioButton_IdYourself</tabstop>