mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
Merge pull request #2385 from RetroShare/v0.6.6-Official-Release
Recent fixes to V0.6.6 official release
This commit is contained in:
commit
3f50f6f2d6
11 changed files with 70 additions and 19 deletions
|
@ -46,6 +46,7 @@ IdEditDialog::IdEditDialog(QWidget *parent) :
|
||||||
ui(new(Ui::IdEditDialog))
|
ui(new(Ui::IdEditDialog))
|
||||||
{
|
{
|
||||||
mIsNew = true;
|
mIsNew = true;
|
||||||
|
mAvatarIsSet = false;
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -88,6 +89,11 @@ IdEditDialog::IdEditDialog(QWidget *parent) :
|
||||||
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->avatarLabel,SIGNAL(cleared()),this,SLOT(avatarCleared()));
|
||||||
|
|
||||||
|
ui->avatarLabel->setEnableClear(true);
|
||||||
|
ui->avatarLabel->setToolTip(tr("No Avatar chosen. A default image will be automatically displayed from your new identity."));
|
||||||
|
|
||||||
/* Initialize ui */
|
/* Initialize ui */
|
||||||
ui->lineEdit_Nickname->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
|
ui->lineEdit_Nickname->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
|
||||||
|
|
||||||
|
@ -125,7 +131,8 @@ void IdEditDialog::changeAvatar()
|
||||||
|
|
||||||
ui->avatarLabel->setPicture(QPixmap::fromImage(img));
|
ui->avatarLabel->setPicture(QPixmap::fromImage(img));
|
||||||
ui->avatarLabel->setEnableZoom(true);
|
ui->avatarLabel->setEnableZoom(true);
|
||||||
ui->avatarLabel->setToolTip(tr("Use the mouse to zoom and adjust the image for your avatar."));
|
ui->avatarLabel->setToolTip(tr("Use the mouse to zoom and adjust the image for your avatar. Hit Del to remove it."));
|
||||||
|
mAvatarIsSet = true;
|
||||||
|
|
||||||
// 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() );
|
||||||
|
@ -205,15 +212,24 @@ void IdEditDialog::updateIdType(bool pseudo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IdEditDialog::avatarCleared()
|
||||||
|
{
|
||||||
|
setAvatar(QPixmap());
|
||||||
|
}
|
||||||
|
|
||||||
void IdEditDialog::setAvatar(const QPixmap &avatar)
|
void IdEditDialog::setAvatar(const QPixmap &avatar)
|
||||||
{
|
{
|
||||||
mAvatar = avatar;
|
mAvatar = avatar;
|
||||||
|
|
||||||
if (!mAvatar.isNull()) {
|
if (!mAvatar.isNull()) {
|
||||||
ui->avatarLabel->setPicture(avatar);
|
ui->avatarLabel->setPicture(avatar);
|
||||||
|
mAvatarIsSet = true;
|
||||||
|
ui->avatarLabel->setToolTip(tr("Use the mouse to zoom and adjust the image for your avatar. Hit Del to remove it."));
|
||||||
} else {
|
} else {
|
||||||
// we need to use the default pixmap here, generated from the ID
|
// we need to use the default pixmap here, generated from the ID
|
||||||
ui->avatarLabel->setPicture(GxsIdDetails::makeDefaultIcon(RsGxsId(mEditGroup.mMeta.mGroupId)));
|
ui->avatarLabel->setText(tr("No avatar chosen")); // This clears up the image
|
||||||
|
mAvatarIsSet = false;
|
||||||
|
ui->avatarLabel->setToolTip(tr("No Avatar chosen. A default image will be automatically displayed from your new identity."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,13 +533,9 @@ void IdEditDialog::loadRecognTags()
|
||||||
void IdEditDialog::submit()
|
void IdEditDialog::submit()
|
||||||
{
|
{
|
||||||
if (mIsNew)
|
if (mIsNew)
|
||||||
{
|
|
||||||
createId();
|
createId();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
updateId();
|
updateId();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdEditDialog::createId()
|
void IdEditDialog::createId()
|
||||||
|
@ -551,10 +563,10 @@ void IdEditDialog::createId()
|
||||||
params.nickname = groupname.toUtf8().constData();
|
params.nickname = groupname.toUtf8().constData();
|
||||||
params.isPgpLinked = (ui->radioButton_GpgId->isChecked());
|
params.isPgpLinked = (ui->radioButton_GpgId->isChecked());
|
||||||
|
|
||||||
|
if(mAvatarIsSet)
|
||||||
|
{
|
||||||
mAvatar = ui->avatarLabel->extractCroppedScaledPicture();
|
mAvatar = ui->avatarLabel->extractCroppedScaledPicture();
|
||||||
|
|
||||||
if (!mAvatar.isNull())
|
|
||||||
{
|
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
QBuffer buffer(&ba);
|
QBuffer buffer(&ba);
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ public:
|
||||||
private slots:
|
private slots:
|
||||||
void idTypeToggled(bool checked);
|
void idTypeToggled(bool checked);
|
||||||
void submit();
|
void submit();
|
||||||
|
void avatarCleared();
|
||||||
|
|
||||||
void changeAvatar();
|
void changeAvatar();
|
||||||
|
|
||||||
|
@ -84,6 +85,7 @@ protected:
|
||||||
RsGxsGroupId mGroupId;
|
RsGxsGroupId mGroupId;
|
||||||
|
|
||||||
QPixmap mAvatar; // Avatar from identity (not calculated)
|
QPixmap mAvatar; // Avatar from identity (not calculated)
|
||||||
|
bool mAvatarIsSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -310,6 +310,9 @@
|
||||||
<height>128</height>
|
<height>128</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::StrongFocus</enum>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::Box</enum>
|
<enum>QFrame::Box</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -403,7 +403,7 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString name;
|
QString name;
|
||||||
if (chatId.isLobbyId() || chatId.isDistantChatId() || chatId.isPeerId())
|
if (!chatId.isNotSet())
|
||||||
{
|
{
|
||||||
RsIdentityDetails details;
|
RsIdentityDetails details;
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,8 @@ RsFriendListModel::EntryIndex RsFriendListModel::EntryIndex::parent() const
|
||||||
i.node_index = UNDEFINED_NODE_INDEX_VALUE;
|
i.node_index = UNDEFINED_NODE_INDEX_VALUE;
|
||||||
break;
|
break;
|
||||||
case ENTRY_TYPE_UNKNOWN:
|
case ENTRY_TYPE_UNKNOWN:
|
||||||
RS_ERR("Unknown Entry type for parent.");
|
//Can be when request root index.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
|
|
|
@ -1104,7 +1104,7 @@ QString nickname ;
|
||||||
nickname = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE) ;
|
nickname = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE) ;
|
||||||
|
|
||||||
|
|
||||||
comment = QString("%1:%2<br/>%3:%4").arg(QApplication::translate("GxsIdDetails", "Identity name"),
|
comment = QString("%1: %2<br/>%3: %4").arg(QApplication::translate("GxsIdDetails", "Identity name"),
|
||||||
nickname,
|
nickname,
|
||||||
QApplication::translate("GxsIdDetails", "Identity Id"),
|
QApplication::translate("GxsIdDetails", "Identity Id"),
|
||||||
QString::fromStdString(details.mId.toStdString()));
|
QString::fromStdString(details.mId.toStdString()));
|
||||||
|
|
|
@ -169,8 +169,11 @@ QVariant GxsIdRSTreeWidgetItem::data(int column, int role) const
|
||||||
|
|
||||||
QString embeddedImage;
|
QString embeddedImage;
|
||||||
|
|
||||||
if ( RsHtml::makeEmbeddedImage( pix.scaled(QSize(4*S,4*S), Qt::KeepAspectRatio, Qt::SmoothTransformation ).toImage(), embeddedImage, 8*S * 8*S ) )
|
if ( RsHtml::makeEmbeddedImage( pix.scaled(QSize(5*S,5*S), Qt::KeepAspectRatio, Qt::SmoothTransformation ).toImage(), embeddedImage, -1 ) )
|
||||||
|
{
|
||||||
|
embeddedImage.insert(embeddedImage.indexOf("src="), "style=\"float:left\" ");
|
||||||
t = "<table><tr><td>" + embeddedImage + "</td><td>" + t + "</td></table>";
|
t = "<table><tr><td>" + embeddedImage + "</td><td>" + t + "</td></table>";
|
||||||
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,6 +217,25 @@ float ChannelPostThumbnailView::thumbnail_h() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZoomableLabel::keyPressEvent(QKeyEvent *e)
|
||||||
|
{
|
||||||
|
switch(e->key())
|
||||||
|
{
|
||||||
|
case Qt::Key_Delete:
|
||||||
|
|
||||||
|
if(mClearEnabled)
|
||||||
|
{
|
||||||
|
mFullImage = QPixmap();
|
||||||
|
emit cleared();
|
||||||
|
e->accept();
|
||||||
|
updateView();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
QLabel::keyPressEvent(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ZoomableLabel::reset()
|
void ZoomableLabel::reset()
|
||||||
{
|
{
|
||||||
mCenterX = mFullImage.width()/2.0;
|
mCenterX = mFullImage.width()/2.0;
|
||||||
|
|
|
@ -40,18 +40,22 @@ class ZoomableLabel: public QLabel
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ZoomableLabel(QWidget *parent): QLabel(parent),mUseStyleSheet(true),mZoomFactor(1.0),mCenterX(0.0),mCenterY(0.0),mZoomEnabled(true) {}
|
ZoomableLabel(QWidget *parent): QLabel(parent),mUseStyleSheet(true),mZoomFactor(1.0),mCenterX(0.0),mCenterY(0.0),mZoomEnabled(true),mClearEnabled(false) {}
|
||||||
|
|
||||||
void setPicture(const QPixmap& pix);
|
void setPicture(const QPixmap& pix);
|
||||||
void setEnableZoom(bool b) { mZoomEnabled = b; }
|
void setEnableZoom(bool b) { mZoomEnabled = b; }
|
||||||
|
void setEnableClear(bool b) { mClearEnabled = b; }
|
||||||
void reset();
|
void reset();
|
||||||
QPixmap extractCroppedScaledPicture() const;
|
QPixmap extractCroppedScaledPicture() const;
|
||||||
void updateView();
|
void updateView();
|
||||||
|
|
||||||
|
virtual void keyPressEvent(QKeyEvent *ev) override;
|
||||||
|
|
||||||
const QPixmap& originalImage() const { return mFullImage ; }
|
const QPixmap& originalImage() const { return mFullImage ; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void clicked();
|
void clicked();
|
||||||
|
void cleared();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent *ev) override;
|
void mousePressEvent(QMouseEvent *ev) override;
|
||||||
|
@ -73,6 +77,7 @@ protected:
|
||||||
int mLastX,mLastY;
|
int mLastX,mLastY;
|
||||||
bool mMoving;
|
bool mMoving;
|
||||||
bool mZoomEnabled;
|
bool mZoomEnabled;
|
||||||
|
bool mClearEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Class to paint the thumbnails with title
|
// Class to paint the thumbnails with title
|
||||||
|
|
|
@ -563,11 +563,14 @@ QVariant RsGxsForumModel::toolTipRole(const ForumModelPostEntry& fmpe,int column
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
int S = QFontMetricsF(QApplication::font()).height();
|
int S = QFontMetricsF(QApplication::font()).height();
|
||||||
QImage pix( (*icons.begin()).pixmap(QSize(4*S,4*S)).toImage());
|
QImage pix( (*icons.begin()).pixmap(QSize(5*S,5*S)).toImage());
|
||||||
|
|
||||||
QString embeddedImage;
|
QString embeddedImage;
|
||||||
if(RsHtml::makeEmbeddedImage(pix.scaled(QSize(4*S,4*S), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, 8*S * 8*S))
|
if(RsHtml::makeEmbeddedImage(pix.scaled(QSize(5*S,5*S), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, -1))
|
||||||
|
{
|
||||||
|
embeddedImage.insert(embeddedImage.indexOf("src="), "style=\"float:left\" ");
|
||||||
comment = "<table><tr><td>" + embeddedImage + "</td><td>" + comment + "</td></table>";
|
comment = "<table><tr><td>" + embeddedImage + "</td><td>" + comment + "</td></table>";
|
||||||
|
}
|
||||||
|
|
||||||
return comment;
|
return comment;
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,11 +399,14 @@ QVariant RsMessageModel::toolTipRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
int S = QFontMetricsF(QApplication::font()).height();
|
int S = QFontMetricsF(QApplication::font()).height();
|
||||||
QImage pix( (*icons.begin()).pixmap(QSize(4*S,4*S)).toImage());
|
QImage pix( (*icons.begin()).pixmap(QSize(5*S,5*S)).toImage());
|
||||||
|
|
||||||
QString embeddedImage;
|
QString embeddedImage;
|
||||||
if(RsHtml::makeEmbeddedImage(pix.scaled(QSize(4*S,4*S), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, 8*S * 8*S))
|
if(RsHtml::makeEmbeddedImage(pix.scaled(QSize(5*S,5*S), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, -1))
|
||||||
|
{
|
||||||
|
embeddedImage.insert(embeddedImage.indexOf("src="), "style=\"float:left\" ");
|
||||||
comment = "<table><tr><td>" + embeddedImage + "</td><td>" + comment + "</td></table>";
|
comment = "<table><tr><td>" + embeddedImage + "</td><td>" + comment + "</td></table>";
|
||||||
|
}
|
||||||
|
|
||||||
return comment;
|
return comment;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue