mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-22 21:31:07 -05:00
Merge pull request #2609 from defnax/removeavatarbtn
Added remove Avatar button
This commit is contained in:
commit
1056be1899
@ -88,6 +88,7 @@ IdEditDialog::IdEditDialog(QWidget *parent) :
|
|||||||
connect(ui->toolButton_Tag4, SIGNAL(clicked(bool)), this, SLOT(rmTag4()));
|
connect(ui->toolButton_Tag4, SIGNAL(clicked(bool)), this, SLOT(rmTag4()));
|
||||||
connect(ui->toolButton_Tag5, SIGNAL(clicked(bool)), this, SLOT(rmTag5()));
|
connect(ui->toolButton_Tag5, SIGNAL(clicked(bool)), this, SLOT(rmTag5()));
|
||||||
connect(ui->avatarButton, SIGNAL(clicked(bool)), this, SLOT(changeAvatar()));
|
connect(ui->avatarButton, SIGNAL(clicked(bool)), this, SLOT(changeAvatar()));
|
||||||
|
connect(ui->removeButton, SIGNAL(clicked(bool)), this, SLOT(removeAvatar()));
|
||||||
|
|
||||||
connect(ui->avatarLabel,SIGNAL(cleared()),this,SLOT(avatarCleared()));
|
connect(ui->avatarLabel,SIGNAL(cleared()),this,SLOT(avatarCleared()));
|
||||||
|
|
||||||
@ -102,6 +103,8 @@ IdEditDialog::IdEditDialog(QWidget *parent) :
|
|||||||
ui->plainTextEdit_Tag->hide();
|
ui->plainTextEdit_Tag->hide();
|
||||||
ui->label_TagCheck->hide();
|
ui->label_TagCheck->hide();
|
||||||
ui->frame_Tags->setHidden(true);
|
ui->frame_Tags->setHidden(true);
|
||||||
|
|
||||||
|
updateInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
IdEditDialog::~IdEditDialog() {}
|
IdEditDialog::~IdEditDialog() {}
|
||||||
@ -136,6 +139,8 @@ void IdEditDialog::changeAvatar()
|
|||||||
|
|
||||||
// shows the tooltip for a while
|
// shows the tooltip for a while
|
||||||
QToolTip::showText( ui->avatarLabel->mapToGlobal( QPoint( 0, 0 ) ), ui->avatarLabel->toolTip() );
|
QToolTip::showText( ui->avatarLabel->mapToGlobal( QPoint( 0, 0 ) ), ui->avatarLabel->toolTip() );
|
||||||
|
|
||||||
|
updateInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdEditDialog::setupNewId(bool pseudo,bool enable_anon)
|
void IdEditDialog::setupNewId(bool pseudo,bool enable_anon)
|
||||||
@ -353,6 +358,7 @@ void IdEditDialog::loadExistingId(const RsGxsIdGroup& id_group)
|
|||||||
ui->frame_Tags->setHidden(true);
|
ui->frame_Tags->setHidden(true);
|
||||||
|
|
||||||
loadRecognTags();
|
loadRecognTags();
|
||||||
|
updateInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_RECOGN_TAGS 5
|
#define MAX_RECOGN_TAGS 5
|
||||||
@ -679,3 +685,22 @@ void IdEditDialog::updateId()
|
|||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IdEditDialog::removeAvatar()
|
||||||
|
{
|
||||||
|
ui->avatarLabel->setPicture(QPixmap());
|
||||||
|
mEditGroup.mImage.clear();
|
||||||
|
|
||||||
|
updateInterface();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IdEditDialog::updateInterface()
|
||||||
|
{
|
||||||
|
const QPixmap *pixmap = ui->avatarLabel->pixmap();
|
||||||
|
if (pixmap && !pixmap->isNull()) {
|
||||||
|
ui->removeButton->setEnabled(true);
|
||||||
|
} else if (mEditGroup.mImage.mSize != NULL) {
|
||||||
|
ui->removeButton->setEnabled(true);
|
||||||
|
} else {
|
||||||
|
ui->removeButton->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -54,6 +54,8 @@ private slots:
|
|||||||
void avatarCleared();
|
void avatarCleared();
|
||||||
|
|
||||||
void changeAvatar();
|
void changeAvatar();
|
||||||
|
void removeAvatar();
|
||||||
|
void updateInterface();
|
||||||
|
|
||||||
void addRecognTag();
|
void addRecognTag();
|
||||||
void checkNewTag();
|
void checkNewTag();
|
||||||
|
@ -369,6 +369,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="removeButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="avatarVSpacer">
|
<spacer name="avatarVSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user