Used AvatarDialog to choose an avatar for an identity.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7913 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-02-05 00:10:37 +00:00
parent b0a8eba546
commit 5dd26de35b
8 changed files with 273 additions and 274 deletions

View file

@ -28,8 +28,6 @@
#include "gui/common/AvatarDefs.h"
#include "gui/common/AvatarDialog.h"
#include "util/misc.h"
#include "AvatarWidget.h"
#include "ui_AvatarWidget.h"
@ -84,9 +82,21 @@ QString AvatarWidget::frameState()
void AvatarWidget::mouseReleaseEvent(QMouseEvent */*event*/)
{
if (mFlag.isOwnId) {
AvatarDialog *dialog = new AvatarDialog();
dialog->show();
if (!mFlag.isOwnId) {
return;
}
AvatarDialog dialog(this);
QPixmap avatar;
AvatarDefs::getOwnAvatar(avatar, "");
dialog.setAvatar(avatar);
if (dialog.exec() == QDialog::Accepted) {
QByteArray newAvatar;
dialog.getAvatar(newAvatar);
rsMsgs->setOwnAvatarData((unsigned char *)(newAvatar.data()), newAvatar.size()) ; // last char 0 included.
}
}