mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 14:10:54 -04:00
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:
parent
b0a8eba546
commit
5dd26de35b
8 changed files with 273 additions and 274 deletions
|
@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue