Added Button for Set Avatar, added border stylesheet for the Avatar label.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7877 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2015-01-26 16:50:01 +00:00
parent 301e8e7019
commit 3a64bc2601
4 changed files with 40 additions and 26 deletions

View File

@ -25,6 +25,7 @@
#include "gui/Identity/IdEditDialog.h"
#include "gui/common/UIStateHelper.h"
#include "gui/gxs/GxsIdDetails.h"
#include "util/TokenQueue.h"
#include "util/misc.h"
@ -81,7 +82,7 @@ IdEditDialog::IdEditDialog(QWidget *parent)
connect(ui.toolButton_Tag3, SIGNAL(clicked(bool)), this, SLOT(rmTag3()));
connect(ui.toolButton_Tag4, SIGNAL(clicked(bool)), this, SLOT(rmTag4()));
connect(ui.toolButton_Tag5, SIGNAL(clicked(bool)), this, SLOT(rmTag5()));
connect(ui.avatarLabel, SIGNAL(clicked(bool)), this, SLOT(changeAvatar()));
connect(ui.avatarButton, SIGNAL(clicked(bool)), this, SLOT(changeAvatar()));
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
ui.pushButton_Tag->setEnabled(false);
@ -193,11 +194,13 @@ void IdEditDialog::loadExistingId(uint32_t token)
}
mEditGroup = datavector[0];
QPixmap pixmap;
if(mEditGroup.mImage.mSize > 0 && pixmap.loadFromData(mEditGroup.mImage.mData, mEditGroup.mImage.mSize, "PNG"))
ui.avatarLabel->setPixmap(pixmap);
// else
// ui.avatarLabel->setPixmap(pixmap); // we need to use the default pixmap here, generated from the ID
else
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(mEditGroup.mMeta.mGroupId))) ;
ui.avatarLabel->setPixmap(pixmap); // we need to use the default pixmap here, generated from the ID
if (datavector.size() != 1)
{

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>515</width>
<height>591</height>
<height>507</height>
</rect>
</property>
<property name="sizePolicy">
@ -107,6 +107,13 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_GpgHash">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@ -138,13 +145,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_GpgHash">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
@ -173,6 +173,19 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
@ -198,7 +211,7 @@
</size>
</property>
<property name="text">
<string extracomment="Click here to change your avatar">TextLabel</string>
<string extracomment="Click here to change your avatar">Your Avatar</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -208,6 +221,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="avatarButton">
<property name="text">
<string>Set Avatar</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
@ -225,19 +245,6 @@
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>

View File

@ -325,7 +325,7 @@ QImage GxsIdDetails::makeDefaultIcon(const RsGxsId& id)
pix.setPixel( i, S-1-j, q) ;
}
image_cache[id] = pix.scaled(64,64,Qt::KeepAspectRatio,Qt::SmoothTransformation) ;
image_cache[id] = pix.scaled(128,128,Qt::KeepAspectRatio,Qt::SmoothTransformation) ;
return image_cache[id] ;
}

View File

@ -593,3 +593,7 @@ QFrame#distantFrame{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}
QLabel#avatarLabel{
border: 2px solid #CCCCCC;
border-radius: 4px;
}