Added remove Avatar functionality

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7882 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2015-01-27 16:36:27 +00:00
parent d2d0b2ae61
commit 6be1cb82b9
3 changed files with 51 additions and 7 deletions

View File

@ -83,6 +83,8 @@ IdEditDialog::IdEditDialog(QWidget *parent)
connect(ui.toolButton_Tag4, SIGNAL(clicked(bool)), this, SLOT(rmTag4()));
connect(ui.toolButton_Tag5, SIGNAL(clicked(bool)), this, SLOT(rmTag5()));
connect(ui.avatarButton, SIGNAL(clicked(bool)), this, SLOT(changeAvatar()));
connect(ui.removeButton, SIGNAL(clicked(bool)), this, SLOT(removeAvatar()));
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
ui.pushButton_Tag->setEnabled(false);
@ -537,3 +539,16 @@ void IdEditDialog::loadRequest(const TokenQueue */*queue*/, const TokenRequest &
// only one here!
loadExistingId(req.mToken);
}
void IdEditDialog::removeAvatar()
{
/* submit updated details */
std::string groupname = ui.lineEdit_Nickname->text().toUtf8().constData();
mEditGroup.mMeta.mGroupName = groupname;
mEditGroup.mImage.clear();
ui.avatarLabel->setPixmap(NULL);
uint32_t dummyToken = 0;
rsIdentity->updateIdentity(dummyToken, mEditGroup);
}

View File

@ -55,6 +55,8 @@ private slots:
void submit();
void changeAvatar() ;
void removeAvatar();
void addRecognTag();
void checkNewTag();
void rmTag1();

View File

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