mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-29 20:06:38 -05:00
Merge pull request #1077 from hunbernd/feature/image-embed3
Make it possible to send images over chat lobby
This commit is contained in:
commit
1c2d17b5c1
8 changed files with 262 additions and 64 deletions
|
|
@ -69,7 +69,7 @@ void MimeTextEdit::insertFromMimeData(const QMimeData* source)
|
|||
QImage image = qvariant_cast<QImage>(source->imageData());
|
||||
if (image.isNull() == false) {
|
||||
QString encodedImage;
|
||||
if (RsHtml::makeEmbeddedImage(image, encodedImage, 640*480)) {
|
||||
if (RsHtml::makeEmbeddedImage(image, encodedImage, 640*480, mMaxBytes)) {
|
||||
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
|
||||
textCursor().insertFragment(fragment);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ public:
|
|||
QColor textColorQuote() const { return highliter->textColorQuote();}
|
||||
bool onlyPlainText() const {return mOnlyPlainText;}
|
||||
|
||||
void setMaxBytes(int limit) {mMaxBytes = limit;}
|
||||
|
||||
public slots:
|
||||
void setTextColorQuote(QColor textColorQuote) { highliter->setTextColorQuote(textColorQuote);}
|
||||
void setOnlyPlainText(bool bOnlyPlainText) {mOnlyPlainText = bOnlyPlainText;}
|
||||
|
|
@ -83,6 +85,7 @@ private:
|
|||
QList<QAction*> mContextMenuActions;
|
||||
RsSyntaxHighlighter *highliter;
|
||||
bool mOnlyPlainText;
|
||||
int mMaxBytes = -1; //limit content size, for pasting images
|
||||
};
|
||||
|
||||
#endif // MIMETEXTEDIT_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue