Enabled to display extern gxs Avatars on ID Details Dialog

Moved remove button under the add btn,for better look.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7901 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2015-02-02 00:47:49 +00:00
parent 63a3051d3c
commit 88c6af3b74
2 changed files with 25 additions and 37 deletions

View file

@ -153,12 +153,17 @@ void IdDetailsDialog::insertIdDetails(uint32_t token)
//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->lineEdit_GpgId->setText(QString::fromStdString(data.mPgpId.toStdString()));
QPixmap pix = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ; QPixmap pixmap;
if(data.mImage.mSize > 0 && pixmap.loadFromData(data.mImage.mData, data.mImage.mSize, "PNG"))
ui->avatarLabel->setPixmap(pixmap);
else
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ;
ui->avatarLabel->setPixmap(pixmap); // we need to use the default pixmap here, generated from the ID
#ifdef ID_DEBUG #ifdef ID_DEBUG
std::cerr << "Setting header frame image : " << pix.width() << " x " << pix.height() << std::endl; std::cerr << "Setting header frame image : " << pix.width() << " x " << pix.height() << std::endl;
#endif #endif
ui->avatarLabel->setPixmap(pix);
if (data.mPgpKnown) if (data.mPgpKnown)
{ {

View file

@ -197,7 +197,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="avatarLabel"> <widget class="QLabel" name="avatarLabel">
<property name="sizePolicy"> <property name="sizePolicy">
@ -229,11 +229,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>2</number>
</property>
<item> <item>
<widget class="QPushButton" name="avatarButton"> <widget class="QPushButton" name="avatarButton">
<property name="text"> <property name="text">
@ -243,34 +238,22 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="removeButton"> <widget class="QPushButton" name="removeButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Remove Avatar</string> <string>Remove Avatar</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>Remove</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/delete.png</normaloff>:/images/delete.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item> <item>
<spacer name="verticalSpacer_4"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>138</width> <width>20</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>